sandock-cli
v0.2.2
Published
Command-line interface for Sandock - Sandbox in Docker for AI Agents
Downloads
10
Maintainers
Readme
Sandock CLI
Command-line interface for Sandock - Sandbox in Docker for AI Agents
Installation
Run directly with npx (no installation needed):
npx sandock --help
# or
npx sandock-cli --helpOr install globally:
npm install -g sandock-cli
# or
pnpm add -g sandock-cli
# Then use directly
sandock --helpUsage
Configuration
Configure your Sandock API URL and credentials:
# Show current configuration
sandock config --show
# Set API URL
sandock config --set-url https://sandock.ai
# Set API key (if required)
sandock config --set-key your-api-key
# Reset to defaults
sandock config --resetSandbox Management
Create a sandbox
# Uses server default image (sandockai/sandock-code:latest)
sandock sandbox create --name my-sandbox
# Or specify a custom image
sandock sandbox create --name my-sandbox --image node:20-alpine
sandock sandbox create -n python-env -i python:3.11List sandboxes
sandock sandbox list
sandock sandbox list --limit 50Get sandbox info
sandock sandbox info sb_12345Execute commands
sandock sandbox exec sb_12345 "node -v"
sandock sandbox exec sb_12345 "python script.py" --timeout 60Available Commands
sandock config
Manage CLI configuration (API URL, API key)
Flags:
--show, -s: Show current configuration--set-url <url>: Set API URL--set-key <key>: Set API key--reset: Reset configuration to defaults
sandock sandbox create
Create a new sandbox
Flags:
--name, -n <name>(required): Sandbox name--image, -i <image>: Docker image to use (default on server: sandockai/sandock-code:latest)--space, -s <id>: Space ID (default: default)
sandock sandbox list
List all sandboxes
Flags:
--limit, -l <number>: Maximum number of sandboxes to list (default: 20)
sandock sandbox info <id>
Get detailed information about a sandbox
Args:
id(required): Sandbox ID
sandock sandbox exec <id> <command>
Execute a command in a sandbox
Args:
id(required): Sandbox IDcommand(required): Command to execute
Flags:
--timeout, -t <seconds>: Execution timeout in seconds (default: 30)
Examples
# Create a Node.js sandbox with default image
sandock sandbox create --name my-app
# Create with custom image
sandock sandbox create --name my-app --image node:20
# List all sandboxes
sandock sandbox list
# Execute code in a sandbox
sandock sandbox exec sb_abc123 "npm install && npm start"
# Check sandbox info
sandock sandbox info sb_abc123Development
This CLI uses oclif framework and the sandock SDK.
# Install dependencies
pnpm install
# Build
pnpm build
# Run locally
pnpm dev config --showLinks
- Website: https://sandock.ai
- Documentation: https://sandock.ai/docs
- Sandock SDK: https://www.npmjs.com/package/sandock
- GitHub: https://github.com/sandock-ai/sandock
License
MIT License - see LICENSE for details
