.do

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.do

Now 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?

AspectTraditional CLICLI.do
CommandsFixed, predefinedAny code via RPC
ComposabilityLimited pipingFull code composition
New FeaturesRequire CLI updatesInstant via SDK
Learning CurveLearn all commandsLearn SDK once
IntegrationPer-command supportAny API instantly

Available Primitives

When executing code, you have access to:

  • $ - Semantic proxy for $.Subject.predicate.Object patterns
  • db - Database operations (list, get, create, update, delete)
  • ai - AI operations (generate, embed, chat)
  • api - API integrations (stripe, sendgrid, slack, any API)
  • on - Event handlers
  • send - Event publisher
  • every - Scheduled tasks
  • user - Human-in-the-loop functions

Security

All code execution happens via secure RPC:

  1. Authentication - Every request requires valid credentials
  2. Validation - Code is parsed and validated before execution
  3. Sandboxing - Execution in isolated environments
  4. Rate Limiting - API calls are rate-limited per user
  5. Audit Logging - All operations are logged

Next Steps

See Also