Skip to content

Commit eb6dfc9

Browse files
feat(duty): query Agent Schedule runs, findings & reports (read-only) (#25)
Add a `praxis duty` command family so a local AI host can triage what the org's scheduled "duty" agents did — without opening the Praxis web UI. Closes #24. Surface (all read-only, --json + non-TTY auto-JSON): praxis duty list duties under the agent praxis duty runs --duty <name|id> recent runs (newest first) praxis duty run <run_id> one run's detail praxis duty report <run_id> the report artifact a run produced praxis duty findings <duty> a duty's findings (open|resolved|all) - internal/duties: typed REST client mirroring internal/memory — generic doJSON transport, Bearer auth, var function seams for test stubbing. - internal/agentcatalog: add Agent.ID and FetchIncludingGlobal so the global "praxis" duty agent (and others) can be resolved by name→id; Fetch/FetchIncludingGlobal share fetchActiveSorted. - cmd/duty: --agent (default "praxis") and <duty> args accept a name or id; empty-state output names the agent (+ resolved id). Reuses activeOrAuthExit/reportHTTPErr/render from cmd/memory. Auth confirmed live: the schedule/run/finding/artifact routes accept the CLI's API-key Bearer token (validate_user_cookie checks it before cookies), so no backend change was needed. Verified end-to-end against a real deployment. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2b3aa53 commit eb6dfc9

8 files changed

Lines changed: 1397 additions & 2 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ cmd/ cobra command tree (only commands that DO something
5151
update.go `praxis update` (self-update via GitHub Releases)
5252
completion.go `praxis completion {bash|zsh|fish|powershell}`
5353
logout.go `praxis logout` (deletes ~/.praxis/credentials)
54+
duty.go `praxis duty *` (Agent Schedule runs/findings/reports)
5455
internal/ pure logic, unit-tested
5556
paths/ ~/.praxis filesystem locations
57+
duties/ REST client for Agent Schedules (duties): runs,
58+
findings, artifacts — mirrors internal/memory
5659
selfupdate/ GitHub Releases fetch, checksum, atomic replace
5760
Makefile build (with ldflags), install, test, lint, clean
5861
.goreleaser.yml release config — raw binaries × 4 arches + brew tap

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ Each capability is one or more functions on a server-side MCP. Run
3636
but its runtime didn't surface the files in smoke testing — it's
3737
gated off until Codex's loader catches up to its own docs.
3838

39+
- **Triage scheduled-agent ("duty") output** — list the org's duties,
40+
read a duty's recent runs, open the report artifact a run produced,
41+
and list a duty's findings. Read-only: pulls overnight schedule output
42+
into the terminal so your AI can answer "what did my duties find, and
43+
what should I do about it?" without opening the web UI. See
44+
`praxis duty --help`.
45+
3946
### Coming soon
4047

4148
- **Incident operations** — open / query / attach evidence to
@@ -122,7 +129,7 @@ That's it. Open Claude Code (or Codex, or Gemini CLI) and try:
122129
123130
## Command surface
124131

125-
The CLI ships **10 user-facing commands**. All AI-callable commands
132+
The CLI ships **11 user-facing commands**. All AI-callable commands
126133
accept `--json` (auto-emit when stdout is non-TTY) with stable JSON
127134
schemas. `login` requires a human at a browser; it still emits a
128135
JSON envelope so your AI host can see what got installed.
@@ -155,6 +162,16 @@ praxis agents [--json]
155162
agents from /ai-api/custom-agents, prefixed `praxis-`). Read-only,
156163
no network call.
157164
165+
praxis duty <subcommand> [--agent <name|id>] [--json]
166+
Query Agent Schedule ("duty") runs, findings, and the report
167+
artifacts they produce. Read-only. --agent defaults to the global
168+
"praxis" duty agent; <duty> args accept a schedule name or id.
169+
list duties under the agent
170+
runs --duty <d> [--limit N] recent runs (newest first)
171+
run <run_id> one run's detail
172+
report <run_id> the report artifact a run produced
173+
findings <duty> [--status open|resolved|all] [--limit N]
174+
158175
praxis refresh-skills [--project] [--json]
159176
Re-fetch this profile's catalog and rewrite skill files + MCP
160177
snapshot, without re-authenticating. Use when the org has

0 commit comments

Comments
 (0)