> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developer.deel.com/cli/agents/setup/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.deel.com/_mcp/server. # Set up a coding agent > Install the Deel CLI where your agent runs and provide the instructions it needs Setting up an agent takes four steps: install the CLI where the agent executes commands, give it a token, pin the environment, and add an instruction block. #### Install the CLI where the agent runs The CLI must be on the `PATH` of the shell the agent uses. That shell is not always your own machine. | Agent runs | Install with | | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | On your machine (Claude Code, Cursor, Codex CLI) | The [installer](/cli/installation): `curl -fsSL https://cli.deel.com/install.sh \| sh` | | In a container or hosted sandbox | The same installer; the binary needs no runtime | | In CI | The installer pinned to a release: `curl -fsSL https://cli.deel.com/YOUR_CLI_VERSION/install.sh \| sh`, or `npm install -g @deel-org/cli@YOUR_CLI_VERSION` | | On Windows | `npm install -g @deel-org/cli` | To check the installation, run: ```bash deel --version ``` #### Provide a token Create a personal access token, if not already created; see [Quickstart](/cli/quickstart) for how. Scope it to only what the agent's tasks require. Use the pattern from [Tokens for agents, CI, and scripts](/cli/authentication#tokens-for-agents-ci-and-scripts): the OS keychain on a developer machine, an injected secret in containers or CI. ```bash deel auth login --env demo ``` ```bash export DEEL_TOKEN="$DEEL_PAT_SECRET" # injected from your secret store ``` The agent runs `deel` commands; the CLI resolves the token, and the agent is not exposed to the token value. #### Pin the environment Agents explore by running commands. Keep them in the demo environment until a workflow is proven. ```bash export DEEL_ENV=demo ``` When the workflow is ready for production, set `DEEL_ENV=prod` for that agent explicitly, or instruct the agent to pass `--env prod` on the commands that need it. #### Add the instruction block Agents follow project instruction files. Add the block below to the file your agent reads. #### Claude Code Append to `CLAUDE.md` in the repository root (or `~/.claude/CLAUDE.md` for every project). **`CLAUDE.md`** ```markdown title="CLAUDE.md" ## Deel CLI - Use the `deel` command to work with Deel. Run `deel --help` to list command groups. - Before calling a command, run `deel [--variant] --help --json` and `deel [--variant] --generate-input` to learn the request body. Never guess field names or allowed values. - Pass request bodies with `--input file://` or inline JSON. Read results from stdout as JSON; errors are JSON on stderr with an `error.code` field. - Stay in the demo environment (`--env demo`) unless told otherwise. `create` and `create-bulk` commands have real effects. - Use `--fields` or `--jq` to keep output small. Bulk commands return a `job_id`; follow it with `deel job status `. ``` #### Cursor Create a rule file so that the instructions apply whenever the agent works in the project. **`.cursor/rules/deel-cli.mdc`** ```markdown title=".cursor/rules/deel-cli.mdc" --- description: How to use the Deel CLI alwaysApply: true --- - Use the `deel` command to work with Deel. Run `deel --help` to list command groups. - Before calling a command, run `deel [--variant] --help --json` and `deel [--variant] --generate-input` to learn the request body. Never guess field names or allowed values. - Pass request bodies with `--input file://` or inline JSON. Read results from stdout as JSON; errors are JSON on stderr with an `error.code` field. - Stay in the demo environment (`--env demo`) unless told otherwise. `create` and `create-bulk` commands have real effects. - Use `--fields` or `--jq` to keep output small. Bulk commands return a `job_id`; follow it with `deel job status `. ``` #### Codex Append to `AGENTS.md` in the repository root. **`AGENTS.md`** ```markdown title="AGENTS.md" ## Deel CLI - Use the `deel` command to work with Deel. Run `deel --help` to list command groups. - Before calling a command, run `deel [--variant] --help --json` and `deel [--variant] --generate-input` to learn the request body. Never guess field names or allowed values. - Pass request bodies with `--input file://` or inline JSON. Read results from stdout as JSON; errors are JSON on stderr with an `error.code` field. - Stay in the demo environment (`--env demo`) unless told otherwise. `create` and `create-bulk` commands have real effects. - Use `--fields` or `--jq` to keep output small. Bulk commands return a `job_id`; follow it with `deel job status `. ``` #### Other agents Put the same instructions in the agent's system prompt or in the description of its shell tool. If the agent framework supports tool definitions, describe one tool that runs `deel` with arbitrary arguments; the CLI's own `--help --json` output supplies the per-command schema at run time. ```text You can run the `deel` command to work with Deel. Run `deel --help` to list command groups. Before calling a command, run `deel [--variant] --help --json` and `--generate-input` to learn its request body; never guess field names. Pass bodies with `--input file://` or inline JSON. Results are JSON on stdout; errors are JSON on stderr with an `error.code`. Stay in the demo environment (`--env demo`) unless told otherwise. Use `--fields` or `--jq` to keep output small. ``` #### Verify Ask the agent to confirm its setup before giving it real work, using the same two checks from [Quickstart](/cli/quickstart): * "Run `deel auth status --fields valid,source` and tell me the result." * "Describe the request body of `deel adjustments create --invoice` using its `--help --json` output." ## Checklist for hosted and shared environments Beyond the [general guardrails](/cli/agents/workflows#guardrails), hosted and shared environments also require: * Use the installer in containers; the binary needs no runtime. * Set `DEEL_TOKEN` from the platform's secret store, never from a file in the workspace. ## Next steps #### [Agent workflows](/cli/agents/workflows) How an agent should discover, call, and recover #### [Authentication](/cli/authentication) Token sources, keychain backends, and precedence > Build apps and integrations that extend and enhance the Deel services.