Skip to content

Add --json flag to kbot status command #15

@isaacsight

Description

@isaacsight

What

Add a --json flag to the kbot status command so it outputs machine-readable JSON instead of the current human-readable terminal output.

Why

Scripting and automation workflows (CI pipelines, monitoring dashboards, other tools) need to consume kbot's status programmatically. Right now, kbot status only prints formatted text with chalk colors, which is hard to parse.

Suggested approach

  1. Add a --json option to the status command definition in cli.ts (around line 164).
  2. When --json is passed, call getStatus() as usual but output JSON.stringify(status, null, 2) to stdout instead of calling printInfo().
  3. Follow the same pattern already used by the global --json flag (see GLOBAL_OPTIONS in completions.ts line 37).

Example output:

{
  "version": "3.41.0",
  "agent": "kernel",
  "tier": "pro",
  "toolCount": 60,
  "learning": {
    "patternsCount": 42,
    "knowledgeCount": 15
  },
  "sessionCount": 7
}

Files to look at

  • packages/kbot/src/cli.ts — The status command definition (~line 164)
  • packages/kbot/src/ide/bridge.ts — The getStatus() function that returns the status object
  • packages/kbot/src/completions.ts — Update the completions data if adding new subcommand options

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions