CLI Guide
The SmythOS CLI puts powerful agent management at your fingertips. With the CLI, you can automate project setup, run and test agents, manage builds, and bridge visual (Studio) and code-first (SDK) workflows from your terminal.
Why Use the CLI?
If you care about speed, automation, or repeatable developer workflows, the CLI is designed for you:
- Scaffold a new project or agent in seconds
- Run agents from SDK code or
.smyth
files exported from Studio - Test, debug, and build agents without boilerplate
- Automate anything, from local scripts to CI/CD pipelines
- Instantly swap environments and configs as you iterate
How to Install
To get started, install the CLI globally:
npm install -g @smythos/cli
You’ll only need to do this once.
The Commands You’ll Use Most
You can control every stage of your agent workflow right from your terminal:
Command | What you can do with it |
---|---|
sre create | Interactively scaffold a new SDK agent project |
sre run | Run an agent (SDK code or .smyth file) on your device |
sre build | Prepare your agent for production deployment |
sre export | Export agent definitions for Studio or SDK use |
sre help | List all available CLI commands and their usage |
How You’ll Use the CLI in Practice
- Automate your agent testing:
Addsre run
to your scripts or pipelines to catch issues early. - Prototype ideas faster:
Usesre create
to spin up projects side-by-side and try new approaches. - Blend visual and code workflows:
Export agents from Studio, then run or extend them using the CLI or SDK. - Streamline CI/CD:
Add CLI steps to automate validation, builds, or agent packaging in your pipeline.
Example: Scaffold, Run, and Test Agents
1. Scaffold a new agent project
sre create
This command guides you through creating a new project with the right structure for your workflow. Choose your language (TypeScript is recommended), give your agent a name, and follow the prompts.
2. Run a Studio agent from a .smyth
file
If you exported an agent from Studio:
sre run ./my-agent.smyth
You’ll see your agent load up and respond to prompts, right in your terminal.
3. Run the main agent in your SDK project
In your SDK project directory, you can run:
sre run
This executes your index.ts
(or entrypoint) agent and streams the result.
4. Export your project for use in Studio
To convert your SDK agent to Studio’s visual format:
sre export
You’ll get a .smyth
file ready to import in the visual builder.
Example: Add CLI to Your Workflow Script
You can use the CLI in package.json
scripts or shell scripts for automation.
Add this to your package.json
:
"scripts": {
"dev": "sre run",
"build": "sre build",
"export": "sre export"
}
Now run:
npm run dev
or
npm run build
You can integrate these steps into CI/CD pipelines for automated agent validation and deployment and lear nmore at the SRE repo.
Troubleshooting and Help
- Run
sre help
for a quick reference of all CLI commands. - If you run into issues or have suggestions, check SRE GitHub Issues.
- Make sure you’re running Node.js version 18 or higher.
What's Next
- Getting Started Guide: Step-by-step setup and prerequisites
- Building Agents: All options for creating agents, visually or in code
- SDK Guide: Deep dive into programmatic workflows
- Hybrid Workflows: Combine visual and code approaches for the best of both worlds