# Automation CLI commands

> This page describes the CLI commands that are used to deploy, list, and delete the code automations in a Uniform project.

Source: https://docs.uniform.app/docs/guides/cli/commands/automation

The commands in this section allow you to manage the
[code automations](https://docs.uniform.app/docs/guides/automations/code-automations) in a Uniform project.
Scout automations are managed in the dashboard instead.

> **Prerequisites:**
>
> - Minimum CLI version: `20.74.7`
> - Managing automations requires an API key with [Manage Automations](https://docs.uniform.app/docs/guides/roles-and-permissions) permissions.

## Automation commands

These commands should be added as a script command in your project, rather than run directly in the terminal. For example, in the package.json file of a next.js project:

```json
"scripts": {
    "uniform:deploy-automations": "uniform automation deploy ./automations"
  },
```

An automation's public ID is derived from its filename, so `on-entry-changed.automation.ts`
deploys as `on-entry-changed`.

### Deploy automations

```bash
uniform automation deploy <directory or file path...>
```

_command_  
Bundle the specified automations and deploy them to the Uniform project. Deploying an
automation that already exists replaces it.

- If a file path is specified, that automation module is bundled and deployed. The filename
  does not have to follow the `*.automation.ts` convention.
- If a directory path is specified, every `*.automation.ts` (also `.js`, `.mjs`, and `.cjs`)
  file directly inside the directory is deployed. Directories are not searched recursively.
- You can pass several files and directories in a single command.

```bash
# Deploy a single automation
uniform automation deploy ./on-entry-changed.automation.ts

# Deploy several at once
uniform automation deploy ./on-entry-changed.automation.ts ./nightly-cleanup.automation.ts

# Deploy every automation in a directory
uniform automation deploy ./automations
```

Any environment variable named `UNIFORM_ENV_*` that is available when the CLI runs is inlined
into the deployed bundle. The CLI loads your `.env` file automatically, and CI variables work
too. See [secrets and environment variables](https://docs.uniform.app/docs/guides/automations/code-automations#secrets-and-environment-variables).

> **Push-only deployment:**
>
> Deployment is push-only. You cannot read the code you deployed back out, because it is
> encrypted to protect any sensitive data it may contain. Keep your automation source in version
> control.

| Command | Output details |
| --- | --- |
| -p, --project  <br>_string_ | Uniform project id. If not specified, the environment variable `UNIFORM_CLI_PROJECT_ID` is used. |
| -f, --format  <br>_string (optional, default value: YAML)_ | Uniform API key. If not specified, the environment variable `UNIFORM_API_KEY` is used. |
| --apiHost  <br>_string (optional, default value: https://uniform.app)_ | Uniform host. If not specified, the environment variable `UNIFORM_CLI_BASE_URL` is used. If the environment variable isn't set, the default value is used. |
| --proxy  <br>_string (optional)_ | Proxy server. If not specified, the following environment variables are used (with the first match being used): `HTTPS_PROXY`, `https_proxy`, `ALL_PROXY`, `all_proxy`. If no match is found, no proxy server is used. |
| --compatibilityDate  <br>_string (optional)_ | Code automations run on Cloudflare Workers. This date pins the Workers runtime so backwards-incompatible changes after that date do not apply to the deployed automation. Format: `YYYY-MM-DD`. Overrides `compatibilityDate` in the automation metadata. See [Cloudflare compatibility dates](https://developers.cloudflare.com/workers/configuration/compatibility-dates/#setting-compatibility-date). |

### List automations

```bash
uniform automation list
```

_command_  
List the automations registered for the project. Also available as `uniform automation ls`.

| Command | Output details |
| --- | --- |
| -p, --project  <br>_string_ | Uniform project id. If not specified, the environment variable `UNIFORM_CLI_PROJECT_ID` is used. |
| -f, --format  <br>_string (optional, default value: YAML)_ | Uniform API key. If not specified, the environment variable `UNIFORM_API_KEY` is used. |
| --apiHost  <br>_string (optional, default value: https://uniform.app)_ | Uniform host. If not specified, the environment variable `UNIFORM_CLI_BASE_URL` is used. If the environment variable isn't set, the default value is used. |
| --proxy  <br>_string (optional)_ | Proxy server. If not specified, the following environment variables are used (with the first match being used): `HTTPS_PROXY`, `https_proxy`, `ALL_PROXY`, `all_proxy`. If no match is found, no proxy server is used. |

### Delete automations

```bash
uniform automation delete <public ID, directory, or file path...>
```

_command_  
Delete the specified automations from the Uniform project.

- If a public ID is specified, that automation is deleted.
- If a file path is specified, the public ID is derived from the filename.
- If a directory path is specified, every matching automation file in the directory is
  deleted, using the same convention as deploy.
- A path that does not exist is treated as a public ID.

```bash
uniform automation delete on-entry-changed
uniform automation delete ./on-entry-changed.automation.ts ./nightly-cleanup.automation.ts
uniform automation delete ./automations
```

| Command | Output details |
| --- | --- |
| -p, --project  <br>_string_ | Uniform project id. If not specified, the environment variable `UNIFORM_CLI_PROJECT_ID` is used. |
| -f, --format  <br>_string (optional, default value: YAML)_ | Uniform API key. If not specified, the environment variable `UNIFORM_API_KEY` is used. |
| --apiHost  <br>_string (optional, default value: https://uniform.app)_ | Uniform host. If not specified, the environment variable `UNIFORM_CLI_BASE_URL` is used. If the environment variable isn't set, the default value is used. |
| --proxy  <br>_string (optional)_ | Proxy server. If not specified, the following environment variables are used (with the first match being used): `HTTPS_PROXY`, `https_proxy`, `ALL_PROXY`, `all_proxy`. If no match is found, no proxy server is used. |

> **Use an AI coding assistant:**
>
> The [`uniform-automations`](https://github.com/uniformdev/agent-skills/tree/main/skills/uniform-automations) agent skill teaches coding assistants such as Claude Code, Codex, Cursor, and Copilot how to write, test, and deploy code automations with the Automations SDK, including `ScoutClient` calls and syncs with external systems. To install it, see [Uniform agent skills](https://docs.uniform.app/docs/guides/ai/agent-skills).
