@deepractice-ai/agent-cli
v0.4.14
Published
CLI for running Deepractice AI Agent
Maintainers
Readme
@deepractice-ai/agent-cli
CLI tool for running Deepractice AI Agent - a visual AI agent interface powered by Claude.
Quick Start
# Install globally
npm install -g @deepractice-ai/agent-cli
# Run the server
agentx http --anthropic-api-key YOUR_API_KEYThe server will start on http://0.0.0.0:5200 by default.
Installation
Global Installation (Recommended)
npm install -g @deepractice-ai/agent-cliUsing npx (No Installation)
npx @deepractice-ai/agent-cli agentx http --anthropic-api-key YOUR_API_KEYLocal Development
# Clone the repository
git clone https://github.com/Deepractice/Agent.git
cd Agent
# Install dependencies
pnpm install
# Build agent-cli
pnpm --filter @deepractice-ai/agent-cli build
# Run locally
node apps/agent-cli/dist/bin/agent-cli.js http --anthropic-api-key YOUR_API_KEYUsage
Basic Command
agentx http [options]Options
| Option | Description | Default |
| ---------------------------- | ---------------------------- | --------------------------- |
| --host <host> | Host to bind to | 0.0.0.0 |
| --port <port> | Port to listen on | 5200 |
| --project <path> | Project directory path | Current directory |
| --anthropic-api-key <key> | Anthropic API key (required) | - |
| --anthropic-base-url <url> | Anthropic API base URL | https://api.anthropic.com |
| --node-env <env> | Node environment | production |
Examples
Basic Usage
# Start with API key
agentx http --anthropic-api-key sk-ant-xxxxx
# Custom port
agentx http --port 8080 --anthropic-api-key sk-ant-xxxxx
# Custom project directory
agentx http --project /path/to/project --anthropic-api-key sk-ant-xxxxxUsing Environment Variables
Instead of passing options via CLI, you can use environment variables:
export ANTHROPIC_API_KEY=sk-ant-xxxxx
export PORT=8080
export PROJECT_PATH=/path/to/project
agentx httpNote: The CLI does not automatically load .env files. You must either:
- Set environment variables manually (as shown above)
- Pass options via command-line flags
- Use a tool like
dotenv-clito load env files
Docker Usage
docker run -d \
-p 5200:5200 \
-v /local/project:/project \
-e ANTHROPIC_API_KEY=sk-ant-xxxxx \
deepracticexs/agent:latestConfiguration
The CLI sets up environment variables that are used by the underlying agent-service:
NODE_ENV: Node environment modePORT: Server portPROJECT_PATH: Working directory for the agentANTHROPIC_API_KEY: Your Anthropic API key (required)ANTHROPIC_BASE_URL: Custom API endpoint (optional)
Architecture
The agentx CLI is a lightweight wrapper that:
- Parses command-line arguments
- Sets up environment variables
- Dynamically loads and starts the agent-service
This design allows for:
- Simple deployment (
npm install -g) - Easy configuration via CLI or environment variables
- Clean separation between CLI interface and server logic
Environment Priority
Configuration is loaded in the following priority (highest to lowest):
- CLI options (e.g.,
--port 8080) - Environment variables (e.g.,
export PORT=8080)
Note: The CLI does not load .env files automatically. Use environment variables or CLI options.
Requirements
- Node.js >= 20.0.0
- Anthropic API key
Troubleshooting
Port Already in Use
# Kill process on port 5200
lsof -ti:5200 | xargs kill -9
# Or use a different port
agentx http --port 8080Permission Denied (PROJECT_PATH)
Make sure the specified project path is writable:
# Use a directory in your home folder
agentx http --project ~/my-projectAPI Key Issues
# Verify your API key is set
echo $ANTHROPIC_API_KEY
# Or pass it directly
agentx http --anthropic-api-key sk-ant-xxxxxDevelopment
Build
pnpm buildWatch Mode
pnpm devTesting
# Test the built CLI
node dist/bin/agent-cli.js http --helpRelated Projects
- Agent - Full monorepo
- @deepractice-ai/agent-service - Backend service
- @deepractice-ai/agent-web - Frontend UI
License
MIT
Support
Made with ❤️ by Deepractice Team
