﻿# octopus runbook run

Run runbooks in Octopus Deploy

```text
Usage:
  octopus runbook run [flags]

Flags:
  -p, --project string                   Name or ID of the project to run the runbook from
  -n, --name string                      Name of the runbook to run
      --runbook-tag stringArray          Run all runbooks matching this tag (can be specified multiple times). Format is 'Tag Set Name/Tag Name'. Mutually exclusive with --name.
  -e, --environment stringArray          Run in this environment (can be specified multiple times)
      --tenant stringArray               Run for this tenant (can be specified multiple times)
      --tenant-tag stringArray           Run for tenants matching this tag (can be specified multiple times). Format is 'Tag Set Name/Tag Name', such as 'Regions/South'.
      --run-at string                    Run at a later time. Run now if omitted. TODO date formats and timezones!
      --run-at-expiry string             Cancel a scheduled run if it hasn't started within this time period.
  -v, --variable stringArray             Set the value for a prompted variable in the format Label:Value
      --snapshot string                  Name or ID of the snapshot to run. If not supplied, the command will attempt to use the published snapshot.
      --skip stringArray                 Exclude specific steps from the runbook
      --guided-failure string            Enable Guided failure mode (true/false/default)
      --force-package-download           Force re-download of packages
      --run-target stringArray           Run on this target (can be specified multiple times)
      --exclude-run-target stringArray   Run on targets except for this (can be specified multiple times)
      --git-ref string                   Git Reference e.g. refs/heads/main. Only relevant for config-as-code projects where runbooks are stored in Git.
      --package-version string           Default version to use for all packages. Only relevant for config-as-code projects where runbooks are stored in Git.
      --package stringArray              Version specification for a specific package.
                                         Format as {package}:{version}, {step}:{version} or {package-ref-name}:{packageOrStep}:{version}
                                         You may specify this multiple times.
                                         Only relevant for config-as-code projects where runbooks are stored in Git.
      --git-resource stringArray         Git reference for a specific Git resource.
                                         Format as {step}:{git-ref}, {step}:{git-resource-name}:{git-ref}
                                         You may specify this multiple times.
                                         Only relevant for config-as-code projects where runbooks are stored in Git.

Global Flags:
  -h, --help                   Show help for a command
      --no-prompt              Disable prompting in interactive mode
  -f, --output-format string   Specify the output format for a command ("json", "table", or "basic") (default "table")
  -s, --space string           Specify the space for operations

```

## Examples

:::div{.success}
**Octopus Samples instance**

Many of the examples we use, reference the [samples instance](https://samples.octopus.app/app#/users/sign-in) of Octopus Deploy. If you'd like to explore the samples instance, you can log in as a guest.
:::

```bash
octopus runbook run  # fully interactive
octopus runbook run --project MyProject --runbook "Rebuild DB indexes"

```

## Learn more

- [Octopus CLI](/docs/octopus-rest-api/cli)
- [Creating API keys](/docs/octopus-rest-api/how-to-create-an-api-key)
