PRISM CLI
Agentic coding assistant for your terminal. Like Claude Code / Gemini CLI.
All CLI commands run through PRISM's 5-tier validation architecture and your account middleware.
Account-Bound Middleware
Every CLI command authenticates with your API key and flows through:
- • Your API key ties all usage to your account
- • Multi-tenant isolation via organization_id in JWT
- • Row-Level Security ensures data isolation
- • Usage and billing tracked per account
Installation
# Install globally via npm
npm install -g @prism/cli
# Or run directly with npx
npx @prism/cli chat
# Verify installation
prism --versionConfiguration
# Set your API key (stored in ~/.prism/config.json)
prism config set api_key YOUR_API_KEY
# Or use environment variable
export PRISM_API_KEY=your_api_key
# Verify configuration
prism config listYour API key connects you to your account. All commands, usage, and data are scoped to your account/organization. Get your key from the dashboard.
Commands
prism chat(alias: c)Start interactive coding session with full agentic capabilities
prism ask <query>(alias: a)Ask a single question and get a validated response
prism build <desc>(alias: b)Build features, components, APIs, or full projects
prism test [file](alias: t)Run tests and analyze results. Use --fix to auto-fix failures
prism fix <issue>(alias: f)Debug and fix bugs in your codebase
prism update <desc>(alias: u)Refactor, optimize, or update existing code
prism deploy [platform](alias: d)Deploy to Vercel, Cloud Run, Docker, or npm
Interactive Mode
The default mode. Full coding assistant with file operations, testing, and deployment.
$ prism
╔═══════════════════════════════════════════════════════════════╗
║ PRISM CLI - Agentic Coding Assistant ║
╚═══════════════════════════════════════════════════════════════╝
Project: /Users/you/myproject
Language: typescript | Framework: nextjs
Git: main
Commands: /help /clear /save /exit
Or just type your request (questions, build, test, fix, deploy)
prism> What files handle authentication?
→ search_code(auth|login|session)
Authentication is handled in:
1. src/lib/auth.ts - Core logic
2. src/api/auth/[...nextauth].ts - NextAuth config
3. src/middleware.ts - Route protection
prism> Add rate limiting to the login endpoint
→ read_file(src/api/auth/[...nextauth].ts)
→ run_command(npm install rate-limiter-flexible)
→ edit_file(src/api/auth/[...nextauth].ts)
✓ Added rate limiting: 5 attempts per minute per IP.
prism> /exit
✓ Session saved. Goodbye!Agentic Capabilities
The CLI can perform real actions in your codebase:
| Tool | Description |
|---|---|
| read_file | Read file contents (with optional line range) |
| write_file | Create or overwrite files |
| edit_file | Find and replace in files |
| run_command | Execute shell commands |
| list_files | List directory contents |
| search_code | Search codebase with regex |
| run_tests | Run project tests (auto-detects test runner) |
| git_operation | Git commands (status, diff, commit, push, etc.) |
| deploy | Deploy to Vercel, Cloud Run, Docker, npm |
Examples
Build a Feature
$ prism build "a REST API for user management with JWT auth"
🔨 Building: a REST API for user management with JWT auth
→ list_files(.)
→ read_file(package.json)
→ run_command(npm install express jsonwebtoken bcryptjs)
→ write_file(src/routes/users.ts)
→ write_file(src/middleware/auth.ts)
→ write_file(src/models/User.ts)
→ run_tests()
✓ Created user management API with:
- POST /api/users/register
- POST /api/users/login
- GET /api/users/me (protected)
- PUT /api/users/me (protected)Fix a Bug
$ prism fix "users getting 401 error when logging in"
🔧 Fixing: users getting 401 error when logging in
→ search_code(401|unauthorized)
→ read_file(src/api/auth.ts)
→ read_file(src/middleware/auth.ts)
Found issue: JWT token missing 'Bearer ' prefix in header.
→ edit_file(src/lib/api-client.ts)
→ run_tests()
✓ Fixed! Added Bearer prefix to Authorization header.Run & Fix Tests
$ prism test --fix
🧪 Running tests...
→ run_tests()
3 tests failed:
1. UserService.create - Expected email validation error
2. AuthController.login - Token format mismatch
3. API.users - Missing required field
→ read_file(src/services/UserService.test.ts)
→ edit_file(src/services/UserService.ts)
→ edit_file(src/controllers/AuthController.ts)
→ run_tests()
✓ All 24 tests passing.Deploy
$ prism deploy vercel
🚀 Deploying to vercel...
→ read_file(vercel.json)
→ run_command(vercel --prod)
✓ Deployed to https://myapp.vercel.app
Production URL: https://myapp.vercel.app
Preview URL: https://myapp-git-main.vercel.appSession Management
Sessions are saved automatically. Continue where you left off:
# Continue most recent session
prism chat --continue
prism c -c
# Resume specific session
prism chat --resume session-1706745600000
prism c -r session-1706745600000
# Sessions stored in ~/.prism/sessions/In-Session Commands
| Command | Description |
|---|---|
| /help | Show available commands |
| /clear | Clear conversation history |
| /save | Save current session |
| /context | Show detected project context |
| /exit | Exit (auto-saves session) |