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

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

Interactive browser-based authentication with automatic token management:

teamday auth login

What happens:

  1. CLI generates a secure authorization code
  2. Opens your browser to TeamDay login page
  3. You click "Authorize CLI"
  4. CLI receives OAuth tokens automatically
  5. 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 access
  • organization - All org members can access
  • public - 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 description
  • description - Optional, detailed context
  • priority - low|medium|high|urgent (default: medium)
  • assignedTo - Agent ID to assign task to
  • spaceId - 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 started
  • in_progress - Being worked on
  • completed - Finished
  • cancelled - 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:

CommandDescription
teamday auth loginOAuth browser login
teamday auth logoutClear stored credentials
teamday auth statusShow authentication status
teamday auth refreshRefresh access token
teamday auth set-key <token>Set Personal Access Token

agents

Agent management:

CommandDescription
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:

CommandDescription
teamday spaces listList 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:

CommandDescription
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:

CommandDescription
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:

CommandDescription
teamday config listShow 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 resetReset all settings

Available keys:

  • api_url - API endpoint URL
  • format - Output format (table|json|yaml)
  • no_color - Disable colors (true|false)
  • timeout - Request timeout in milliseconds
  • verbose - 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

Support