Node.js CLI
The Node.js CLI (@toothfairyai/cli) exposes ~120 commands covering the whole
platform. This page walks through the most common workflows; for the complete
flag-by-flag reference, see the
Node CLI command reference.
Install globally:
npm install -g @toothfairyai/cli
toothfairy configure --api-key YOUR_KEY --workspace-id YOUR_WORKSPACE
Send a message to an agent
toothfairy send "Hello, how can you help?" --agent-id AGENT_ID
# continue an existing chat
toothfairy send "Follow-up question" --agent-id AGENT_ID --chat-id CHAT_ID
Stream a response
toothfairy send-stream "Explain RAG" --agent-id AGENT_ID
Streaming predictions (OpenAI-compatible)
toothfairy predict "Summarise this" --model sorcerer \
--max-tokens 256 --temperature 0.3
Agents CRUD
toothfairy create-agent --label "Support" --mode retriever \
--interpolation-string "You are a helpful assistant." --goals "Help customers"
toothfairy list-agents
toothfairy get-agent AGENT_ID
toothfairy update-agent AGENT_ID --label "Support v2"
toothfairy delete-agent AGENT_ID
Documents
toothfairy upload ./report.pdf --doc-type pdf
toothfairy list-docs # (use get-doc / list-messages-bychat as needed)
toothfairy get-doc DOC_ID
toothfairy delete-doc DOC_ID
Knowledge search
toothfairy search "How do I configure SSO?"
Scheduled jobs & triggers
toothfairy create-scheduled-job --agent-id AGENT_ID --frequency daily --prompt "Daily summary"
toothfairy list-scheduled-jobs
toothfairy pause-scheduled-job JOB_ID
toothfairy resume-scheduled-job JOB_ID
toothfairy create-trigger --agent-id AGENT_ID --name "Webhook trigger" \
--event-source-type EXTERNAL --event-config '{"provider":"..."}'
toothfairy list-triggers
Benchmarks
toothfairy create-benchmark --name "Retrieval quality"
toothfairy run-benchmark BENCHMARK_ID
toothfairy list-benchmark-runs
toothfairy get-benchmark-run RUN_ID
Tips
- Add
--helpto any command for full flags, e.g.toothfairy create-agent --help. - The shorter alias
tfworks everywhere:tf list-agents. - Use
--jsonto get machine-readable output for scripting.