DevTeam CLI

Command-line interface for DevTeam.ai - run AI agents locally and integrate with your development workflow.

Installation

via npm

bash
npm install -g @devteam/cli

via Homebrew (macOS/Linux)

bash
brew tap devteam-ai/tap
brew install devteam

via Direct Download

Download pre-built binaries from GitHub Releases:

  • macOS: devteam-darwin-arm64 or devteam-darwin-x64
  • Linux: devteam-linux-x64
  • Windows: devteam-windows-x64.exe

Authentication

Interactive Login

bash
devteam auth login
# Opens browser for OAuth authentication
# Token is stored securely in your system keychain

API Key Authentication

bash
export DEVTEAM_API_KEY=your_api_key_here
# Or set in ~/.devteamrc
echo "api_key=your_api_key_here" > ~/.devteamrc

Check Authentication Status

bash
devteam auth whoami
# Output:
# Authenticated as: user@example.com
# Organization: Acme Inc
# Plan: Pro (100 tasks/month)

Core Commands

devteam review
Run AI code review on changed files
bash
# Review all changed files
devteam review
# Review specific files
devteam review --files "src/**/*.ts"
# Review with specific agent
devteam review --agent security-analyst
devteam implement
Auto-implement features from issue descriptions
bash
# Implement from GitHub issue
devteam implement --issue 123
# Implement from description
devteam implement --description "Add dark mode toggle to settings"
# Create branch and PR automatically
devteam implement --issue 123 --create-pr
devteam test
Generate tests for your code
bash
# Generate tests for a file
devteam test --file src/utils.ts
# Generate tests for entire directory
devteam test --directory src/components
# Generate with specific framework
devteam test --file src/utils.ts --framework vitest
devteam plan
AI-powered sprint planning
bash
# Plan next sprint from backlog
devteam plan --milestone v2.0
# Generate task breakdown
devteam plan --epic "User Authentication"
# Export to Linear/Jira
devteam plan --milestone v2.0 --export linear

Advanced Commands

Agent Management

bash
# List available agent roles
devteam agents list
# Spawn an agent for a project
devteam agents spawn --project my-app --role frontend-specialist
# Chat with an agent
devteam agents chat --agent ag_12345
# View agent status
devteam agents status --project my-app

Project Management

bash
# Create a new project
devteam projects create --name "My App" --description "A cool app"
# List all projects
devteam projects list
# View project details
devteam projects show --id proj_12345
# Archive a project
devteam projects archive --id proj_12345

Knowledge Base

bash
# Search institutional knowledge
devteam knowledge search "react query pagination"
# Store a code pattern
devteam knowledge store --type code-pattern \
--title "Optimistic Updates Pattern" \
--file pattern.md
# Export knowledge for sharing
devteam knowledge export --output knowledge.json

Configuration

Configure CLI behavior with ~/.devteamrc or project-level .devteamrc:

ini
# API Configuration
api_key=dtk_xxxxxxxxxxxxx
api_endpoint=https://devteam-api.finhub.workers.dev/graphql
# Default Settings
default_project=proj_12345
default_agent_role=code-reviewer
# Output Preferences
output_format=json # json, table, or markdown
color=true
verbose=false
# Git Integration
auto_commit=true
auto_push=false
branch_prefix=devteam/
# Review Settings
review_auto_fix=false
review_inline_comments=true
review_severity_threshold=medium

CLI Flags Reference

Global Flags

FlagDescription
--api-keyOverride API key from config
--projectSpecify project ID or name
--outputOutput format (json, table, markdown)
--verbose, -vEnable verbose logging
--quiet, -qSuppress output
--help, -hShow help

Review Command Flags

FlagDescription
--filesGlob pattern for files to review
--agentSpecific agent role to use
--auto-fixAutomatically apply suggested fixes
--severityMin severity (info, low, medium, high, critical)
--formatOutput format (terminal, github, gitlab)

Implement Command Flags

FlagDescription
--issueGitHub issue number
--descriptionFeature description text
--branchBranch name for changes
--create-prCreate PR after implementation
--agentSpecific agent to use

Integration Examples

Git Hooks

Run review on pre-commit:

bash
# .git/hooks/pre-commit
#!/bin/bash
devteam review --files $(git diff --cached --name-only)
if [ $? -ne 0 ]; then
echo "Code review failed. Fix issues or use --no-verify to skip."
exit 1
fi

CI/CD Integration

yaml
# GitLab CI
code_review:
stage: test
script:
- npm install -g @devteam/cli
- devteam review --output gitlab
only:
- merge_requests
# CircleCI
version: 2.1
jobs:
review:
docker:
- image: cimg/node:18.0
steps:
- checkout
- run: npm install -g @devteam/cli
- run: devteam review --output json > review.json
- store_artifacts:
path: review.json

VSCode Integration

Add to .vscode/tasks.json:

json
{
"version": "2.0.0",
"tasks": [
{
"label": "DevTeam: Review Current File",
"type": "shell",
"command": "devteam review --files ${file}",
"problemMatcher": []
},
{
"label": "DevTeam: Generate Tests",
"type": "shell",
"command": "devteam test --file ${file}",
"problemMatcher": []
}
]
}

Troubleshooting

Command Not Found

bash
# Check installation
which devteam
# Reinstall if needed
npm install -g @devteam/cli --force
# Or add to PATH
export PATH="$PATH:/usr/local/bin"

Authentication Errors

bash
# Verify API key
devteam auth whoami
# Re-authenticate
devteam auth logout
devteam auth login
# Check API key permissions
devteam auth check-scopes

Enable Debug Mode

bash
# Set debug environment variable
export DEVTEAM_DEBUG=true
# Or use verbose flag
devteam review --verbose

Next Steps