You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`spice -sql <query>`|`spice sql --query <query>`| Run a single SQL statement and exit. |
94
+
|`spice -p <prompt>`|`spice chat <prompt>` (one-shot) | Send a single chat prompt and exit. |
95
+
|`spice -chat <prompt>`|`spice chat <prompt>` (one-shot) | Alias for `-p`. |
96
+
97
+
The shortcut consumes the first non-flag argument as the value; any other flags (including global flags such as `--cloud`, `--api-key`, `--endpoint`, and `--machine`) are forwarded to the underlying command. Use `--` to terminate flag parsing when the prompt or query begins with a `-`.
Pass `--machine` (alias `--programmatic`) as a global flag to make the CLI output JSON wherever supported and emit structured JSON for errors. This is intended for LLM agents, CI scripts, and other automation that needs to parse `spice` output reliably.
113
+
114
+
```bash
115
+
# Default human output
116
+
spice version
117
+
118
+
# Same command, JSON output for automation
119
+
spice --machine version
120
+
121
+
# Works with subcommands
122
+
spice --machine status
123
+
spice --machine query list
124
+
spice --machine cloud secrets list
125
+
126
+
# Combine with direct shortcuts
127
+
spice --machine -sql "select 1"
128
+
```
129
+
130
+
`--machine` is global and may appear before or after the subcommand (`spice status --machine` is also valid). When set, mutating commands that support JSON output also default to JSON, and clap parsing errors are emitted as JSON to stderr.
0 commit comments