Skip to main content

Overview

MossDesk is designed to be agent-operable — every action available in the dashboard can be performed via CLI or API. This makes MossDesk a natural fit for AI coding agents that can run shell commands or make HTTP requests.

How it works

AI agents interact with MossDesk through:
  1. CLI commands — Agents execute moss commands in a terminal, using --json for structured output
  2. API calls — Agents make HTTP requests to the REST API with an X-API-Key header
  3. Exit codes — Agents can branch on success/failure using standardized exit codes

Compatible agents

Setting up Claude Code

Add the following to your project’s CLAUDE.md:

Structured output with --json

Every CLI command supports the --json flag, which outputs data in a consistent JSON envelope:

Exit codes for control flow

Agents can use exit codes to handle errors programmatically: Example in a script:

Example agent flows

Daily CRM review

Post-meeting logging

Pipeline management

Best practices

  1. Always use --json — Table output is for humans; JSON output is for agents
  2. Check exit codes — Don’t assume success; handle errors gracefully
  3. Use --request-id — Pass a unique request ID for tracing and debugging
  4. Use --idempotency-key — Prevent duplicate creates when retrying
  5. Scope API keys — Create a dedicated API key with minimum required scopes for each agent