Skip to content

bullpen sessions: add --json for scripting #5

Description

@Steel-tech

bullpen sessions prints fixed-width human output and nothing else — there is no machine-readable output anywhere in the CLI today. Anything that wants to act on session state has to parse a padded column layout, which breaks the moment a title contains two spaces or an id prefix collides.

That is an awkward gap for a harness whose stated thesis is that SQLite is the coordination plane. Reading that plane from outside bullpen currently means either screen-scraping or opening the database directly, and the second one couples callers to the schema.

What

Add --json to bullpen sessions. When set, emit the session list as JSON instead of the human table.

Each session should carry at least what the human output already shows, unabbreviated: full session id (not the 8-char prefix), updated_at, provider, input and output token counts, title, and parent_session_id for pen children.

Notes

  • Additive only — default output is unchanged, so nothing that reads the current format breaks.
  • The empty case currently prints a friendly "no sessions yet" hint. Under --json that should be valid JSON (an empty array), not prose on stdout.
  • serde and serde_json are already workspace dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions