Skip to content

mocactl: headless 'sessions' (and 'credentials') commands with --json #406

Closed

Description

@pdettori

Found preparing the VM demo B runbook (#367, PR #403, fix-list item 5).

Problem

The headless CLI has only login, doctor and run (packages/mocactl/src/cli.ts:6-12). Listing sessions and adding credentials exist only in the TUI overlays (/sessions, /credentials). So the two-user acceptance run's "my list excludes the other user's sessions" check (Act 2a) is done with curl and a hand-built header file, and a scripted setup can't store an inference credential without the TUI.

Proposal

  • mocactl sessions [--json]: GET /v1/sessions, paginated, with id, title, created and last-turn times.
  • mocactl sessions delete ID.
  • mocactl credentials [--json], and mocactl credentials add NAME --kind … --consumer inference --host … --endpoint …, with the secret read from stdin, never argv.
  • A stable --json shape documented in packages/mocactl/README.md.

Related: #381 adds subagent-specific commands (spawn, subagents, …) over the same API. Share the output and --json conventions, and don't duplicate a sessions listing.

Not on the critical path

The acceptance run works with the TUI plus curl (documented in the runbook).

Activity

  1. added a commit that references this issue on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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