CLI.do
Execute any code securely via RPC from the command line
The do command enables secure arbitrary code execution via RPC from your terminal. Execute any semantic pattern, integrate with any API, and orchestrate complex workflows—all from a single command.
The Power of do [code]
Unlike traditional CLIs with fixed commands, do executes any valid code using semantic $.Subject.predicate.Object patterns via secure RPC:
# Execute semantic patterns
do $.Business.create({ name: 'Acme Corp' })
do $.User.assign.Role({ userId: 123, roleId: 'admin' })
# Traverse and transform data
do db.Occupations.forEach.Task.generateLeanCanvas()
do db.Industries.filter({ growth: '>10%' }).map.Analysis()
# Integrate with any API
do api.stripe.createPayment({ customerId: 'cus_123', amount: 5000 })
do api.sendgrid.sendEmail({ to: '[email protected]', template: 'welcome' })
do api.slack.postMessage({ channel: '#general', text: 'Deploy complete' })
# Chain operations
do $.Order.create({ total: 99 }).then.Email.send().then.Slack.notify()
# Execute AI operations
do ai.generate({ prompt: 'Write a product description', model: 'gpt-5' })Every expression is executed securely via RPC with full authentication, validation, and error handling.
Installation
Use Without Installing
npx cli.do [code]Install Globally
npm install -g cli.do
# or
pnpm add -g cli.doNow use the do command:
do $.Business.create({ name: 'Acme' })Quick Start
# Authenticate
do auth login
# Create entities
do $.Business.create({ name: 'Acme Corp', industry: 'Technology' })
# Query data
do db.list($.Business)
# Execute AI operations
do ai.generate('Write a haiku about code')
# Integrate APIs
do api.stripe.customers.create({ email: '[email protected]' })Why Code Execution vs Traditional CLI?
| Aspect | Traditional CLI | CLI.do |
|---|---|---|
| Commands | Fixed, predefined | Any code via RPC |
| Composability | Limited piping | Full code composition |
| New Features | Require CLI updates | Instant via SDK |
| Learning Curve | Learn all commands | Learn SDK once |
| Integration | Per-command support | Any API instantly |
Available Primitives
When executing code, you have access to:
$- Semantic proxy for$.Subject.predicate.Objectpatternsdb- Database operations (list, get, create, update, delete)ai- AI operations (generate, embed, chat)api- API integrations (stripe, sendgrid, slack, any API)on- Event handlerssend- Event publisherevery- Scheduled tasksuser- Human-in-the-loop functions
Security
All code execution happens via secure RPC:
- Authentication - Every request requires valid credentials
- Validation - Code is parsed and validated before execution
- Sandboxing - Execution in isolated environments
- Rate Limiting - API calls are rate-limited per user
- Audit Logging - All operations are logged
Next Steps
- Getting Started - Installation and first commands
- Examples - Real-world usage patterns
- Authentication - Auth setup and configuration
- Patterns Guide - Semantic pattern reference