Skip to main content

CLI Guide

The SmythOS CLI lets you build, test, and manage agents directly from your terminal.
It’s ideal if you want faster iteration, automation, or integration into existing developer workflows.

Why use the CLI?

The CLI brings automation and speed to agent development.
Use it to scaffold projects, run agents locally, export between Studio and SDK, and add agents to CI/CD pipelines.

Install the CLI

Install globally using npm:

npm install -g @smythos/cli
Requirements
  • Node.js v18 or higher is required
  • Update the CLI regularly for the latest features and bug fixes

Core Commands

These commands cover the majority of everyday tasks:

CommandDescription
sre createScaffold a new SDK agent project with prompts
sre runRun an agent (SDK code or .smyth file) locally
sre buildCompile and prepare your agent for deployment
sre exportConvert SDK projects into .smyth files for Studio
sre helpList all commands and usage examples
Studio ↔ CLI ↔ SDK

You can export a .smyth file from Studio and run it in the CLI, or start with the CLI and import into Studio.
Both workflows are compatible.

Using the CLI in Practice

1. Scaffold a project

sre create

Follow the prompts to set language (TypeScript recommended), name your agent, and initialize project files.

2. Run an agent from Studio export

If you exported an agent to .smyth:

sre run ./my-agent.smyth

The CLI loads the agent and executes it in your terminal.

3. Run your SDK agent

From within an SDK project directory:

sre run

Runs the project entrypoint (e.g. index.ts) and streams the output.

4. Export for Studio

Convert your SDK project back into Studio format:

sre export

Generates a .smyth file ready to open visually.

No extra setup

The CLI handles scaffolding, runtime, and export automatically.
You only point it to your project or file.

Automating with CLI Scripts

You can add CLI commands into npm scripts or shell scripts for automation.

package.json example:

{
"scripts": {
"dev": "sre run",
"build": "sre build",
"export": "sre export"
}
}

Now you can run:

npm run dev
npm run build
Use in CI/CD

Add these scripts to your pipeline to automate testing, builds, and deployments.
For real-world examples, see the SRE repo.

Troubleshooting

  • Run sre help for a full list of commands
  • Confirm Node.js v18+ is installed
  • Update regularly to avoid compatibility issues:
npm update -g @smythos/cli

If problems persist, check SRE GitHub Issues.

Tip for debugging

If an agent fails to run, check whether it was exported correctly from Studio or initialized properly with the SDK.

Next Steps