Hermes Agent: CLI Command Line

Last updated: 2026-08-31

The CLI is Hermes Agent's most powerful operation mode — all features can be accessed via command line, supporting script integration, batch operations, and automation pipelines.

💡 Tip: The CLI is the most efficient way for developers to use Hermes. Desktop and Web versions cover 80% of features, CLI covers 100%. Automation scenarios require the CLI.

📋 Prerequisites: Lesson 2 Installation, Lesson 3 Configuration File

1. What You Will Learn

# Content
CLI command overview
Core command details
Conversation and interaction commands
Management and operations commands
Script integration and automation

2. Story

(1) Pain Point: Manual Operations Every Time

Bob's daily routine: open Hermes → switch model → start conversation → save results → send notification. 5 manual steps, tedious and easy to forget.

(2) Solution: One Command Does It All

Alice wrote a script that runs automatically every day:

BASH
#!/bin/bash
# daily-workflow.sh
hermes chat --model gpt-4o --skill daily-briefing --output report.md
hermes notify telegram --file report.md
hermes checkpoint save "daily-$(date +%Y%m%d)"

3. CLI Command Overview

(1) Command Categories

Category Command Description
Core hermes chat Interactive conversation
hermes serve Start API server
hermes run Single task execution
Config hermes init Initialize
hermes config Configuration management
hermes model Model management
Memory hermes memory Memory management
Skills hermes skill Skill management
Tools hermes tool Tool management
Platforms hermes platform Platform management
Scheduled hermes cron Scheduled tasks
Checkpoints hermes checkpoint Checkpoint management
Delegation hermes delegate Task delegation
Plugins hermes plugin Plugin management
Dashboard hermes dashboard Data dashboard
Profile hermes profile User configuration

4. Core Command Details

(1) hermes chat

BASH
# Basic conversation
hermes chat

# Specify model
hermes chat --model gpt-4o

# Specify user
hermes chat --user alice

# Specify skill
hermes chat --skill code-review

# Non-interactive mode (single input)
hermes chat --message "Review src/main.py" --no-interactive

# Pipe input
cat error.log | hermes chat --message "Analyze this error log"

# Specify toolset
hermes chat --toolset frontend-dev

# Output to file
hermes chat --output report.md

(2) hermes run

BASH
# Single task execution
hermes run "Search React 19 new features and generate summary"

# Specify model and skill
hermes run --model gpt-4o --skill research "Research Vue 4 changes"

# Delegation mode
hermes run --delegate --max-sub-agents 3 "Review code quality of entire project"

# Output format
hermes run --format json "Analyze this API's response format"

(3) hermes serve

BASH
# Start API server
hermes serve --host 0.0.0.0 --port 8080

# Run as daemon
hermes serve --daemon

# Specify configuration
hermes serve --config /path/to/config.yaml

# Enable all platforms
hermes serve --platforms telegram,discord,slack

5. Conversation and Interaction Commands

(1) In-Conversation Commands

In hermes chat interactive mode, commands starting with /:

Command Function
/learn <content> Teach Agent a new skill
/remember <content> Save memory
/forget <id> Delete memory
/skill <name> Invoke skill
/model <name> Switch model
/toolset <name> Switch toolset
/profile <name> Switch user
/checkpoint save <name> Save checkpoint
/checkpoint restore <name> Restore checkpoint
/delegate status View delegation status
/honcho profile View user model
/cost View current session cost
/help Help
/exit Exit

(2) Conversation Keyboard Shortcuts

Shortcut Function
↑/↓ Browse input history
Tab Auto-complete command/skill/tool names
Ctrl+C Interrupt current operation
Ctrl+D Exit conversation
Ctrl+L Clear screen

6. Management and Operations Commands

(1) Configuration Management

BASH
# View configuration
hermes config show
hermes config get model.default
hermes config get memory.working_memory_limit

# Set configuration
hermes config set model.default gpt-4o
hermes config set personality.tone professional

# Validate configuration
hermes config validate

# Export/Import
hermes config export > backup.yaml
hermes config import backup.yaml

# Reset
hermes config reset

(2) Model Management

BASH
# List available models
hermes model list

# Test model connection
hermes model test gpt-4o

# Add custom model
hermes model add --name my-model --provider ollama

# View model details
hermes model info gpt-4o

(3) Health Check

BASH
# Full health check
hermes doctor

# Quick check
hermes health

# View version
hermes --version

# View system info
hermes info

7. Script Integration and Automation

(1) Shell Script Integration

BASH
#!/bin/bash
# CI/CD integration example

# 1. Code review
hermes run --skill code-review --output review.md "Review PR #$PR_NUMBER"

# 2. Check review results
if grep -q "🔴 Critical" review.md; then
  echo "Critical issues found, blocking merge"
  exit 1
fi

# 3. Run tests
hermes run --skill test-runner "Run full test suite"

# 4. Generate release notes
hermes run --model gpt-4o --output CHANGELOG.md "Generate release notes from git log"

(2) Python Integration

PYTHON
from hermes import HermesClient

client = HermesClient(base_url="http://localhost:8080")

# Send message
response = client.chat(
    message="Review the code quality of this file",
    model="gpt-4o",
    files=["src/main.py"]
)

print(response.text)

# Batch execution
results = client.batch_run([
    {"message": "Search React 19", "model": "gpt-4o-mini"},
    {"message": "Search Vue 4", "model": "gpt-4o-mini"},
    {"message": "Search Svelte 5", "model": "gpt-4o-mini"},
])

for r in results:
    print(f"Task: {r.task}, Cost: ${r.cost:.4f}")

(3) Makefile Integration

MAKEFILE
.PHONY: review test deploy

review:
	hermes run --skill code-review "Review all modified files"

test:
	hermes run --skill test-runner "Run test suite"

deploy: review test
	hermes run "Deploy to staging environment"
	@echo "Deployment complete"

❓ FAQ

Q Does CLI support Windows?
A Yes. Both PowerShell and CMD work. Some pipe features work better in WSL2.
Q How to view command help?
A hermes --help for global help, hermes chat --help for subcommand help.
Q What is non-interactive mode suitable for?
A Script integration, CI/CD, scheduled tasks, batch processing — any automation scenario without human interaction.
Q How to run multiple tasks in parallel?
A Shell background hermes run ... & or Python multithreading. CLI itself supports --delegate for parallelism.
Q Where are CLI logs?
A Default ~/.hermes/logs/. hermes chat --verbose shows detailed real-time logs.
Q How to debug CLI issues?
A hermes chat --debug enables debug mode with full tool calls and model requests output.

📖 Summary


📝 Exercises

  1. Basic (⭐): Use CLI for a complete workflow: initialize → chat → save checkpoint → view cost.
  2. Intermediate (⭐⭐): Write a Shell script using hermes run to automate code review + testing + report generation.
  3. Advanced (⭐⭐⭐): Develop an automation workflow with Python HermesClient: daily scheduled Git log fetch → generate daily report → send notification, integrated with cron.
Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏