honcho-cli 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- honcho_cli/__init__.py +3 -0
- honcho_cli/_help.py +130 -0
- honcho_cli/branding.py +17 -0
- honcho_cli/commands/__init__.py +0 -0
- honcho_cli/commands/conclusion.py +219 -0
- honcho_cli/commands/config_cmd.py +31 -0
- honcho_cli/commands/message.py +161 -0
- honcho_cli/commands/peer.py +308 -0
- honcho_cli/commands/session.py +404 -0
- honcho_cli/commands/setup.py +287 -0
- honcho_cli/commands/workspace.py +322 -0
- honcho_cli/common.py +112 -0
- honcho_cli/config.py +150 -0
- honcho_cli/main.py +96 -0
- honcho_cli/output.py +104 -0
- honcho_cli/skills/CONTEXT.md +50 -0
- honcho_cli/skills/honcho-debug.md +54 -0
- honcho_cli/skills/honcho-inspect.md +53 -0
- honcho_cli/validation.py +44 -0
- honcho_cli-0.1.0.dist-info/METADATA +235 -0
- honcho_cli-0.1.0.dist-info/RECORD +23 -0
- honcho_cli-0.1.0.dist-info/WHEEL +4 -0
- honcho_cli-0.1.0.dist-info/entry_points.txt +2 -0
honcho_cli/output.py
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"""Output formatting: JSON, tables, and structured errors.
|
|
2
|
+
|
|
3
|
+
Detects TTY to auto-switch between human-readable and machine-parseable output.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import json
|
|
9
|
+
import os
|
|
10
|
+
import sys
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
from rich.console import Console
|
|
14
|
+
from rich.table import Table
|
|
15
|
+
|
|
16
|
+
console = Console(stderr=True)
|
|
17
|
+
stdout_console = Console()
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def is_tty() -> bool:
|
|
21
|
+
"""Check if stdout is a TTY."""
|
|
22
|
+
return sys.stdout.isatty()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# Global state for --json flag
|
|
26
|
+
_force_json = False
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def set_json_mode(enabled: bool) -> None:
|
|
30
|
+
global _force_json
|
|
31
|
+
_force_json = enabled
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def use_json() -> bool:
|
|
36
|
+
"""Should we output JSON?"""
|
|
37
|
+
return _force_json or os.environ.get("HONCHO_JSON", "").lower() in ("1", "true") or not is_tty()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def print_json(data: Any) -> None:
|
|
41
|
+
"""Print a single JSON value to stdout."""
|
|
42
|
+
print(json.dumps(data, indent=2, default=str))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def print_table(columns: list[str], rows: list[list[str]], title: str | None = None) -> None:
|
|
46
|
+
"""Print a rich table to stdout."""
|
|
47
|
+
table = Table(title=title, show_header=True, header_style="bold")
|
|
48
|
+
for col in columns:
|
|
49
|
+
table.add_column(col)
|
|
50
|
+
for row in rows:
|
|
51
|
+
table.add_row(*row)
|
|
52
|
+
stdout_console.print(table)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def print_result(data: Any, columns: list[str] | None = None, title: str | None = None) -> None:
|
|
56
|
+
"""Print data as JSON or table depending on mode.
|
|
57
|
+
|
|
58
|
+
For lists, uses JSON arrays in JSON mode or tables in TTY mode.
|
|
59
|
+
For dicts, uses JSON or key-value display.
|
|
60
|
+
"""
|
|
61
|
+
if use_json():
|
|
62
|
+
print_json(data)
|
|
63
|
+
else:
|
|
64
|
+
if isinstance(data, list) and columns:
|
|
65
|
+
rows = []
|
|
66
|
+
for item in data:
|
|
67
|
+
row = [str(item.get(col, "")) if isinstance(item, dict) else str(item) for col in columns]
|
|
68
|
+
rows.append(row)
|
|
69
|
+
print_table(columns, rows, title=title)
|
|
70
|
+
elif isinstance(data, dict):
|
|
71
|
+
table = Table(show_header=False)
|
|
72
|
+
table.add_column("Field", style="bold")
|
|
73
|
+
table.add_column("Value")
|
|
74
|
+
for k, v in data.items():
|
|
75
|
+
val = json.dumps(v, default=str) if isinstance(v, (dict, list)) else str(v)
|
|
76
|
+
table.add_row(k, val)
|
|
77
|
+
stdout_console.print(table)
|
|
78
|
+
else:
|
|
79
|
+
stdout_console.print(data)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def print_error(code: str, message: str, details: dict | None = None) -> None:
|
|
83
|
+
"""Print structured error."""
|
|
84
|
+
err = {
|
|
85
|
+
"error": {
|
|
86
|
+
"code": code,
|
|
87
|
+
"message": message,
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if details:
|
|
91
|
+
err["error"]["details"] = details
|
|
92
|
+
|
|
93
|
+
if use_json():
|
|
94
|
+
print(json.dumps(err, default=str), file=sys.stderr)
|
|
95
|
+
else:
|
|
96
|
+
console.print(f"[red]Error[/red] ({code}): {message}")
|
|
97
|
+
if details:
|
|
98
|
+
for k, v in details.items():
|
|
99
|
+
console.print(f" {k}: {v}")
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def status(msg: str) -> None:
|
|
103
|
+
"""Print a status message to stderr."""
|
|
104
|
+
console.print(f"[dim]{msg}[/dim]")
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: honcho-cli
|
|
3
|
+
version: 0.1.0
|
|
4
|
+
description: A terminal for Honcho — memory that reasons.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Honcho CLI — Agent Interface
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
`honcho` is a CLI for administering and debugging Honcho workspaces. It wraps the Honcho Python SDK with agent-friendly defaults: JSON output, structured errors, input validation.
|
|
12
|
+
|
|
13
|
+
## Output Modes
|
|
14
|
+
|
|
15
|
+
- **TTY**: Human-readable tables (default when interactive)
|
|
16
|
+
- **Piped/scripted**: JSON automatically
|
|
17
|
+
- `--json`: Force JSON output
|
|
18
|
+
|
|
19
|
+
## Exit Codes
|
|
20
|
+
|
|
21
|
+
- 0: Success
|
|
22
|
+
- 1: Client error (bad input, not found)
|
|
23
|
+
- 2: Server error
|
|
24
|
+
- 3: Auth error
|
|
25
|
+
|
|
26
|
+
## Config
|
|
27
|
+
|
|
28
|
+
Shared with other Honcho tools at `~/.honcho/config.json`. The CLI owns only
|
|
29
|
+
`apiKey` and `environmentUrl` at the top level. Host-specific
|
|
30
|
+
entries under `hosts` are untouched.
|
|
31
|
+
|
|
32
|
+
Run `honcho init` to confirm or set those two values. Workspace / peer /
|
|
33
|
+
session are per-command — pass them via flags or env vars:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
honcho peer card -w my-workspace -p my-peer
|
|
37
|
+
# or
|
|
38
|
+
export HONCHO_WORKSPACE_ID=my-workspace
|
|
39
|
+
export HONCHO_PEER_ID=my-peer
|
|
40
|
+
honcho peer card
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Command Groups
|
|
44
|
+
|
|
45
|
+
- `honcho config` — Manage CLI configuration
|
|
46
|
+
- `honcho workspace` — Inspect, delete, search workspaces
|
|
47
|
+
- `honcho peer` — Inspect, card, chat, search peers
|
|
48
|
+
- `honcho session` — Inspect, messages, context, summaries
|
|
49
|
+
- `honcho message` — List and get messages
|
|
50
|
+
- `honcho conclusion` — List, search, create, delete conclusions
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: honcho-cli-debug
|
|
3
|
+
version: 0.1.0
|
|
4
|
+
description: Debug Honcho peer representations and memory
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Honcho CLI — Debug Skills
|
|
8
|
+
|
|
9
|
+
## Rules
|
|
10
|
+
|
|
11
|
+
- Check queue status when derivation seems stalled
|
|
12
|
+
- Compare peer card with conclusions to understand memory state
|
|
13
|
+
|
|
14
|
+
## Debugging Memory Issues
|
|
15
|
+
|
|
16
|
+
### Peer not learning?
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Check if observation is enabled
|
|
20
|
+
honcho peer inspect <peer_id> --json | jq '.configuration'
|
|
21
|
+
|
|
22
|
+
# Check queue — are messages being processed?
|
|
23
|
+
honcho workspace queue-status --json
|
|
24
|
+
|
|
25
|
+
# Check what conclusions exist
|
|
26
|
+
honcho conclusion list --observer <peer_id> --json
|
|
27
|
+
honcho conclusion search "expected topic" --observer <peer_id> --json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Session context looks wrong?
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# See raw context
|
|
34
|
+
honcho session context <session_id> --json
|
|
35
|
+
|
|
36
|
+
# Check summaries
|
|
37
|
+
honcho session summaries <session_id> --json
|
|
38
|
+
|
|
39
|
+
# Check message history
|
|
40
|
+
honcho message list <session_id> --last 50 --json
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Dialectic giving bad answers?
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Check what the peer card says
|
|
47
|
+
honcho peer card <peer_id> --json
|
|
48
|
+
|
|
49
|
+
# Check conclusions for the specific topic
|
|
50
|
+
honcho conclusion search "topic" --observer <peer_id> --json
|
|
51
|
+
|
|
52
|
+
# Try the dialectic directly
|
|
53
|
+
honcho peer chat <peer_id> "what do you know about X?" --json
|
|
54
|
+
```
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: honcho-cli-inspect
|
|
3
|
+
version: 0.1.0
|
|
4
|
+
description: Inspect Honcho workspace state for debugging
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Honcho CLI — Inspection Skills
|
|
8
|
+
|
|
9
|
+
## Rules
|
|
10
|
+
|
|
11
|
+
- Always use `--json` when processing output programmatically
|
|
12
|
+
- Run `honcho peer inspect` before `honcho peer chat` to understand context
|
|
13
|
+
- Use `honcho session context` to see exactly what an agent receives
|
|
14
|
+
- Never run `honcho workspace delete` without `honcho workspace inspect` first
|
|
15
|
+
|
|
16
|
+
## Inspection Workflow
|
|
17
|
+
|
|
18
|
+
### 1. Understand the workspace
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
honcho workspace inspect --json
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### 2. Find the peer
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
honcho peer list --json
|
|
28
|
+
honcho peer inspect <peer_id> --json
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 3. Check peer's memory
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
honcho peer card <peer_id> --json
|
|
35
|
+
honcho conclusion list --observer <peer_id> --json
|
|
36
|
+
honcho conclusion search "topic" --observer <peer_id> --json
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 4. Debug a session
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
honcho session inspect <session_id> --json
|
|
43
|
+
honcho message list <session_id> --last 20 --json
|
|
44
|
+
honcho session context <session_id> --json
|
|
45
|
+
honcho session summaries <session_id> --json
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 5. Search across workspace
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
honcho workspace search "query" --json
|
|
52
|
+
honcho peer search <peer_id> "query" --json
|
|
53
|
+
```
|
honcho_cli/validation.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""Input hardening: validate resource IDs and workspace names.
|
|
2
|
+
|
|
3
|
+
Agents hallucinate bad IDs. Catch them early with clear errors.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import re
|
|
9
|
+
|
|
10
|
+
from honcho_cli.output import print_error
|
|
11
|
+
|
|
12
|
+
UNSAFE_CHARS = re.compile(r'[?#%\x00-\x1f\x7f/\\]')
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def validate_resource_id(value: str, resource_type: str = "resource") -> str:
|
|
16
|
+
"""Validate a resource ID. Returns the value if valid, raises SystemExit on invalid."""
|
|
17
|
+
if not value:
|
|
18
|
+
_fail(
|
|
19
|
+
"EMPTY_ID",
|
|
20
|
+
f"Empty {resource_type} ID provided",
|
|
21
|
+
{resource_type: ""},
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
if UNSAFE_CHARS.search(value):
|
|
25
|
+
_fail(
|
|
26
|
+
"INVALID_ID",
|
|
27
|
+
f"Invalid {resource_type} ID: contains unsafe characters (?, #, %, control chars, path separators)",
|
|
28
|
+
{resource_type: value},
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
if ".." in value:
|
|
32
|
+
_fail(
|
|
33
|
+
"INVALID_ID",
|
|
34
|
+
f"Invalid {resource_type} ID: contains path traversal",
|
|
35
|
+
{resource_type: value},
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
return value
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _fail(code: str, message: str, details: dict) -> None:
|
|
42
|
+
"""Print structured error and exit."""
|
|
43
|
+
print_error(code, message, details)
|
|
44
|
+
raise SystemExit(1)
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: honcho-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A terminal for Honcho — memory that reasons.
|
|
5
|
+
Project-URL: Homepage, https://github.com/plastic-labs/honcho
|
|
6
|
+
Project-URL: Repository, https://github.com/plastic-labs/honcho
|
|
7
|
+
Author-email: Plastic Labs <hello@plasticlabs.ai>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Requires-Dist: honcho-ai>=2.0.0
|
|
17
|
+
Requires-Dist: httpx>=0.27.0
|
|
18
|
+
Requires-Dist: rich>=13.0.0
|
|
19
|
+
Requires-Dist: typer>=0.15.0
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: pytest-mock>=3.14.0; extra == 'dev'
|
|
22
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
██╗ ██╗ ██████╗ ███╗ ██╗ ██████╗██╗ ██╗ ██████╗
|
|
27
|
+
██║ ██║██╔═══██╗████╗ ██║██╔════╝██║ ██║██╔═══██╗
|
|
28
|
+
███████║██║ ██║██╔██╗ ██║██║ ███████║██║ ██║
|
|
29
|
+
██╔══██║██║ ██║██║╚██╗██║██║ ██╔══██║██║ ██║
|
|
30
|
+
██║ ██║╚██████╔╝██║ ╚████║╚██████╗██║ ██║╚██████╔╝
|
|
31
|
+
╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
# honcho-cli
|
|
35
|
+
|
|
36
|
+
A terminal for [Honcho](https://honcho.dev) — memory that reasons.
|
|
37
|
+
|
|
38
|
+
## Install
|
|
39
|
+
|
|
40
|
+
As a standalone tool (recommended):
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
uv tool install honcho-cli
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
As an extra on the Honcho SDK (if you want both the SDK and the CLI in one project):
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
uv add honcho-ai[cli]
|
|
50
|
+
# or
|
|
51
|
+
pip install honcho-ai[cli]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Either way, you'll get the `honcho` command on your PATH.
|
|
55
|
+
|
|
56
|
+
## Quick Start
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
honcho init # confirm/set apiKey + Honcho URL in ~/.honcho/config.json
|
|
60
|
+
honcho doctor # verify your config + connectivity
|
|
61
|
+
honcho # show banner + command list
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`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.
|
|
65
|
+
|
|
66
|
+
Per-command scoping (workspace / peer / session) is handled via `-w` / `-p` / `-s` flags or `HONCHO_*` env vars — not persisted as CLI defaults.
|
|
67
|
+
|
|
68
|
+
## Commands
|
|
69
|
+
|
|
70
|
+
### Onboarding
|
|
71
|
+
|
|
72
|
+
| Command | Description |
|
|
73
|
+
|---------|-------------|
|
|
74
|
+
| `honcho init` | Confirm/set `apiKey` + `environmentUrl` in `~/.honcho/config.json` |
|
|
75
|
+
| `honcho doctor` | Health check: config, connectivity, workspace, peer, queue |
|
|
76
|
+
|
|
77
|
+
### Workspaces
|
|
78
|
+
|
|
79
|
+
| Command | Description |
|
|
80
|
+
|---------|-------------|
|
|
81
|
+
| `honcho workspace list` | List accessible workspaces |
|
|
82
|
+
| `honcho workspace create <id>` | Create or get a workspace |
|
|
83
|
+
| `honcho workspace inspect` | Peers, sessions, config for a workspace |
|
|
84
|
+
| `honcho workspace search <query>` | Search messages across workspace |
|
|
85
|
+
| `honcho workspace queue-status` | Deriver queue status (filter with `--observer` / `--sender`) |
|
|
86
|
+
| `honcho workspace delete <id>` | Delete a workspace. Use `--dry-run` to preview, `--cascade` to also delete sessions, `--yes` to skip the confirm prompt |
|
|
87
|
+
|
|
88
|
+
### Peers
|
|
89
|
+
|
|
90
|
+
| Command | Description |
|
|
91
|
+
|---------|-------------|
|
|
92
|
+
| `honcho peer list` | List peers in the workspace |
|
|
93
|
+
| `honcho peer create <id>` | Create or get a peer |
|
|
94
|
+
| `honcho peer inspect <id>` | Card, session count, recent conclusions |
|
|
95
|
+
| `honcho peer card <id>` | Raw peer card content |
|
|
96
|
+
| `honcho peer chat <query>` | Query the dialectic about a peer (peer via `-p` / `HONCHO_PEER_ID`) |
|
|
97
|
+
| `honcho peer representation <id>` | Formatted representation |
|
|
98
|
+
| `honcho peer search <query>` | Search a peer's messages (peer via `-p` / `HONCHO_PEER_ID`) |
|
|
99
|
+
| `honcho peer get-metadata <id>` / `set-metadata` | Metadata operations |
|
|
100
|
+
|
|
101
|
+
### Sessions
|
|
102
|
+
|
|
103
|
+
| Command | Description |
|
|
104
|
+
|---------|-------------|
|
|
105
|
+
| `honcho session list` | List sessions in the workspace (filter with `--peer/-p`) |
|
|
106
|
+
| `honcho session create <id>` | Create or get a session (optionally `--peers` to add peers, `--metadata`) |
|
|
107
|
+
| `honcho session inspect <id>` | Peers, message count, summaries, config |
|
|
108
|
+
| `honcho session context <id>` | What an agent would see |
|
|
109
|
+
| `honcho session summaries <id>` | Short + long summaries |
|
|
110
|
+
| `honcho session peers <id>` / `add-peers` / `remove-peers` | Peer management |
|
|
111
|
+
| `honcho session search <id> <query>` | Search messages in a session |
|
|
112
|
+
| `honcho session representation <id>` | Peer representation in a session |
|
|
113
|
+
| `honcho session get-metadata <id>` / `set-metadata` | Metadata operations |
|
|
114
|
+
| `honcho session delete <id>` | Destructive; requires `--yes` |
|
|
115
|
+
|
|
116
|
+
### Messages
|
|
117
|
+
|
|
118
|
+
| Command | Description |
|
|
119
|
+
|---------|-------------|
|
|
120
|
+
| `honcho message list` | List messages in a session (session via `-s` / `HONCHO_SESSION_ID`) |
|
|
121
|
+
| `honcho message create <content>` | Create a message (requires `--peer/-p`, session via `-s`) |
|
|
122
|
+
| `honcho message get <id>` | Get a single message (session via `-s` / `HONCHO_SESSION_ID`) |
|
|
123
|
+
|
|
124
|
+
### Conclusions (observations)
|
|
125
|
+
|
|
126
|
+
| Command | Description |
|
|
127
|
+
|---------|-------------|
|
|
128
|
+
| `honcho conclusion list` | List conclusions (filter with `--observer` / `--observed`) |
|
|
129
|
+
| `honcho conclusion search <query>` | Semantic search (filter with `--observer` / `--observed`) |
|
|
130
|
+
| `honcho conclusion create` | Create a conclusion |
|
|
131
|
+
| `honcho conclusion delete <id>` | Delete a conclusion |
|
|
132
|
+
|
|
133
|
+
### Config
|
|
134
|
+
|
|
135
|
+
| Command | Description |
|
|
136
|
+
|---------|-------------|
|
|
137
|
+
| `honcho config` | Show current config (API key redacted) |
|
|
138
|
+
|
|
139
|
+
## Agent Usage
|
|
140
|
+
|
|
141
|
+
All commands output JSON when stdout isn't a TTY, or when `--json` is forced.
|
|
142
|
+
Collection commands emit JSON arrays, and single-resource commands emit JSON objects:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
honcho peer list --json
|
|
146
|
+
honcho workspace inspect --json | jq '.peers'
|
|
147
|
+
honcho doctor --json # machine-parseable health checklist
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Errors are structured:
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"error": {
|
|
155
|
+
"code": "PEER_NOT_FOUND",
|
|
156
|
+
"message": "Peer 'abc' not found in workspace 'my-ws'",
|
|
157
|
+
"details": {"workspace_id": "my-ws", "peer_id": "abc"}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Non-interactive onboarding:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Pre-seed via flags / env vars; init still prompts for anything missing
|
|
166
|
+
HONCHO_API_KEY=hch-v3-xxx honcho init --base-url https://api.honcho.dev
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Environment Variables
|
|
170
|
+
|
|
171
|
+
All `HONCHO_*` env vars work at runtime — no config file required.
|
|
172
|
+
|
|
173
|
+
Precedence (highest first): **flag → env var → config file → default**.
|
|
174
|
+
|
|
175
|
+
| Variable | Flag | Description |
|
|
176
|
+
|----------|------|-------------|
|
|
177
|
+
| `HONCHO_API_KEY` | `--api-key` (init) | Admin JWT |
|
|
178
|
+
| `HONCHO_BASE_URL` | `--base-url` (init) | API URL |
|
|
179
|
+
| `HONCHO_WORKSPACE_ID` | `-w` / `--workspace` | Workspace scope |
|
|
180
|
+
| `HONCHO_PEER_ID` | `-p` / `--peer` | Peer scope |
|
|
181
|
+
| `HONCHO_SESSION_ID` | `-s` / `--session` | Session scope |
|
|
182
|
+
| `HONCHO_JSON` | `--json` | Force JSON output (`1` / `true`) |
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Per-command flags
|
|
186
|
+
honcho peer card -w prod -p user
|
|
187
|
+
|
|
188
|
+
# Or export once per shell
|
|
189
|
+
export HONCHO_WORKSPACE_ID=prod
|
|
190
|
+
export HONCHO_PEER_ID=user
|
|
191
|
+
honcho peer card
|
|
192
|
+
|
|
193
|
+
# One-off against a different server
|
|
194
|
+
HONCHO_BASE_URL=http://localhost:8000 honcho workspace list
|
|
195
|
+
|
|
196
|
+
# CI/CD — env vars only, no config file needed
|
|
197
|
+
export HONCHO_API_KEY=hch-v3-xxx
|
|
198
|
+
export HONCHO_BASE_URL=https://api.honcho.dev
|
|
199
|
+
honcho workspace list
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Configuration
|
|
203
|
+
|
|
204
|
+
The CLI shares `~/.honcho/config.json` with sibling Honcho tools. It owns two
|
|
205
|
+
top-level keys: `apiKey` and `environmentUrl` (the full Honcho API URL, e.g.
|
|
206
|
+
`https://api.honcho.dev` or `http://localhost:8000`). Everything else at the
|
|
207
|
+
top level — `hosts`, `sessions`, `saveMessages`, `sessionStrategy`, etc. —
|
|
208
|
+
is left untouched.
|
|
209
|
+
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"apiKey": "hch-v3-...",
|
|
213
|
+
"environmentUrl": "https://api.honcho.dev",
|
|
214
|
+
"hosts": { "claude_code": { "...": "..." } }
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
`workspace_id` / `peer_id` / `session_id` are per-command only — never
|
|
219
|
+
persisted to the config file.
|
|
220
|
+
|
|
221
|
+
## Development
|
|
222
|
+
|
|
223
|
+
Install from source in editable mode so changes are picked up live:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
git clone https://github.com/plastic-labs/honcho
|
|
227
|
+
cd honcho
|
|
228
|
+
uv tool install --force --editable --from ./honcho-cli honcho-cli
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Re-run any time — changes to `honcho-cli/src/` are reflected immediately without reinstalling.
|
|
232
|
+
|
|
233
|
+
## License
|
|
234
|
+
|
|
235
|
+
MIT
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
honcho_cli/__init__.py,sha256=wl_8azVLKxDN05LO2VbP-deTdH4kflJ1NY_IVHF7RTM,67
|
|
2
|
+
honcho_cli/_help.py,sha256=gurEYhfe-fMG1NledPOw-AR77xHRC4eDh_GGqXb9LlQ,5372
|
|
3
|
+
honcho_cli/branding.py,sha256=wFFE7xPsAoVoCJcOFmBPNgvLnRtDyzNRrzzadfYSmRA,1049
|
|
4
|
+
honcho_cli/common.py,sha256=mTTJ8Gk5lXewf_CCQImMpyGXSu5y4-c4u0SnY9Bxpfs,3819
|
|
5
|
+
honcho_cli/config.py,sha256=PmaPZ79bRZybBL1as2X3vNBtpamB7xMiWgSFoM-vsys,4979
|
|
6
|
+
honcho_cli/main.py,sha256=76t134BNhfMgRcKCyMeB_uKoW-URitAcTblyM61OJfA,2694
|
|
7
|
+
honcho_cli/output.py,sha256=dn5TTLHx4Exdc14_JFm5Xjb8xMs2O3a7E3MsoM74kdk,2941
|
|
8
|
+
honcho_cli/validation.py,sha256=IPP04h87SG8zRjFkKbEqHPJpmO9Bw_966bljcqlJz58,1197
|
|
9
|
+
honcho_cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
honcho_cli/commands/conclusion.py,sha256=xTcGoH54peav8AL2RB10sGA8niHVAsFS7reHzR16rHc,8486
|
|
11
|
+
honcho_cli/commands/config_cmd.py,sha256=-GHiKyaoZQdDdCCsY2c2jo4NXWRbT5u-nwXbEYBG6AM,1012
|
|
12
|
+
honcho_cli/commands/message.py,sha256=H3JZ3zOZi-kghk45J6xR6rxjuGHFm59H7Ltm_sfEtM0,6373
|
|
13
|
+
honcho_cli/commands/peer.py,sha256=sS71oAW2bNHbyOIxvE8_zYxdcgMQkY_L-9CEXYC85ao,12458
|
|
14
|
+
honcho_cli/commands/session.py,sha256=yLzUfPa9dyeIfX3d2g2TCaXh-bd1pTBK_Kk1HNRgJGw,16274
|
|
15
|
+
honcho_cli/commands/setup.py,sha256=6TgAcJDIbRdmE3s_MXlptYUe7c97dsMETSr5Lq0jRcE,10516
|
|
16
|
+
honcho_cli/commands/workspace.py,sha256=1Ei94ByZR0Csere0t0D8mFp0eSOpL9qCNa0myq4S1R8,11834
|
|
17
|
+
honcho_cli/skills/CONTEXT.md,sha256=vmhJh122nmnX5R1S6PGwQDRnu22JUvq3J116DcqPoxU,1407
|
|
18
|
+
honcho_cli/skills/honcho-debug.md,sha256=xtuvARv-SKN38mecV4Ha_Ab-oBlRN6xwzRWKXHRJT4A,1216
|
|
19
|
+
honcho_cli/skills/honcho-inspect.md,sha256=_Ep8IoKlJthgoQVIj9kvIMkx2LA8KML61JKHabB9Ksk,1170
|
|
20
|
+
honcho_cli-0.1.0.dist-info/METADATA,sha256=DirStT4aIg1PWpLGL-78hCRNAj_y4Z_NpnMYUC7tuFU,8680
|
|
21
|
+
honcho_cli-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
22
|
+
honcho_cli-0.1.0.dist-info/entry_points.txt,sha256=w1ZA8lLpsVY-roy0KtdgQ1wt8pvPgLGsmVq1KxNriHw,47
|
|
23
|
+
honcho_cli-0.1.0.dist-info/RECORD,,
|