---
title: "Track and cancel operations"
url: "https://docs.alisx.com/how-to/alis-build/track-and-cancel-operations/"
---
# Track and cancel operations

Re-attach to, inspect and cancel the long-running operations that `alis define`, `alis build`, `alis deploy` and `alis blocks install` start.

## Prerequisites

- An operation name such as `operations/0f6b...`. Commands print it when run with `--async`, and the final result of a waited command carries it under `name`.

## List recent operations

```bash title="Terminal"
alis operations list
```

The CLI keeps a local record of operations it started on this machine; operations started elsewhere do not appear. Each row shows `name`, `type` (`define`, `build`, `deploy`), `target` (the package id), `startedAt` and the exact `next` command to wait on it. `--limit` caps the rows (default 20). `--active` polls each operation and prints the running and unreadable ones; an unreadable status is not evidence that the operation stopped.

## Wait for an operation

```bash title="Terminal"
alis operations wait operations/<id>
```

Progress streams to stderr and the finished operation prints to stdout, exactly as the starting command would have done. `--timeout 15m` stops waiting while the operation keeps running; the last stderr event names the `next` command to resume. `--quiet` hides progress; `--poll-interval` changes the polling rate.

Pressing ++ctrl+c++ stops the wait only. The operation continues on the platform; re-attach with the same command.

## Check the state once

```bash title="Terminal"
alis operations describe operations/<id> --json
```

Prints the operation as it is now: `done`, `status` (`running`, `succeeded`, `failed`), `version`, `notes`, `logsUri` and the `images[]` or `deployments[]` in progress.

## Cancel a build

```bash title="Terminal"
alis operations cancel operations/<id>
```

Only build executions can be cancelled; deployments cannot. The result reports `stopped`. Start replacement work only once `stopped` is `true`. Add `--package <pkg>` when the operation is not in the local record.

## Related

- [Operations and output](https://docs.alisx.com/reference/dbd/operations-and-output.md)
- [Read logs](https://docs.alisx.com/how-to/alis-build/read-logs.md)
