Generated CLI
Turn on Generate a CLI in SDK Studio and your SDK also ships a command-line client for your API, with one command per operation. It's off by default.
This is a tool for your customers, generated from your spec. It's separate from Octri's own CLI.
What it produces
Each operation becomes a kebab-case command, named from its operation, with a flag per argument. Your package name sets the command's name:
acme-api-cli --help # list commands
acme-api-cli list-users --help # show a command's flags
acme-api-cli list-users --limit 10
acme-api-cli create-user --email ada@example.comFlag values are typed from your spec. A value that looks like JSON is parsed as JSON, so nested objects can be passed as one quoted flag.
Running it
| Language | How to run it |
|---|---|
| TypeScript | acme-api-cli, from the package's bin |
| Python | acme-api-cli |
| Go | go run ./ |
| PHP | bin/ |
| Java | java -jar target/, after mvn package |
The README's Command-line client section gives the command for that package.
The generated Java CLI shows the commands. To run an operation, use the typed Java API.
Configuration
Generate a CLIon or offSet in SDK Studio, for every language at once.
cli ยท CLI octri sdk settings set cli true
The generated CLI reads its own settings from the environment. The prefix comes from your package name, so a package called acme-api reads these:
ACME_API_BASE_URLURLThe address to call.
ACME_API_AUTHJSONThe credentials, in the same shape as the client's auth.
export ACME_API_AUTH='{"bearer":"sk_live_..."}'
acme-api-cli list-usersKeep credentials in the environment or a secret store rather than typing them on a command line, where they end up in shell history and CI logs.
What's covered
Commands cover operations whose arguments can safely be represented as flags. For complex request bodies and streaming, use the typed library.
Endpoints excluded from the SDK don't get a command. See generating an SDK.
Why ship one
An evaluator can call a real endpoint in one line, instead of setting up a project first.
Support and ops teams get a supported tool instead of hand-written curl.
What it costs
Every included operation becomes a command, so delete-user is one typo away from a bad afternoon. Before turning it on, check your endpoint inclusion. Anything that shouldn't be one keystroke from a shell should be excluded.
The CLI's argument parsing is generated, but shipping it is still a promise to your users, and renaming an operation renames a command they may have scripted.
Relationship to the library
The CLI is a thin layer over the generated client, so retries and idempotency work the same way.