Octri

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:

bash
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.com

Flag 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

LanguageHow to run it
TypeScriptacme-api-cli, from the package's bin
Pythonacme-api-cli
Gogo run ./cmd/acme_api-cli
PHPbin/acme-api-cli
Javajava -jar target/acmeapi-1.4.0.jar, after mvn package

The README's Command-line client section gives the command for that package.

Java's CLI lists commands only

The generated Java CLI shows the commands. To run an operation, use the typed Java API.

Configuration

Generate a CLIon or offdefault: off

Set 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_URLURL

The address to call.

ACME_API_AUTHJSON

The credentials, in the same shape as the client's auth.

bash
export ACME_API_AUTH='{"bearer":"sk_live_..."}'
acme-api-cli list-users

Keep 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

Try the API without writing code

An evaluator can call a real endpoint in one line, instead of setting up a project first.

Scriptable operations

Support and ops teams get a supported tool instead of hand-written curl.

What it costs

Destructive operations become runnable commands too

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.