π Smart automation toolkit for OpenCode agents
Beautiful, intelligent alternatives to bash commands with auto-detection, enhanced output, and zero configuration.
Before Kit π€
bash { command: "npm run test" }
# Command: npm run test
# Exit code: 0
#
# Stdout:
# 126 tests passed
#
# Stderr:After Kit β¨
kit { script: "test" }
# β
test completed successfully (2.1s)
# π§ͺ 126 tests passed
#
# π Output:
# All test suites passed successfullyKit provides intelligent, context-aware automation for:
- π¦ Package.json scripts (lint, test, build, dev)
- π³ Docker operations (up/down, logs, build, exec)
- π Docker Compose (multi-service orchestration)
- π Development servers (background process management)
npm install -g @autotelic/oc-kit
mkdir -p ~/.opencode/tool
cp "$(npm root -g)/@autotelic/oc-kit/tool/*" ~/.opencode/tool/npm install @autotelic/oc-kit
mkdir -p .opencode/tool
cp node_modules/@autotelic/oc-kit/tool/* .opencode/tool/# In this repo
npm link
mkdir -p ~/.opencode/tool
cp tool/* ~/.opencode/tool/| Tool | Purpose | Example |
|---|---|---|
kit |
Package.json scripts | kit { script: "test" } |
kit_list |
List available scripts | kit_list {} |
kit_docker |
Container operations | kit_docker { action: "ps" } |
kit_compose |
Docker Compose | kit_compose { action: "up" } |
kit_devStart |
Background dev servers | kit_devStart { script: "api" } |
kit_devStatus |
Monitor processes | kit_devStatus {} |
kit { script: "build" }
# β
build completed successfully (15.2s)
# ποΈ Build artifacts generated
#
# π Output:
# Bundled 23 modules in 142ms
# dist/kit.js 89.2 KBkit { script: "test" }
# β test failed (0.8s)
#
# π§ Command: bun test src/
# π Exit code: 1
#
# β Error details:
# Module not found: cannot resolve './missing-file'
#
# π‘ Suggestions:
# β’ Try running `npm install` to ensure dependencies are installed
# β’ Check the file path and ensure the module existskit_docker { action: "logs", container: "api" }
# β
logs completed successfully
#
# π Output:
# Server listening on port 3000
# Database connected successfully
# Ready to accept connections- π§ͺ Tests: "142 tests passed", "Test suite completed"
- ποΈ Builds: "Build artifacts generated", "Bundle created"
- π§Ή Linting: "No issues found", "Code style verified"
- π Type checking: "No type errors", "Types validated"
- π Dev servers: "Server ready", "Listening on port 3000"
- Package managers: npm, yarn, pnpm, bun (based on lock files)
- Docker setup: Compose files, containers, services
- Doppler config: Automatic environment variable injection
- Monorepo structure: Workspace filtering and targeting
- Contextual suggestions based on error patterns
- Dependency issues: "Try running npm install"
- Permission problems: "Check file permissions"
- Port conflicts: "Another process may be using this port"
- Memory issues: "Try increasing Node.js memory limit"
- Quick operations: 30 seconds (ps, status, logs)
- Build operations: 5 minutes (build, pull, up)
- Custom timeouts: Override when needed
- No hanging processes: Automatic cleanup
Replace complex bash commands with simple, reliable automation:
// β Old way - error-prone and verbose
bash { command: "NODE_OPTIONS='--max-old-space-size=4096' pnpm --filter @app/ui run build --mode production" }
// β
New way - handles complexity automatically
kit { script: "build", cwd: "./packages/ui" }// Monorepo workspace filtering
kit { script: "test", args: ["--watch"], cwd: "./services/api" }
// Skip Doppler if needed
kit { script: "build", skipDoppler: true }
// Custom package manager
kit { script: "dev", packageManager: "bun" }kit_docker { action: "ps" } // List containers
kit_docker { action: "logs", container: "api" }
kit_docker { action: "exec", container: "db", args: ["psql", "-U", "user"] }kit_compose { action: "up", profile: "database" } // Start DB services only
kit_compose { action: "logs", services: ["api", "worker"] }
kit_compose { action: "down" } // Clean shutdownkit_dockerList {}
# === Docker Capabilities ===
# Docker Available: β
# Compose Available: β
#
# === Discovered Services ===
# Database: postgres, redis
# API: api, worker
# Frontend: web, adminManage multiple dev servers with SQLite-based process tracking:
kit_devStart { script: "api" } // Backend server
kit_devStart { script: "web" } // Frontend
kit_devStart { script: "worker" } // Background jobs
// Start multiple at once
kit_devStartAll { scripts: ["api", "worker", "web"] }kit_devStatus {} // Show all running services
kit_devStop { script: "api" } // Stop specific service
kit_devRestart { script: "web" } // Restart service
kit_devStop {} // Stop all services// Custom SQL queries on process database
kit_devQuery {
query: "SELECT script, COUNT(*) FROM processes GROUP BY script"
}
kit_devQuery {
query: "SELECT * FROM processes WHERE start_time > ?",
params: ["1726929000000"]
}- Package.json scripts (test, build, lint, dev)
- Docker operations (up, down, logs, exec)
- Docker Compose orchestration
- Development server management
- Monorepo workspace commands
- Environment-dependent operations
- Multi-step shell pipelines (
ls | grep | sort) - File operations (
cp,mv,mkdir) - Complex shell scripting
- System administration tasks
| Feature | Kit | Bash |
|---|---|---|
| Package Manager Detection | β Automatic | β Manual |
| Doppler Integration | β Built-in | β Manual setup |
| Error Suggestions | β Context-aware | β Raw output |
| Timeout Protection | β Smart defaults | β Hangs forever |
| Output Formatting | β Beautiful, organized | β Raw text |
| Workspace Filtering | β Automatic | β Complex syntax |
| Process Management | β SQLite tracking | β No tracking |
| Zero Configuration | β Works everywhere | β Project setup |
This project dogfoods its own tools:
# Use kit instead of bash for everything!
kit { script: "test" } # Run tests
kit { script: "typecheck" } # Type checking
kit { script: "lint" } # Linting
kit { script: "build" } # Build for distribution
# Background development
kit_devStart { script: "dev" } # Start dev server
kit_devStatus {} # Monitor processes- Runtime: Bun-native APIs throughout
- Process Management: SQLite in-memory database + JavaScript Map
- Security: Comprehensive validation and guardrails
- Testing: 126 tests with full coverage
- Distribution: Dual-path for production and development
MIT Β© Autotelic
Made with β€οΈ for the OpenCode community
Documentation β’ Issues β’ Contributing