Skip to content

feat(cli,gateway): add user-defined quick commands that bypass agent loop#746

Merged
teknium1 merged 1 commit intoNousResearch:mainfrom
teyrebaz33:feat/744-quick-commands
Mar 11, 2026
Merged

feat(cli,gateway): add user-defined quick commands that bypass agent loop#746
teknium1 merged 1 commit intoNousResearch:mainfrom
teyrebaz33:feat/744-quick-commands

Conversation

@teyrebaz33
Copy link
Copy Markdown
Contributor

Summary

Closes #744

Adds config-driven quick commands for both CLI and gateway that execute locally without invoking the LLM — zero token usage, works even when the provider is rate-limited or unavailable.

Config

# ~/.hermes/config.yaml
quick_commands:
  limits:
    type: exec
    command: /home/user/.local/bin/hermes-limits
  dn:
    type: exec
    command: echo daily-note

Behavior

  • CLI: /dn matches before skill commands, runs the exec, prints output
  • Gateway: /dn matches before skill commands, runs the exec, returns output as message
  • Unsupported type or missing command field → clear error message
  • 30s timeout with error message on expiry
  • Unknown commands fall through to existing error handling

Changes

  • hermes_cli/config.pyquick_commands: {} default
  • cli.py — quick command check before skill commands in process_command()
  • gateway/run.py — quick command check before skill commands in _handle_message()
  • tests/test_quick_commands.py — 11 tests

Not implemented

Permissions/allowlisting (item 5) — marked optional in the issue, can be a follow-up.

…loop

Implements config-driven quick commands for both CLI and gateway that
execute locally without invoking the LLM.

Config example (~/.hermes/config.yaml):
  quick_commands:
    limits:
      type: exec
      command: /home/user/.local/bin/hermes-limits
    dn:
      type: exec
      command: echo daily-note

Changes:
- hermes_cli/config.py: add quick_commands: {} default
- cli.py: check quick_commands before skill commands in process_command()
- gateway/run.py: check quick_commands before skill commands in _handle_message()
- tests/test_quick_commands.py: 11 tests covering exec, timeout, unsupported type, missing command, priority over skills

Closes NousResearch#744
@teknium1 teknium1 merged commit 3be6e8a into NousResearch:main Mar 11, 2026
teknium1 added a commit that referenced this pull request Mar 11, 2026
Documents the quick_commands config feature from PR #746:
- configuration.md: full section with examples (server status, disk,
  gpu, update), behavior notes (timeout, priority, works everywhere)
- cli.md: brief section with config example + link to config guide
@teknium1
Copy link
Copy Markdown
Contributor

Merged in 359352b with docs in c532129 — thanks @teyrebaz33! 🎉

This is especially useful for running quick server checks from Telegram/Discord without burning tokens. Added documentation to:

  • configuration.md: full section with practical examples (server status, disk usage, GPU monitoring, hermes-update)
  • cli.md: brief section with config example and link to the config guide

All 2975 tests pass. Appreciate the contribution! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants