Docs · guides

CLI Tool

Current guide to the TeamDay CLI for managing agents, files and folders, projects, repositories, MCP servers, secrets, chats, jobs, generated media, resources, and scheduled missions.

The TeamDay CLI lets operator agents and humans configure TeamDay from a terminal. Use it for local setup, production operations, files and folders, MCP server declarations, service-token automation, and scheduled missions.

The repo-local command is the most reliable form:

bun run apps/cli/src/index.ts --help

If you have linked or installed the CLI globally, replace bun run apps/cli/src/index.ts with teamday.

For copy-pasteable agent workflows inside a cloned repo, define a shell alias:

alias teamday-local='bun run apps/cli/src/index.ts'
teamday-local --help

Most read commands support --json. Operator agents should prefer --json for inspection and scripting. Use group help to discover a command family before choosing a leaf command:

teamday files --help
teamday repositories --help
teamday missions --help
teamday mcp setup --help
teamday resources --help

Install

git clone https://github.com/TeamDay-AI/teamday.git
cd teamday
bun install
bun run apps/cli/src/index.ts --help

Authentication

The CLI target lives in ~/.teamday/config.json. Always confirm the active server and organization before changing production data.

teamday whoami

Use magic-link login for normal interactive use:

teamday login [email protected] --server=https://app.teamday.ai

Use dev login only against local development servers with DEV_AUTH=1:

teamday login --dev [email protected] --server=http://localhost:8787

For automation and local operator agents, store a service token:

teamday token "tdk_your_token_here"
teamday whoami

Do not paste full service tokens into prompts, transcripts, logs, or documentation.


Folders And Working Directories

Files live in ordinary folders in the organization's file tree, addressed by absolute path such as /engineering or /marketing/blog. There is no separate container to create or select first.

Every chat, job, mission, and app has an explicit working directory (cwd) chosen when it is created. Commands that create those objects take --cwd=/path; there is no "current" folder in the CLI.

teamday files ls /
teamday files mkdir /engineering
teamday files mkdir /engineering/releases

Projects:

teamday projects list
teamday projects create --name="Q2 Launch"

Repositories:

teamday repositories list
teamday repositories add --remote=https://github.com/acme/app.git
teamday repositories refresh <repo-id>
teamday repositories delete <repo-id>

Apps:

teamday apps list
teamday apps create --cwd=/product/dashboard

Agents

Agents are the technical objects behind AI employees and belong to the whole organization. They hold role, prompt, model, tool tags, MCP tags, a default working directory, and read/write path settings. An agent carries the same skills and MCP connections into every folder it works in.

teamday agents list
teamday agents show <agent-id>
teamday agents create \
  --name="Release Reviewer" \
  --role="Engineering release reviewer" \
  --system-prompt="Review release changes, identify risks, and produce an approval checklist." \
  --default-cwd=/engineering/releases
teamday agents update <agent-id> --model=claude-sonnet-4-6
teamday agents delete <agent-id>

--default-cwd is the folder new chats with the agent start in unless a different --cwd is given. Use --read-paths=/a,/b and --write-paths=/a,/b to limit which folders the agent may read or write.

Discover the create contract:

teamday agents create --help

Attach MCP servers and skills to an agent:

teamday agents add-mcp <agent-id> google-search-console
teamday agents remove-mcp <agent-id> google-search-console
teamday agents add-skill <agent-id> research-assistant code-reviewer
teamday agents remove-skill <agent-id> research-assistant
teamday agents attach-all-skills <agent-id> --scope=org

Send a message to an agent:

teamday chat <agent-id> "Review the latest release notes and list blocking risks."

Start a chat in a specific folder, then list and open chats:

teamday chats new --agent-id=<agent-id> --cwd=/engineering/releases
teamday chats list
teamday chats list --agent-id=<agent-id>
teamday chats open <chat-id>

The --cwd is the chat's working directory for its whole life; browsing another folder later does not change it.


MCP Servers

MCP servers connect agents to external tools and data. Use mcp setup for supported presets, or mcp upsert for custom MCP servers.

teamday mcp list
teamday mcp show google-search-console
teamday mcp enable google-search-console
teamday mcp disable google-search-console
teamday mcp attach google-search-console <agent-id>
teamday mcp detach google-search-console <agent-id>

Discover the custom MCP contract:

teamday mcp upsert --help

Supported setup presets:

teamday mcp setup google-search-console --from=service-account.json --agent=<agent-id>
teamday mcp setup ahrefs --token=<ahrefs-token> --agent=<agent-id>
teamday mcp setup google-analytics --from=service-account.json --agent=<agent-id>
teamday mcp setup bigquery --project=<project-id> --from=service-account.json --agent=<agent-id>
teamday mcp setup google-ads --credentials-json=<json> --developer-token=<token> --agent=<agent-id>
teamday mcp setup linkedin --client-id=<id> --client-secret=<secret> --agent=<agent-id>

Custom MCP server:

teamday mcp upsert \
  --name=internal-api \
  --transport=http \
  --url=https://mcp.example.com \
  --agent=<agent-id>

Secrets

Secrets are organization-owned and injected only through approved runtime paths.

teamday secrets list
teamday secrets put GSC_SERVICE_ACCOUNT_JSON --from=service-account.json
teamday secrets put AHREFS_MCP_TOKEN "$AHREFS_MCP_TOKEN"
teamday secrets delete AHREFS_MCP_TOKEN

Missions

Missions are scheduled work. Use them when work should run on the server instead of depending on an open chat.

teamday missions list
teamday missions show <mission-id>
teamday missions create \
  --title="Weekly Release Risk Review" \
  --description="Review merged work and save a release-risk checklist." \
  --agent-id=<agent-id> \
  --cwd=/engineering/releases \
  --schedule-text="Every Monday at 9:00" \
  --task-title="Review this week's release"
teamday missions update <mission-id> --status=paused
teamday missions task-create <mission-id> --title="Check launch blockers"
teamday missions task-update <mission-id> <task-id> --status=done

Discover mission creation and start-work contracts:

teamday missions create --help
teamday missions start --help

Use --schedule-text for a human-readable cadence label, or --schedule-cron with --schedule-timezone when the server scheduler needs an exact cron expression. --cwd is the folder every run of the mission works from.


Files And Knowledge

Use files for any path in the organization's file tree and knowledge for Markdown knowledge articles (conventionally under /knowledge, but any folder works). Paths are absolute organization paths.

teamday files ls /engineering/reports
teamday files search "release risk"
teamday files read /engineering/reports/latest.md
teamday files write /engineering/reports/latest.md --from=report.md
teamday files mkdir /engineering/reports
teamday files mv /engineering/reports/draft.md /engineering/reports/final.md
teamday files rm /engineering/reports/old.md

teamday knowledge list
teamday knowledge search "pricing"
teamday knowledge write /knowledge/agents/release-reviewer.md --from=agent-notes.md

Discover file write flags:

teamday files write --help
teamday knowledge write --help

Jobs, Media, And Resources

Inspect jobs:

teamday jobs list
teamday jobs list --status=running --limit=20
teamday jobs show <job-id>
teamday jobs events <job-id>

Generate media:

teamday generate --kind=image "Product dashboard hero image" --aspect=16:9
teamday generate --kind=video "Short product walkthrough" --aspect=16:9 --duration-s=8
teamday assets list

Manage reusable resources:

teamday resources list --kind=skill
teamday resources put release-review --kind=skill --scope=org --from=release-review-skill.md
teamday resources delete release-review
teamday skills list
teamday tools list

Discover resource upload flags:

teamday resources put --help

Raw API Calls

Use api for endpoints that do not yet have a first-class CLI command:

teamday api GET "/api/files?path=/engineering"
teamday api POST /api/missions --body='{"title":"Manual check","cwd":"/engineering"}'

Operator Checklist

Before a local operator agent changes TeamDay production data:

  1. Run teamday whoami.
  2. Confirm the server is the intended environment.
  3. Confirm the organization is the intended organization.
  4. Prefer --json for scripted reads.
  5. Keep full service tokens out of logs and chat.
  6. Run a small smoke command before scheduling recurring work.

Cold-Agent Quickstart

This sequence is the minimum self-service path for an operator agent in a cloned repo. It uses the repo-local alias so no global binary is required.

alias teamday-local='bun run apps/cli/src/index.ts'

teamday-local whoami --json
teamday-local files ls / --json
teamday-local files mkdir /evaluation
teamday-local agents create \
  --name="Evaluation Agent" \
  --role="Platform evaluator" \
  --system-prompt="Evaluate the platform, run small checks, and report exact blockers." \
  --default-cwd=/evaluation \
  --json
teamday-local chats new --agent-id=<agent-id> --cwd=/evaluation --json
teamday-local chat <agent-id> "Run a small readiness check and report blockers."
teamday-local chats list --agent-id=<agent-id> --json
teamday-local missions create \
  --title="Weekly Agent Readiness Check" \
  --description="Run the readiness check and save blockers." \
  --cwd=/evaluation \
  --agent-id=<agent-id> \
  --schedule-cron="0 9 * * MON" \
  --schedule-timezone="Europe/Bratislava" \
  --task-title="Run readiness check" \
  --json