# Automation commands

> Reference for langalpha automations list, create, edit, trigger, pause, resume and delete, the CLI commands that schedule LangAlpha's agent on a cron schedule or once.

Source: https://docs.langalpha.ai/cli/automations/

An [automation](https://docs.langalpha.ai/concepts/automations-wakeups-commands/#automations) is an instruction the agent runs on its own, on a schedule. The CLI creates schedule (cron) and one-time automations; price automations are made in the app or by the agent. Each command also takes the [global options](https://docs.langalpha.ai/cli/overview/#global-options). Ids are the `AUTOMATION_ID` column of `automations list`.

## automations list

Your automations.

```sh
langalpha automations list [--status S] [--limit N]
```

| Option | What it does |
| --- | --- |
| `--status S` | Only automations in this status, such as `active` or `paused`. |
| `--limit N` | List at most this many. Defaults to 50. |

Prints each automation's id, name, status, trigger, cron expression and next run.

## automations create

Schedule the agent to run a prompt, on a cron schedule or once.

```sh
langalpha automations create --name N --prompt P [--cron EXPR] [--at ISO] [--timezone TZ] -w WS [-m MODEL]
```

| Option | What it does |
| --- | --- |
| `--name N` | Required. The automation's name. |
| `--prompt P` | Required. What the agent is asked on each run. |
| `--cron EXPR` | Run on this five-field cron schedule, such as `0 9 * * 1-5` for weekdays at 9:00. |
| `--at ISO` | Run once, at this time, as an ISO 8601 date and time. |
| `--timezone TZ` | The schedule's time zone, such as `America/New_York`. Defaults to the time zone of the machine running the command. |
| `-w`, `--workspace WS` | Required. Where each run goes: a workspace id, its exact name, or `home` for the Chief of Staff. |
| `-m`, `--model MODEL` | The model each run uses. |

Pass exactly one of `--cron` and `--at`. The workspace is always named, even for Home, so an automation never lands somewhere you did not say.

```sh
langalpha automations create --name "Morning brief" \
  --prompt "Summarize overnight moves in my watchlist" \
  --cron "30 8 * * 1-5" --timezone America/New_York -w home
```

## automations edit

Change an automation.

```sh
langalpha automations edit <id> [--name N] [--prompt P] [--cron EXPR] [--at ISO] [--timezone TZ] [-w WS] [-m MODEL]
```

| Option | What it does |
| --- | --- |
| `--name N` | A new name. |
| `--prompt P` | A new prompt. |
| `--cron EXPR` | A new cron schedule. |
| `--at ISO` | A new one-time run. |
| `--timezone TZ` | A new time zone. |
| `-w`, `--workspace WS` | Move the runs to another workspace, or `home`. |
| `-m`, `--model MODEL` | A new model. |

Only the options you pass change. A trigger's kind is fixed when the automation is created, so a schedule automation takes a new `--cron` and a one-time one a new `--at`, and the server refuses a switch between them.

## automations trigger

Run an automation now.

```sh
langalpha automations trigger <id>
```

Starts a run at once, outside the schedule. The run is a thread you can open or follow.

## automations pause

Pause an automation.

```sh
langalpha automations pause <id>
```

## automations resume

Resume a paused automation.

```sh
langalpha automations resume <id>
```

Also resumes one that [switched itself off](https://docs.langalpha.ai/concepts/automations-wakeups-commands/#automations) after failing, once you have fixed the cause.

## automations delete

Delete an automation and its run history.

```sh
langalpha automations delete <id> [-y]
```

| Option | What it does |
| --- | --- |
| `-y`, `--yes` | Skip the confirmation. Required when no terminal is attached. |

## Related

- [Automations, wakeups and background commands](https://docs.langalpha.ai/concepts/automations-wakeups-commands/)
- [Automation or wakeup?](https://docs.langalpha.ai/compare/automation-or-wakeup/)
- [Scripting recipes](https://docs.langalpha.ai/cli/scripting/#create-a-cron-automation)
