dealgo
v1.2.0
Published
CLI for DeAlgo - Git for AI Decisions. Manage AI decisions, verify cryptographic chains, and control API keys from the terminal.
Maintainers
Readme
dealgo - DeAlgo CLI
Git for AI Decisions - Command-line interface for managing DeAlgo decisions, agents, and API keys.
Installation
Global Install (Recommended)
npm install -g dealgoFrom Source
cd cli
npm install
npm run build
npm linkDirect Run (npx)
npx dealgo statusQuick Start
1. Configure API Access
# Set API key (via environment variable - most secure)
export DEALGO_API_KEY=dg_live_your_key_here
# Or store in config file (plaintext warning shown)
dealgo config set apiKey dg_live_your_key_here
# Set custom API URL (optional)
dealgo config set apiUrl https://dealgo-saas.vercel.app2. Verify Connection
dealgo status3. Log Your First Decision
dealgo decisions log \
--verdict APPROVE \
--score 85 \
--rationale "Feature request approved after safety review"Commands
System Status
dealgo status # Check system health and tenant usage
dealgo status --json # JSON output for scriptingDecision Management
# Log a decision
dealgo decisions log \
--verdict APPROVE \
--score 90 \
--rationale "Safe to proceed" \
--agentId agent_123 # Optional: link to specific agent
# List recent decisions
dealgo decisions list --limit 20
# List in JSON format
dealgo decisions list --jsonSupported Verdicts: APPROVE, DENY, DELAY, FOUNDER_REQUIRED
Chain Verification
dealgo verify-chain # Verify cryptographic chain integrity
dealgo verify-chain --json # JSON outputAPI Key Management
# List API keys
dealgo keys list
# Create new key with specific scopes
dealgo keys create \
--name "Production Key" \
--scopes "decisions:write,decisions:read,ops:read"
# Full access key (all scopes)
dealgo keys create \
--name "Admin Key" \
--scopes "decisions:write,decisions:read,ops:read,keys:manage"Available Scopes:
decisions:write- Log decisionsdecisions:read- Read decisionsops:read- View system statuskeys:manage- Manage API keysagents:read- List and view agentsagents:write- Create and update agents
Agent Management
# List all agents
dealgo agents list
# Create new agent
dealgo agents create \
--name "Production Bot" \
--description "Main production AI agent"
# Update agent
dealgo agents update <agent-id> \
--name "Updated Name" \
--status "paused"
# Link decisions to agents
dealgo decisions log \
--agent <agent-id> \
--verdict APPROVE \
--score 90 \
--rationale "Safe to proceed"
# Filter decisions by agent
dealgo decisions list --agent <agent-id>Configuration
# Set values
dealgo config set apiUrl https://dealgo-saas.vercel.app
dealgo config set apiKey dg_live_...
# List all profiles
dealgo config list
# Switch profiles
dealgo config use production
dealgo config use localProfiles
DeAlgo CLI supports multiple environment profiles:
# Use production (default)
dealgo status
# Use local development
dealgo --profile local status
# Create custom profile
dealgo --profile staging config set apiUrl https://staging.dealgo.com
dealgo --profile staging config set apiKey dg_test_...
dealgo --profile staging statusConfig Location: ~/.dealgo/config.json
Environment Variables
Environment variables override config file values:
export DEALGO_API_URL=https://dealgo-saas.vercel.app
export DEALGO_API_KEY=dg_live_your_key_here
dealgo status # Uses env varsExamples
E2E Governance Loop (Terminal Only)
# 1. Check system health
dealgo status
# 2. Log a decision
dealgo decisions log \
--verdict APPROVE \
--score 92 \
--rationale "Code review passed, security scan clean"
# 3. Verify decision appears in log
dealgo decisions list --limit 5
# 4. Verify cryptographic chain
dealgo verify-chainCI/CD Integration (GitHub Actions)
name: Log Deployment Decision
on: [deployment]
jobs:
log:
runs-on: ubuntu-latest
steps:
- name: Log to DeAlgo
env:
DEALGO_API_KEY: ${{ secrets.DEALGO_API_KEY }}
run: |
npx dealgo decisions log \
--verdict APPROVE \
--score 95 \
--rationale "Deployment to production approved" \
--jsonJSON Output for Scripts
# Get status as JSON
STATUS=$(dealgo status --json)
echo $STATUS | jq '.tenant.currentMonthUsage'
# Log decision and capture ID
RESULT=$(dealgo decisions log \
--verdict APPROVE \
--score 90 \
--rationale "Test" \
--json)
DECISION_ID=$(echo $RESULT | jq -r '.data.id')
echo "Logged decision: $DECISION_ID"Security Best Practices
✅ Recommended
- Store API key in
DEALGO_API_KEYenvironment variable - Use OS-level secret management (AWS Secrets Manager, 1Password, etc.)
- Create scoped keys (minimum required permissions)
- Rotate keys regularly
⚠️ Avoid
- Committing
~/.dealgo/config.jsonto git - Sharing API keys in plain text
- Using
*scope unless necessary
Troubleshooting
Missing API Key
✗ Error: Missing API key
Set DEALGO_API_KEY environment variable or run:
dealgo config set apiKey dg_live_...Solution: Configure API key via environment variable or config file.
Invalid or Revoked Key
✗ Error: Invalid or revoked API key (401)Solution: Create a new key via web dashboard or dealgo keys create.
Insufficient Scope
✗ Error: Insufficient scope (403)
Your key needs: ops:readSolution: Create new key with required scopes:
dealgo keys create --scopes "decisions:write,decisions:read,ops:read"Development
Build from Source
cd cli
npm install
npm run buildLocal Testing
npm run dev -- status
npm run dev -- decisions log --verdict APPROVE --score 90 --rationale "Test"Link for Global Use
npm link
dealgo statusLicense
Apache-2.0
Support
- Docs: https://dealgo-saas.vercel.app/developers
- GitHub: https://github.com/Jtjr86/ssi-protocol
- Issues: https://github.com/Jtjr86/ssi-protocol/issues
ssictl health ssictl logs --follow
## Development
```bash
# Clone repo
git clone https://github.com/Jtjr86/ssi-protocol.git
cd ssi-protocol/cli
# Install dependencies
npm install
# Run locally
npm run dev health
# Build
npm run buildDocumentation
Full docs at ssi-protocol.org
