cast deploy
Deploy an agent to Castari.
Usage
Arguments
| Argument | Description | Required |
|---|
slug | Agent slug | No (detected from castari.json if in project directory) |
Examples
Deploy from a Castari project directory
If you’re inside a directory with a castari.json file, just run:
The CLI reads the agent slug from your configuration.
Deploy a specific agent
Deploys the agent with slug my-agent, pulling code from its configured git repository.
What Happens During Deploy
Fetch Code
Code is pulled from the agent’s configured git repository.
Create Sandbox
An isolated E2B sandbox is created for your agent.
Install Dependencies
npm install runs inside the sandbox.
Inject Secrets
Any secrets you’ve set become environment variables.
Ready
Agent status becomes active. Ready to invoke.
Agent Configuration
Your agent needs a castari.json file:
{
"name": "my-agent",
"version": "0.1.0",
"entrypoint": "src/index.ts",
"runtime": "node"
}
Redeploying
Running cast deploy on an already-deployed agent will redeploy it:
- Previous sandbox is destroyed
- New sandbox is created
- Latest code is deployed
Redeploying does not preserve sandbox state. All files and data in the sandbox are lost.
Errors
| Error | Cause | Fix |
|---|
Agent not found | Invalid slug | Check cast agents list for correct slug |
castari.json not found | Not in a project directory | Specify the slug explicitly or cd to your project |
npm install failed | Dependency error | Check package.json, run npm install locally first |
Authentication required | Not logged in | Run cast login |
See Also