@continuedev/continuous-ai
v1.0.3
Published
CLI tool for interacting with Continue agent checks on pull requests
Readme
@continuedev/continuous-ai
CLI tool for interacting with Continue agent checks on pull requests.
Installation
npm install -g @continuedev/continuous-aiUsage
Setup
Get your API key from hub.continue.dev/settings/api-keys and set it:
export CONTINUE_API_KEY="con-xxx"Or pass it with the --token flag to each command.
Commands
cai status <pr-url>
List all agent checks for a pull request with their current status.
cai status https://github.com/owner/repo/pull/123Options:
--org <slug>- Organization context--token <key>- API key (or use CONTINUE_API_KEY env var)--format json|table- Output format (default: table)
cai wait <pr-url>
Block until all agent checks complete or fail.
cai wait https://github.com/owner/repo/pull/123Options:
--org <slug>- Organization context--token <key>- API key--timeout <seconds>- Max wait time (default: 600)--fail-fast- Exit immediately on first failure--format json|table- Output format
cai logs <session-id>
View logs/state for a specific agent session.
cai logs A0042Options:
--org <slug>- Organization context--token <key>- API key--tail <lines>- Show last N lines (default: all)
cai diff <session-id>
View code diff for an agent session.
cai diff A0042Options:
--org <slug>- Organization context--token <key>- API key--format unified|json- Output format (default: unified)
cai approve <pr-url>
Approve changes and optionally merge the PR.
cai approve https://github.com/owner/repo/pull/123 --mergeOptions:
--org <slug>- Organization context--token <key>- API key--merge- Also merge the PR (default: just mark as ready)--merge-method squash|merge|rebase- Merge method (default: squash)
cai reject <pr-url>
Reject changes and close the PR.
cai reject https://github.com/owner/repo/pull/123 --reason "Does not meet requirements"Options:
--org <slug>- Organization context--token <key>- API key--reason <text>- Optional rejection reason
Exit Codes
0- Success1- General error (API error, not found, etc.)2- No sessions found for PR124- Timeout reached
Configuration
You can save your API key in ~/.continue/cli-config.json:
{
"apiKey": "con-xxx",
"apiUrl": "https://api.continue.dev"
}Using Staging Environment
For internal testing with the staging environment, configure the staging API URL:
{
"apiKey": "con-xxx",
"apiUrl": "https://api.continue-stage.tools"
}Get your staging API key from hub.continue-stage.tools/settings/api-keys.
You can also use environment variables:
export CONTINUE_API_KEY="con-your-staging-key"
export CONTINUE_API_URL="https://api.continue-stage.tools"Example Workflow
#!/bin/bash
# Wait for agents, then approve and merge if successful
export CONTINUE_API_KEY="con-xxx"
PR_URL="https://github.com/owner/repo/pull/123"
# Wait for completion with 5 minute timeout
cai wait "$PR_URL" --timeout 300 --fail-fast
# If successful, approve and merge
if [ $? -eq 0 ]; then
echo "All agents passed! Merging PR..."
cai approve "$PR_URL" --merge --merge-method squash
else
echo "Agents failed. Checking logs..."
# Get first failed session ID from status output
SESSION_ID=$(cai status "$PR_URL" --format json | jq -r '.sessions[] | select(.status == "failed") | .id' | head -1)
cai logs "$SESSION_ID"
fiLicense
Apache-2.0
