|
1 | 1 | # CLI Architecture |
2 | 2 |
|
3 | | -This repository is being refactored toward an agent-first, deeply Effect-native CLI. |
| 3 | +The CLI is agent-first and Effect-native. |
4 | 4 |
|
5 | | -## North Star |
| 5 | +## Principles |
6 | 6 |
|
7 | 7 | - Thin Effect CLI command adapters from `effect/unstable/cli` |
8 | 8 | - Explicit services and layers for runtime, output, config, state, SDK access, and workflows |
@@ -119,25 +119,11 @@ Sensitive reports and deletion requests go to the private security contact. |
119 | 119 |
|
120 | 120 | ## Agent-First Contract |
121 | 121 |
|
122 | | -- Every command should have structured output. |
123 | | -- Mutating commands should grow raw JSON payload input and dry-run support. |
124 | | -- Read commands should grow field-selection and pagination controls. |
125 | | -- Machine-readable introspection should describe command purpose and capabilities without relying on prose docs. |
126 | | -- Structured renderers should redact sensitive values and mark prompt-injection-like API text as untrusted data. |
127 | | -- Repo docs should explain the architecture and guardrails in formats agents can consume quickly. |
128 | | - |
129 | | -## Current Phase |
130 | | - |
131 | | -The current CLI contract already includes: |
132 | | - |
133 | | -- schema-backed `describe` metadata for command purpose, capabilities, flags, and raw JSON payload shapes |
134 | | -- neutral automation metadata in `describe` for supported output, dry-run, raw JSON input, field-selection, streaming, and safety features |
135 | | -- raw `--json` input and `--dry-run` on mutating commands |
136 | | -- named auth profiles with env/default-profile selection and legacy single-token fallback |
137 | | -- `--fields` on agent-relevant read commands |
138 | | -- cursor-backed `--page-all` on `files list`, `files search`, `search`, and `transfers list` |
139 | | -- shared hardening for field selectors and identifier-like inputs before API calls |
140 | | -- structured output redaction plus `_meta.agentSafety.untrustedTextPaths` annotations for prompt-injection-like API text |
141 | | -- a versioned consumer skill library in `skills/putio-cli` with surface guides for discovery, auth/device approval, reads, writes, guardrails, and OpenAI/Codex picker metadata |
142 | | - |
143 | | -Next architectural work can keep extracting deeper services and workflows without losing the agent-first CLI surface. |
| 122 | +- Schema-backed `describe` metadata covers command purpose, capabilities, flags, raw JSON payload shapes, and neutral `automation` metadata for output, dry-run, raw JSON input, field selection, streaming, and safety features, so agents do not depend on prose docs. |
| 123 | +- Every leaf command catalogued by `describe` has structured output; the root and group commands such as `putio auth` print plain help text. |
| 124 | +- Mutating commands accept raw `--json` input and `--dry-run`. |
| 125 | +- Agent-relevant read commands accept `--fields`; `files list`, `files search`, `search`, and `transfers list` also accept cursor-backed `--page-all`. |
| 126 | +- Field selectors and identifier-like inputs are hardened before API calls. |
| 127 | +- Named auth profiles support env and default-profile selection, with the legacy single-token config as fallback. |
| 128 | +- Structured renderers redact sensitive values and mark prompt-injection-like API text in `_meta.agentSafety.untrustedTextPaths`. |
| 129 | +- [`skills/putio-cli`](../skills/putio-cli/SKILL.md) is the versioned consumer skill, with references for discovery, auth and device approval, reads, writes, and guardrails, plus OpenAI/Codex picker metadata. |
0 commit comments