@tolstoy-ai/cli package on npm. It gives you your products, brand context, media library, Studio assets, and more from the command line.
Create an API key
API keys are available on paid plans.1
Open the API keys page
In Tolstoy, go to Settings → API, MCP & CLI.
2
Create a key
Click Create API Key. Give the key a name, for example “CI pipeline”, and select when it expires.
3
Copy the key
Copy the key immediately. Tolstoy shows it only one time.
Install and sign in
npx @tolstoy-ai/cli in place of tolstoy.
In a script or a CI pipeline, set the TOLSTOY_API_KEY environment variable, or add --api-key <key> to a command.
Run commands
A command has the formtolstoy <service> <command> [flags]:
tolstoy --help. To see the commands of a service, run tolstoy <service> --help. To see the flags of a command, run tolstoy <service> <command> --help.
Use it with an AI coding agent
The CLI includes skills that teach an AI coding agent how to use it:--provider flag accepts claude, opencode or agents. The command installs the skill into the current project. To install it for all your projects, add -g.