docs: document structured output schema
This commit is contained in:
29
SCHEMA.md
Normal file
29
SCHEMA.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Structured Output Schema
|
||||
|
||||
`twitter-cli` uses a shared agent-friendly envelope for machine-readable output.
|
||||
|
||||
## Success
|
||||
|
||||
```yaml
|
||||
ok: true
|
||||
schema_version: "1"
|
||||
data: ...
|
||||
```
|
||||
|
||||
## Error
|
||||
|
||||
```yaml
|
||||
ok: false
|
||||
schema_version: "1"
|
||||
error:
|
||||
code: api_error
|
||||
message: User @foo not found
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- `--yaml` and `--json` both use this envelope
|
||||
- non-TTY stdout defaults to YAML
|
||||
- tweet and user lists are returned under `data`
|
||||
- `status` returns `data.authenticated` plus `data.user`
|
||||
- `whoami` returns `data.user`
|
||||
Reference in New Issue
Block a user