Command-line interface for managing AI agents, spaces, offices, and tasks.
The CLI is the proof that offices work. If you can't teamday scan "ai agents" and see real data, the office isn't done.
# Install dependencies
bun install
# Run CLI locally
bun run bin/teamday.ts [command]
# Or link globally
bun link
teamday [command]No build step needed — Bun runs TypeScript directly.
# 1. Authenticate
teamday auth login # OAuth (opens browser)
# 2. Check connection
teamday auth status
# 3. Try an office command
teamday scan "ai agents, mcp servers" --time week
# 4. Or manage resources
teamday agents list
teamday spaces listteamday auth login # OAuth login (opens browser)
teamday auth logout # Clear credentials
teamday auth status # Show auth status + org
teamday auth set-key <token> # Set PAT token (td_ prefix)
teamday auth refresh # Refresh access tokenteamday agents list [options] # List agents (--status, --visibility, --tag)
teamday agents get <id> # Get agent details
teamday agents create [options] # Create agent (--name, --role, --system-prompt)
teamday agents update <id> [opts] # Update agent
teamday agents delete <id> # Archive agent
teamday agents exec <id> <msg> # Execute agent (--space, --session)
teamday agents chat <id> # Interactive chat sessionteamday spaces list [options] # List spaces
teamday spaces get <id> # Get space details
teamday spaces create [options] # Create space
teamday spaces delete <id> # Delete space
teamday spaces ls <id> [path] # List files in space
teamday spaces git <id> <args...> # Run git command in spaceteamday tasks list [options] # List tasks
teamday tasks get <id> # Get task details
teamday tasks create [options] # Create task
teamday tasks update <id> [opts] # Update task
teamday tasks complete <id> # Mark complete
teamday tasks cancel <id> # Cancel taskteamday executions list [options] # List executions
teamday executions get <id> # Get execution details
teamday executions cancel <id> # Cancel execution
teamday executions tree <id> # Show delegation tree
teamday executions logs <id> # View execution logsteamday characters list # List all characters
teamday characters get <id> # Get character detailsteamday skills list # List installed skills
teamday skills get <id> # Get skill detailsteamday mcps list # List MCP server connections
teamday mcps get <id> # Get MCP detailsteamday keys list # List API keys
teamday keys create [options] # Create new key
teamday keys revoke <id> # Revoke a keyteamday chat <agent-id> # Start interactive chat
teamday # Auto-detect agent and start chatting
teamday chat --list [spaceId] # List recent chats (optionally by space)
teamday chat --read <chatId> # Read a chat's message history
teamday chat --list-missions # List mission-spawned chats with run infoOffice-specific commands expose key office actions for testing and automation.
# Social Media Office — scan Reddit + HN for opportunities
teamday scan <topics> [options]
teamday scan "ai agents, mcp" --time week --limit 5
teamday scan "claude, anthropic" --platforms reddit --format jsonOptions:
--time <range>— Time range: day, week, month, year (default: week)--limit <n>— Results per platform per topic (default: 10)--platforms <list>— Platforms: reddit,hackernews (default: both)--format <format>— Output: table or json
teamday config list # Show all config
teamday config get <key> # Get value
teamday config set <key> <value> # Set value
teamday config unset <key> # Reset to default
teamday config reset # Reset allConfig file: ~/.teamday/config.json
{
"api_url": "https://cc.teamday.ai",
"format": "table",
"no_color": false,
"timeout": 300000,
"verbose": false
}# Local development
teamday config set api_url http://localhost:3000
teamday auth login
# Production
teamday config set api_url https://cc.teamday.ai
teamday auth loginAll list commands support --format:
teamday agents list # Table (default)
teamday agents list --format json # JSON (for piping)
teamday agents list --format yaml # YAML
teamday scan "ai agents" --format json # JSON scan resultsEvery office should expose its key action as a CLI command. See docs/office-patterns/cli-command.md for the full template.
Quick steps:
- Create
src/commands/{office}.tsexportingcreate{Office}Commands(apiClient, config) - Import + register in
src/index.ts - Use
orafor spinners,chalkfor colors,apiClient.get()for API calls - Support
--format jsonfor machine-readable output - Test:
teamday {command} --help
Reference: src/commands/scan.ts (Social Media scan command).
packages/cli/
├── bin/teamday.ts # Entry point (#!/usr/bin/env bun)
├── src/
│ ├── index.ts # Registers all commands via Commander.js
│ ├── commands/ # Command implementations
│ │ ├── auth.ts # Auth: login, logout, status, set-key
│ │ ├── agents.ts # Agent CRUD + exec + chat
│ │ ├── spaces.ts # Space CRUD + ls + git
│ │ ├── tasks.ts # Task CRUD + complete + cancel
│ │ ├── executions.ts # Execution tracking + tree + logs
│ │ ├── characters.ts # Character list + get
│ │ ├── skills.ts # Skill list + get
│ │ ├── mcps.ts # MCP server list + get
│ │ ├── keys.ts # API key management
│ │ ├── chat.ts # Interactive chat + default action
│ │ ├── scan.ts # Social Media scan (office command)
│ │ └── config.ts # Config management
│ ├── lib/ # Core libraries
│ │ ├── api-client.ts # HTTP client (GET/POST/PATCH/DELETE + SSE)
│ │ ├── auth-manager.ts # OAuth flow + PAT token management
│ │ ├── config-manager.ts # ~/.teamday/config.json persistence
│ │ ├── formatters.ts # Table, JSON, YAML output formatting
│ │ └── interactive.ts # Interactive chat mode (readline + SSE)
│ └── types/ # TypeScript definitions
└── tests/ # Unit + integration tests
- Runtime: Bun (no build step — runs TS directly)
- CLI Framework: Commander.js
- HTTP Client: Native fetch API
- Streaming: Server-Sent Events (SSE) via eventsource-parser
- Auth: OAuth 2.0 flow + PAT tokens (keytar for secure storage)
- Output: cli-table3, js-yaml, chalk, ora
- Interactive: Inquirer.js
# Auth issues
teamday auth status # Check what's connected
teamday auth logout && teamday auth login # Re-authenticate
# Connection issues
teamday config get api_url # Check target URL
teamday config set api_url http://localhost:3000 # Switch to local
# Verbose output for debugging
teamday --verbose agents list# Unit tests
bun run test:unit
# Integration tests (local)
bun run test:integration:local
# Integration tests (production)
bun run test:integration:cc
# Character tests
bun run test:characters