TeamDay CLI
The TeamDay CLI is a powerful command-line interface for managing agents, executing tasks, tracking work, and automating workflows directly from your terminal.
Table of Contents
- Installation
- Authentication
- Managing Agents
- Working with Spaces
- Task Management
- Execution Tracking
- Configuration
- Automation
- Command Reference
Installation
Prerequisites
- Node.js 18+ or Bun 1.0+
- A TeamDay account at teamday.ai
Install from Source (Currently)
cd /path/to/teamday/packages/cli
bun install
bun link
Verify installation:
teamday --version
Update CLI
cd /path/to/teamday/packages/cli
git pull
bun install
Authentication
OAuth Login (Recommended)
Interactive browser-based authentication with automatic token management:
teamday auth login
What happens:
- CLI generates a secure authorization code
- Opens your browser to TeamDay login page
- You click "Authorize CLI"
- CLI receives OAuth tokens automatically
- Tokens saved securely in
~/.teamday/
First-time users: If you don't have an organization yet, one will be created automatically during CLI authorization.
Check Auth Status
teamday auth status
Output:
β Authenticated
Method: oauth
User ID: abc123xyz
Organization: org_456def
Expires: in 12 minutes
Refresh Token
OAuth tokens expire after 15 minutes. Refresh manually:
teamday auth refresh
Note: Refresh tokens last 90 days. After that, run teamday auth login again.
Logout
Clear stored credentials:
teamday auth logout
Personal Access Token (Alternative)
For automation and CI/CD, use PATs instead of OAuth:
teamday auth set-key "td_your_token_here"
Or use environment variable:
export TEAMDAY_API_TOKEN="td_your_token_here"
See API Keys Guide for creating PATs in the web app.
Managing Agents
List All Agents
teamday agents list
Output:
ββββββββββββββββββββββββ¬βββββββββββββββββ¬ββββββββββββββββ¬βββββββββββββββββββββ¬βββββββββββββ
β id β name β role β systemPrompt β visibility β
ββββββββββββββββββββββββΌβββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββΌβββββββββββββ€
β char_abc123 β Joe β Assistant β You are helpful... β private β
β char_def456 β Code Reviewer β Developer β Review code for... β private β
ββββββββββββββββββββββββ΄βββββββββββββββββ΄ββββββββββββββββ΄βββββββββββββββββββββ΄βββββββββββββ
Total: 2 agent(s)
Output formats:
# Table (default)
teamday agents list
# JSON for scripting
teamday agents list --format json
# YAML for readability
teamday agents list --format yaml
Get Agent Details
teamday agents get char_abc123
Shows complete agent configuration including:
- System prompt
- Model configuration
- Advanced tools enabled
- Creation/update timestamps
- Avatar and color settings
Create Agent
Basic creation:
teamday agents create \
--name "My Assistant" \
--role "Helper" \
--system-prompt "You are a helpful AI assistant"
Advanced options:
teamday agents create \
--name "Code Reviewer" \
--role "Senior Developer" \
--system-prompt "$(cat prompts/code-review.txt)" \
--model "claude-3-5-sonnet-20241022" \
--visibility private
Output:
β
Agent created:
ID: char_xyz789
Name: Code Reviewer
Status: active
Update Agent
teamday agents update char_abc123 \
--name "Updated Name" \
--role "New Role"
Update system prompt from file:
teamday agents update char_abc123 \
--system-prompt "$(cat new-prompt.txt)"
Delete (Archive) Agent
teamday agents delete char_abc123
Output:
β
Agent archived
Note: Agent is archived, not permanently deleted
Archived agents:
- No longer appear in listings
- Cannot be executed
- Execution history is preserved
- Can be restored in the web app
Execute Agent
teamday agents exec char_abc123 "What is 2+2?"
With streaming (default):
teamday agents exec char_abc123 \
"Review the authentication code" \
--space s-project123 \
--stream
Non-streaming:
teamday agents exec char_abc123 \
"Quick question" \
--no-stream
Options:
--space <id>- Execute in workspace context--session <id>- Continue existing conversation--stream/--no-stream- Real-time vs batch--timeout <ms>- Max execution time (default: 300000)
Interactive Chat
Start a conversation with an agent:
teamday agents chat char_abc123
Features:
- Multi-turn conversations
- Streaming responses
- Session persistence
- Exit with Ctrl+C or type
exit
Working with Spaces
Spaces are workspaces where agents can access files, git repositories, and collaborate on projects.
List Spaces
teamday spaces list
Output:
ββββββββββββββββββββββββ¬βββββββββββββββββ¬ββββββββββββββ¬βββββββββββββ
β id β name β visibility β members β
ββββββββββββββββββββββββΌβββββββββββββββββΌββββββββββββββΌβββββββββββββ€
β s-abc123 β Backend API β private β user_xyz β
β s-def456 β Marketing Site β organizationβ user_xyz β
ββββββββββββββββββββββββ΄βββββββββββββββββ΄ββββββββββββββ΄βββββββββββββ
Total: 2 space(s)
Create Space
Empty workspace:
teamday spaces create \
--name "My Project" \
--description "Backend API development" \
--visibility private \
--type empty
Visibility options:
private- Only you can accessorganization- All org members can accesspublic- Anyone with link can view
Output:
β
Space created:
ID: s-new123
Name: My Project
Get Space Details
teamday spaces get s-abc123
Shows:
- Space metadata
- Gradient colors (for UI)
- Owner and members
- Creation/update timestamps
Delete Space
teamday spaces delete s-abc123
Note: Only space owners can delete. Space is archived (soft delete), not permanently removed.
Task Management
Tasks are work items that agents create to delegate work or track multi-step processes.
What Are Tasks?
Tasks in TeamDay are created by agents to:
- Delegate work to other agents
- Track multi-step processes
- Organize complex workflows
- Maintain accountability
Example: An agent building a feature might create tasks:
- "Review authentication code" β Assigned to Code Review Agent
- "Write unit tests" β Assigned to Test Agent
- "Update documentation" β Assigned to Docs Agent
List Tasks
teamday tasks list
Output:
ββββββββββββββββββββββ¬βββββββββββββββββββββ¬ββββββββββββββ¬βββββββββββ
β id β title β status β priority β
ββββββββββββββββββββββΌβββββββββββββββββββββΌββββββββββββββΌβββββββββββ€
β task_123 β Review PR #456 β pending β high β
β task_124 β Update docs β in_progress β medium β
ββββββββββββββββββββββ΄βββββββββββββββββββββ΄ββββββββββββββ΄βββββββββββ
Total: 2 task(s)
Filter by status:
teamday tasks list --status pending
teamday tasks list --status in_progress
teamday tasks list --status completed
Filter by assignee:
teamday tasks list --assigned-to char_abc123
Filter by space:
teamday tasks list --space s-project123
Create Task
teamday tasks create \
--title "Review Q4 Report" \
--description "Analyze Q4 sales data and create summary" \
--priority high
With assignment:
teamday tasks create \
--title "Code Review" \
--description "Review PR #123" \
--assigned-to char_reviewer \
--priority medium \
--space s-codebase
Task properties:
title- Required, short descriptiondescription- Optional, detailed contextpriority- low|medium|high|urgent (default: medium)assignedTo- Agent ID to assign task tospaceId- Space context for the task
Output:
β
Task created:
ID: task_456
Title: Review Q4 Report
Status: pending
Get Task Details
teamday tasks get task_123
Shows full task information including creation date, completion date (if completed), and all metadata.
Update Task
teamday tasks update task_123 \
--status in_progress \
--assigned-to char_different
Status options:
pending- Not startedin_progress- Being worked oncompleted- Finishedcancelled- Abandoned
Complete Task
Quick command to mark task as done:
teamday tasks complete task_123
Cancel Task
teamday tasks cancel task_123
Execution Tracking
Track agent executions, view history, and monitor running agents.
List Executions
teamday executions list
Output shows:
- Execution ID
- Agent ID
- Message/prompt
- Status (running, completed, failed, cancelled)
- Duration
- Timestamps
Filter by status:
teamday executions list --status running
teamday executions list --status completed
Get Execution Details
teamday executions get exec_abc123
Shows:
- Full execution metadata
- Chat/session IDs
- Delegation depth (for multi-agent workflows)
- Start and completion times
Cancel Execution
Stop a running agent:
teamday executions cancel exec_abc123
Configuration
View Configuration
# All settings
teamday config list
Output:
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β api_url β http://localhost:3000 β
ββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββ€
β format β table β
ββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββ€
β no_color β false β
ββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββ€
β timeout β 300000 β
ββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββ€
β verbose β false β
ββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββ
Config file: /Users/you/.teamday/config.json
Get specific value:
teamday config get format
Update Settings
# Output format
teamday config set format json # or: table, yaml
# API URL (for self-hosted)
teamday config set api_url https://your-instance.com
# Request timeout (milliseconds)
teamday config set timeout 600000 # 10 minutes
# Verbose output
teamday config set verbose true
Reset Settings
# Reset specific setting
teamday config unset format
# Reset all to defaults
teamday config reset
Environment Variables
Override config with environment variables:
export TEAMDAY_API_URL=http://localhost:3000
export TEAMDAY_API_TOKEN=td_your_token
export TEAMDAY_FORMAT=json
export TEAMDAY_NO_COLOR=1
export TEAMDAY_TIMEOUT=600000
export TEAMDAY_VERBOSE=true
Environment variables take precedence over config file settings.
Automation
Shell Scripts
Daily task summary:
#!/bin/bash
# daily-tasks.sh
echo "Tasks Summary - $(date +%Y-%m-%d)"
echo "================================"
echo -e "\nπ Pending Tasks:"
teamday tasks list --status pending --format json | \
jq -r '.[] | "\(.title) (Priority: \(.priority))"'
echo -e "\nβ
Completed Today:"
teamday tasks list --status completed --format json | \
jq -r '.[] | "\(.title)"'
Make executable and run:
chmod +x daily-tasks.sh
./daily-tasks.sh
Scheduled with cron:
# Send daily email summary at 9 AM
0 9 * * * /path/to/daily-tasks.sh | mail -s "Daily Tasks" [email protected]
CI/CD Integration
GitHub Actions:
name: Agent Task Check
on: [push]
jobs:
check-tasks:
runs-on: ubuntu-latest
steps:
- name: Install TeamDay CLI
run: |
cd /tmp
git clone https://github.com/yourorg/teamday.git
cd teamday/packages/cli
bun install
bun link
- name: Check pending tasks
env:
TEAMDAY_API_TOKEN: ${{ secrets.TEAMDAY_TOKEN }}
run: |
pending=$(teamday tasks list --status pending --format json | jq 'length')
echo "Pending tasks: $pending"
if [ $pending -gt 10 ]; then
echo "β οΈ Warning: More than 10 pending tasks!"
fi
Batch Operations
Create multiple tasks from CSV:
#!/bin/bash
# import-tasks.sh
while IFS=, read -r title description priority assignee; do
teamday tasks create \
--title "$title" \
--description "$description" \
--priority "$priority" \
--assigned-to "$assignee"
done < tasks.csv
Export data for analysis:
#!/bin/bash
# export-execution-data.sh
# Get all executions as JSON
teamday executions list --format json > executions.json
# Analyze with jq
cat executions.json | jq '
group_by(.status) |
map({status: .[0].status, count: length})
'
Command Reference
Global Options
Available on all commands:
--help, -h Show help
--version, -V Show version
--format <format> Output format (table|json|yaml)
--api-url <url> Override API endpoint
--verbose Show detailed output
--no-color Disable colored output
auth
Authentication commands:
| Command | Description |
|---|---|
teamday auth login | OAuth browser login |
teamday auth logout | Clear stored credentials |
teamday auth status | Show authentication status |
teamday auth refresh | Refresh access token |
teamday auth set-key <token> | Set Personal Access Token |
agents
Agent management:
| Command | Description |
|---|---|
teamday agents list [options] | List all agents |
teamday agents get <id> | Get agent details |
teamday agents create [options] | Create new agent |
teamday agents update <id> [options] | Update agent |
teamday agents delete <id> | Archive agent |
teamday agents exec <id> <message> | Execute agent with message |
teamday agents chat <id> | Interactive chat session |
List options:
--status <active|archived>--visibility <private|organization|public>--tag <tag>--format <table|json|yaml>
Create options:
--name <name>(required)--role <role>--system-prompt <prompt>(required)--model <model>(default: claude-3-5-sonnet-20241022)--visibility <private|organization|public>(default: private)
Exec options:
--space <id>- Execute in workspace--session <id>- Continue session--stream/--no-stream- Streaming mode--timeout <ms>- Max execution time
spaces
Workspace management:
| Command | Description |
|---|---|
teamday spaces list | List all spaces |
teamday spaces get <id> | Get space details |
teamday spaces create [options] | Create new space |
teamday spaces delete <id> | Archive space |
Create options:
--name <name>(required)--description <desc>--visibility <private|organization|public>(default: private)--type <empty|git|starterKit>(default: empty)
tasks
Task management:
| Command | Description |
|---|---|
teamday tasks list [options] | List all tasks |
teamday tasks get <id> | Get task details |
teamday tasks create [options] | Create new task |
teamday tasks update <id> [options] | Update task |
teamday tasks complete <id> | Mark task as completed |
teamday tasks cancel <id> | Cancel task |
List options:
--status <pending|in_progress|completed|cancelled>--assigned-to <agent-id>--space <space-id>--priority <low|medium|high|urgent>
Create options:
--title <title>(required)--description <desc>--assigned-to <agent-id>--priority <low|medium|high|urgent>(default: medium)--space <space-id>
executions
Execution tracking:
| Command | Description |
|---|---|
teamday executions list [options] | List executions |
teamday executions get <id> | Get execution details |
teamday executions cancel <id> | Cancel running execution |
List options:
--status <pending|running|completed|failed|cancelled>--agent <agent-id>
config
Configuration management:
| Command | Description |
|---|---|
teamday config list | Show all settings |
teamday config get <key> | Get specific value |
teamday config set <key> <value> | Update setting |
teamday config unset <key> | Reset to default |
teamday config reset | Reset all settings |
Available keys:
api_url- API endpoint URLformat- Output format (table|json|yaml)no_color- Disable colors (true|false)timeout- Request timeout in millisecondsverbose- Verbose output (true|false)
Tips & Tricks
JSON Output for Scripting
# Get agent ID programmatically
agent_id=$(teamday agents list --format json | jq -r '.[0].id')
# Count pending tasks
pending=$(teamday tasks list --status pending --format json | jq 'length')
echo "Pending tasks: $pending"
# Extract execution IDs
teamday executions list --format json | jq -r '.[].id' | \
while read exec_id; do
echo "Processing: $exec_id"
done
Combining Commands
# Create task for each pending execution
teamday executions list --status running --format json | \
jq -r '.[] | "\(.id),\(.message)"' | \
while IFS=, read -r exec_id message; do
teamday tasks create \
--title "Review execution $exec_id" \
--description "$message"
done
Debugging
# Verbose output
teamday --verbose agents list
# See full config
teamday config list
# Check authentication
teamday auth status
# Test connection
teamday --api-url http://localhost:3000 agents list
Troubleshooting
Authentication Issues
Problem: 401 Unauthorized errors
Solutions:
# Check auth status
teamday auth status
# Refresh token
teamday auth refresh
# Re-authenticate
teamday auth logout
teamday auth login
Connection Errors
Problem: Cannot connect to API
Solutions:
# Check API URL
teamday config get api_url
# Update if needed
teamday config set api_url http://localhost:3000
# Test with explicit URL
teamday --api-url http://localhost:3000 agents list
Agent Execution Errors
Problem: 501 Server Error when executing agents
Possible causes:
- No Anthropic API key configured (user, org, or server level)
- Authentication tier selection issue
Solution: Ensure you have an API key configured:
# Check auth status
teamday auth status
# Option 1: Add API key in web app (Settings β Integrations)
# Option 2: Contact admin to configure server API key
Organization Not Found
Problem: organizationId: undefined on first login
Solution: The CLI automatically creates a personal organization during first OAuth login. If this fails, contact support.
Next Steps
- Learn more about agents: Understanding Agents
- Set up automation: See Automation section above
- API Reference: API Documentation
- Web Interface: Use the CLI alongside teamday.ai
Support
- Documentation: teamday.ai/docs
- Issues: GitHub Issues
- Community: Discord