---
title: automations
sidebarTitle: automations
---

# `prefect.events.cli.automations`



Command line interface for working with automations.


## Functions

### `requires_automations` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/cli/automations.py#L33" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
requires_automations(func: Callable[..., Any]) -> Callable[..., Any]
```

### `ls` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/cli/automations.py#L48" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
ls()
```


List all automations.


### `inspect` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/cli/automations.py#L107" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
inspect(name: Optional[str] = typer.Argument(None, help="An automation's name"), id: Optional[str] = typer.Option(None, '--id', help="An automation's id"), yaml: bool = typer.Option(False, '--yaml', help='Output as YAML'), json: bool = typer.Option(False, '--json', help='Output as JSON'), output: Optional[str] = typer.Option(None, '--output', '-o', help='Specify an output format. Currently supports: json, yaml'))
```


Inspect an automation.

Arguments:

    name: the name of the automation to inspect

    id: the id of the automation to inspect

    yaml: output as YAML

    json: output as JSON

Examples:

    `$ prefect automation inspect "my-automation"`

    `$ prefect automation inspect --id "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"`

    `$ prefect automation inspect "my-automation" --yaml`

    `$ prefect automation inspect "my-automation" --output json`
    `$ prefect automation inspect "my-automation" --output yaml`


### `resume` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/cli/automations.py#L192" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
resume(name: Optional[str] = typer.Argument(None, help="An automation's name"), id: Optional[str] = typer.Option(None, '--id', help="An automation's id"))
```


Resume an automation.

Arguments:

        name: the name of the automation to resume

        id: the id of the automation to resume

Examples:

        `$ prefect automation resume "my-automation"`

        `$ prefect automation resume --id "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"`


### `pause` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/cli/automations.py#L247" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
pause(name: Optional[str] = typer.Argument(None, help="An automation's name"), id: Optional[str] = typer.Option(None, '--id', help="An automation's id"))
```


Pause an automation.

Arguments:

        name: the name of the automation to pause

        id: the id of the automation to pause

Examples:

    `$ prefect automation pause "my-automation"`

    `$ prefect automation pause --id "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"`


### `delete` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/cli/automations.py#L302" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
delete(name: Optional[str] = typer.Argument(None, help="An automation's name"), id: Optional[str] = typer.Option(None, '--id', help="An automation's id"), _all: bool = typer.Option(False, '--all', help='Delete all automations'))
```


Delete an automation.

**Args:**
- `name`: the name of the automation to delete
- `id`: the id of the automation to delete

**Examples:**

`$ prefect automation delete "my-automation"`
`$ prefect automation delete --id "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"`
`$ prefect automation delete --all`


### `create` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/cli/automations.py#L383" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
create(from_file: Optional[str] = typer.Option(None, '--from-file', '-f', help='Path to YAML or JSON file containing automation(s)'), from_json: Optional[str] = typer.Option(None, '--from-json', '-j', help='JSON string containing automation(s)'))
```


Create one or more automations from a file or JSON string.

**Examples:**

`$ prefect automation create --from-file automation.yaml`
`$ prefect automation create -f automation.json`
`$ prefect automation create --from-json '{"name": "my-automation", "trigger": {...}, "actions": [...]}'`
`$ prefect automation create -j '[{"name": "auto1", ...}, {"name": "auto2", ...}]'`

