From 85abc45e3a16870c4b96ce6711734a138ed6ff01 Mon Sep 17 00:00:00 2001 From: ajspig Date: Tue, 14 Apr 2026 10:29:54 -0400 Subject: [PATCH] fix: config commands and session id command --- honcho-cli/README.md | 2 +- .../src/honcho_cli/commands/config_cmd.py | 25 ++++++++++--------- honcho-cli/src/honcho_cli/commands/session.py | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/honcho-cli/README.md b/honcho-cli/README.md index 9000a9b9..7b06acb3 100644 --- a/honcho-cli/README.md +++ b/honcho-cli/README.md @@ -107,7 +107,7 @@ Per-command scoping (workspace / peer / session) is handled via `-w` / `-p` / `- | Command | Description | |---------|-------------| -| `honcho config show` | Show current config (API key redacted) | +| `honcho config` | Show current config (API key redacted) | ## Agent Usage diff --git a/honcho-cli/src/honcho_cli/commands/config_cmd.py b/honcho-cli/src/honcho_cli/commands/config_cmd.py index 021bf238..fa4a11f0 100644 --- a/honcho-cli/src/honcho_cli/commands/config_cmd.py +++ b/honcho-cli/src/honcho_cli/commands/config_cmd.py @@ -1,4 +1,4 @@ -"""Config inspection command: ``honcho config show``. +"""Config inspection command: ``honcho config``. Writing to ``~/.honcho/config.json`` is done only via ``honcho init``, which manages the two CLI-owned keys (``apiKey`` + ``environmentUrl``). @@ -16,15 +16,16 @@ from honcho_cli.output import print_result app = typer.Typer(help="Inspect CLI configuration.", invoke_without_command=True) -@app.callback() -def _default(ctx: typer.Context) -> None: - """Show current config when no subcommand is given.""" - if ctx.invoked_subcommand is None: - show() - - -@app.command() -def show() -> None: +@app.callback(invoke_without_command=True) +def config( + ctx: typer.Context, + json_output: bool = typer.Option(False, "--json", help="Force JSON output"), +) -> None: """Show current config (api key redacted).""" - config = CLIConfig.load() - print_result(config.redacted()) + if ctx.invoked_subcommand is not None: + return + from honcho_cli.common import handle_cmd_flags + + handle_cmd_flags(json_output=json_output) + cfg = CLIConfig.load() + print_result(cfg.redacted()) diff --git a/honcho-cli/src/honcho_cli/commands/session.py b/honcho-cli/src/honcho_cli/commands/session.py index fa1103ab..2d0df388 100644 --- a/honcho-cli/src/honcho_cli/commands/session.py +++ b/honcho-cli/src/honcho_cli/commands/session.py @@ -98,7 +98,7 @@ def inspect( message_count_is_total = False result = { - "id": sid, + "session_id": sid, "peers": [{"id": p.id} for p in peers], "message_count": message_count, "message_count_is_total": message_count_is_total,