honcho/honcho-cli
ajspig 3dbf0e66fc
feat: adding honcho-cli package (#424)
* feat: adding honcho-cli package

* feat: adding more support for command-level flags, also including workarounds for getting raw SDK info

* feat: adding peer config

* feat: adding setup commands

* chore: setting up package dependencies for cli

* feat: promote init/doctor to top-level + polish wizard

* feat: make init --yes fall back to existing config

* chore: updating documentation

* chore: updating tagline

* feat: structurally updating recomended settings for CLI

* fix: style

* fix: removing redundant describe method

* fix: delete key generation commands and fixing session ID

* fix: removing defaults and changing config write path.

* chore: pagnating conclusions

* chore: require workspace

* fix: polish command surfaces — scoping, validation, perf, consistency

* chore: removing session message

* fix: CLI output shape, destructive-confirm previews, skip needless round-trips

* chore: CLI polish — peer inspect config, drop dead helper, doc/help consistency

* chore: update readme

* chore: updating tests

* chore: doc updates

* fix: config command

* chore: unused code

* fix: doctor command

* fix: removing quiet tag and fixing session key ordering

* fix: config commands and session id command

* fix: removing message_count

* fix: branding circular dependency

* fix: refactor lazy imports to use common.py correctly.

* fix: removing all lazy imports

* chore: cr fixes

* fix: config, env, flag setup

* chore: updating skill

* feat: adding workspace, session, and message create

* fix: init now supports local honcho

* chore: cr

* feat(cli): CLI surface polish — reasoning flag, peer-scoped messages, help sync

Add --reasoning/-r to peer chat (minimal..max), -p peer filter to
message list with newest-first ordering, and a curated welcome panel
with getting-started/memory/commands sections.

Sync the welcome panel and group help strings with the actual
registered commands — drop phantom 'session clone', add the 4 missing
peer commands and 7 missing session commands, fix conclusion/message/
workspace group docstrings that claimed commands that don't exist.

* feat(cli): themed, unified help system with pattern/example

Replace the hand-rolled welcome with a layered system:

- Theme typer.rich_utils (dim borders, brand color) so every --help
  inherits the voice.
- HonchoTyperGroup subclass renders a curated 3-panel welcome
  (getting started / memory / commands) with recipes Typer can't
  auto-generate.
- Unify the front door: bare 'honcho', 'honcho --help', and
  'honcho help' all render the same welcome via one code path;
  sub-groups and leaf commands still get Typer's themed renderer.
- Replace Click's 'Usage: …' line with pattern/example rows at every
  sub-group and leaf command, so the help voice stays consistent from
  top to leaves.

* refactor(cli): address review — typed exceptions, chmod 600, tighter redaction, class-based help, tests

- Replace module-level monkey-patch of TyperGroup/TyperCommand.get_usage
  with HonchoTyperGroup applied via cls= on every sub-Typer. Lives in
  a new _help.py module to avoid circular imports. No longer leaks
  behavior changes into other Typer users in the same process.
- _test_connection dispatches on the SDK's typed exceptions
  (AuthenticationError, ConnectionError, TimeoutError, APIError)
  instead of substring-matching error messages.
- Config.save() now chmods ~/.honcho/config.json to 0o600 after write
  so the plaintext API key isn't world-readable on multi-user hosts.
- Tighten api_key redaction to '***<last4>' (was 'header...last4'),
  matching setup._redact for consistency. Short keys fully masked.
- Add test_validation.py covering safe IDs, unsafe chars, path
  traversal, and empty input. Update test_config.py redaction cases
  and add 0o600 permission assertion. Fix stale patch paths in
  test_commands.py that pointed at honcho_cli.main instead of the
  command modules where get_client is actually imported.

* feat(cli): add options panel to welcome menu

Append a fourth panel listing the global flags (-w/-p/-s, --json,
--version, --help) with their env-var counterparts. Discoverable
from bare 'honcho' without needing to hunt for --help.

* chore(cli): drop --version from welcome options panel

* feat(cli): add pixel-honcho icon to banner

Prepend a 13-char ASCII rendering of honcho-pixel.svg to the HONCHO
wordmark. Uses Unicode half-blocks to pack 12 pixel rows into 6 text
rows, faithfully preserving the SVG outline (two eye dots, mouth slit,
tapering foot). Appears in bare 'honcho', 'honcho --help', 'honcho
--version', and 'honcho init'.

* fix: polish Honcho CLI wolcome panel and error messages

* fix: honcho workspace inspect speed

* chore: minor fix to session pagination

* fix: removing NDJSON output

* chore: consolidating honcho CLI's dula argv grammar onto Pattern A (command-first)

* chore: clean up imports

* fix: four `-s` consistency fixes applied

* chore: minor changes to memory rows

* fix: changing package name to honcho-cli

* fix: removing pixel face

---------

Co-authored-by: Erosika <eri@plasticlabs.ai>
2026-04-20 13:27:35 -04:00
..
src/honcho_cli feat: adding honcho-cli package (#424) 2026-04-20 13:27:35 -04:00
tests feat: adding honcho-cli package (#424) 2026-04-20 13:27:35 -04:00
README.md feat: adding honcho-cli package (#424) 2026-04-20 13:27:35 -04:00
pyproject.toml feat: adding honcho-cli package (#424) 2026-04-20 13:27:35 -04:00
uv.lock feat: adding honcho-cli package (#424) 2026-04-20 13:27:35 -04:00

README.md

██╗  ██╗ ██████╗ ███╗   ██╗ ██████╗██╗  ██╗ ██████╗
██║  ██║██╔═══██╗████╗  ██║██╔════╝██║  ██║██╔═══██╗
███████║██║   ██║██╔██╗ ██║██║     ███████║██║   ██║
██╔══██║██║   ██║██║╚██╗██║██║     ██╔══██║██║   ██║
██║  ██║╚██████╔╝██║ ╚████║╚██████╗██║  ██║╚██████╔╝
╚═╝  ╚═╝ ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝╚═╝  ╚═╝ ╚═════╝

honcho-cli

A terminal for Honcho — memory that reasons.

Install

As a standalone tool (recommended):

uv tool install honcho-cli

As an extra on the Honcho SDK (if you want both the SDK and the CLI in one project):

uv add honcho-ai[cli]
# or
pip install honcho-ai[cli]

Either way, you'll get the honcho command on your PATH.

Quick Start

honcho init        # confirm/set apiKey + Honcho URL in ~/.honcho/config.json
honcho doctor      # verify your config + connectivity
honcho             # show banner + command list

honcho init reads apiKey and environmentUrl from the top-level of ~/.honcho/config.json (the same file other Honcho tools — plugins, host integrations — share). If both are present, it confirms them with you; if either is missing (or you decline), it prompts for the missing value(s) and writes them back. Host-specific entries under hosts are left untouched.

Per-command scoping (workspace / peer / session) is handled via -w / -p / -s flags or HONCHO_* env vars — not persisted as CLI defaults.

Commands

Onboarding

Command Description
honcho init Confirm/set apiKey + environmentUrl in ~/.honcho/config.json
honcho doctor Health check: config, connectivity, workspace, peer, queue

Workspaces

Command Description
honcho workspace list List accessible workspaces
honcho workspace create <id> Create or get a workspace
honcho workspace inspect Peers, sessions, config for a workspace
honcho workspace search <query> Search messages across workspace
honcho workspace queue-status Deriver queue status (filter with --observer / --sender)
honcho workspace delete <id> Delete a workspace. Use --dry-run to preview, --cascade to also delete sessions, --yes to skip the confirm prompt

Peers

Command Description
honcho peer list List peers in the workspace
honcho peer create <id> Create or get a peer
honcho peer inspect <id> Card, session count, recent conclusions
honcho peer card <id> Raw peer card content
honcho peer chat <query> Query the dialectic about a peer (peer via -p / HONCHO_PEER_ID)
honcho peer representation <id> Formatted representation
honcho peer search <query> Search a peer's messages (peer via -p / HONCHO_PEER_ID)
honcho peer get-metadata <id> / set-metadata Metadata operations

Sessions

Command Description
honcho session list List sessions in the workspace (filter with --peer/-p)
honcho session create <id> Create or get a session (optionally --peers to add peers, --metadata)
honcho session inspect <id> Peers, message count, summaries, config
honcho session context <id> What an agent would see
honcho session summaries <id> Short + long summaries
honcho session peers <id> / add-peers / remove-peers Peer management
honcho session search <id> <query> Search messages in a session
honcho session representation <id> Peer representation in a session
honcho session get-metadata <id> / set-metadata Metadata operations
honcho session delete <id> Destructive; requires --yes

Messages

Command Description
honcho message list List messages in a session (session via -s / HONCHO_SESSION_ID)
honcho message create <content> Create a message (requires --peer/-p, session via -s)
honcho message get <id> Get a single message (session via -s / HONCHO_SESSION_ID)

Conclusions (observations)

Command Description
honcho conclusion list List conclusions (filter with --observer / --observed)
honcho conclusion search <query> Semantic search (filter with --observer / --observed)
honcho conclusion create Create a conclusion
honcho conclusion delete <id> Delete a conclusion

Config

Command Description
honcho config Show current config (API key redacted)

Agent Usage

All commands output JSON when stdout isn't a TTY, or when --json is forced. Collection commands emit JSON arrays, and single-resource commands emit JSON objects:

honcho peer list --json
honcho workspace inspect --json | jq '.peers'
honcho doctor --json              # machine-parseable health checklist

Errors are structured:

{
  "error": {
    "code": "PEER_NOT_FOUND",
    "message": "Peer 'abc' not found in workspace 'my-ws'",
    "details": {"workspace_id": "my-ws", "peer_id": "abc"}
  }
}

Non-interactive onboarding:

# Pre-seed via flags / env vars; init still prompts for anything missing
HONCHO_API_KEY=hch-v3-xxx honcho init --base-url https://api.honcho.dev

Environment Variables

All HONCHO_* env vars work at runtime — no config file required.

Precedence (highest first): flag → env var → config file → default.

Variable Flag Description
HONCHO_API_KEY --api-key (init) Admin JWT
HONCHO_BASE_URL --base-url (init) API URL
HONCHO_WORKSPACE_ID -w / --workspace Workspace scope
HONCHO_PEER_ID -p / --peer Peer scope
HONCHO_SESSION_ID -s / --session Session scope
HONCHO_JSON --json Force JSON output (1 / true)
# Per-command flags
honcho peer card -w prod -p user

# Or export once per shell
export HONCHO_WORKSPACE_ID=prod
export HONCHO_PEER_ID=user
honcho peer card

# One-off against a different server
HONCHO_BASE_URL=http://localhost:8000 honcho workspace list

# CI/CD — env vars only, no config file needed
export HONCHO_API_KEY=hch-v3-xxx
export HONCHO_BASE_URL=https://api.honcho.dev
honcho workspace list

Configuration

The CLI shares ~/.honcho/config.json with sibling Honcho tools. It owns two top-level keys: apiKey and environmentUrl (the full Honcho API URL, e.g. https://api.honcho.dev or http://localhost:8000). Everything else at the top level — hosts, sessions, saveMessages, sessionStrategy, etc. — is left untouched.

{
  "apiKey": "hch-v3-...",
  "environmentUrl": "https://api.honcho.dev",
  "hosts": { "claude_code": { "...": "..." } }
}

workspace_id / peer_id / session_id are per-command only — never persisted to the config file.

Development

Install from source in editable mode so changes are picked up live:

git clone https://github.com/plastic-labs/honcho
cd honcho
uv tool install --force --editable --from ./honcho-cli honcho-cli

Re-run any time — changes to honcho-cli/src/ are reflected immediately without reinstalling.

License

MIT