@tolstoy-ai/cli package on npm. It gives you your products, brand context, media library, models, AI widgets, Meta ads, and more from the command line.
The CLI is optional. The Tolstoy MCP carries the core tools for an AI agent. Use the CLI when you work from a terminal or a script, or when your agent needs a tool that the MCP does not have. CLI commands lists every command and its flags.
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.