|
| 1 | +# TAGLINE |
| 2 | + |
| 3 | +CLI for Woodpecker CI servers and local pipeline execution |
| 4 | + |
| 5 | +# TLDR |
| 6 | + |
| 7 | +**Set up** a server context (opens the UI to issue a token if **--token** is omitted) |
| 8 | + |
| 9 | +```woodpecker-cli setup --server [https://ci.example.com]``` |
| 10 | + |
| 11 | +**Lint** the project's workflow files (`.woodpecker/`, `.woodpecker.yaml`, or `.woodpecker.yml`) |
| 12 | + |
| 13 | +```woodpecker-cli lint``` |
| 14 | + |
| 15 | +**Lint** a specific workflow file and treat warnings as errors |
| 16 | + |
| 17 | +```woodpecker-cli lint --strict [.woodpecker/test.yaml]``` |
| 18 | + |
| 19 | +**Run** a workflow locally (auto-detects a backend) |
| 20 | + |
| 21 | +```woodpecker-cli exec [.woodpecker/test.yaml]``` |
| 22 | + |
| 23 | +Run every YAML file in a **workflow directory** |
| 24 | + |
| 25 | +```woodpecker-cli exec [.woodpecker/]``` |
| 26 | + |
| 27 | +Force the **Docker** backend |
| 28 | + |
| 29 | +```woodpecker-cli exec --backend-engine docker [.woodpecker/test.yaml]``` |
| 30 | + |
| 31 | +Pass **environment variables** into a local run |
| 32 | + |
| 33 | +```woodpecker-cli exec --env [GOFLAGS=-mod=readonly] [.woodpecker/test.yaml]``` |
| 34 | + |
| 35 | +Pass **secrets** into a local run (values are not pulled from the server) |
| 36 | + |
| 37 | +```woodpecker-cli exec --secrets [deploy_token="$DEPLOY_TOKEN"] [.woodpecker/deploy.yaml]``` |
| 38 | + |
| 39 | +Load secrets from a **YAML file** |
| 40 | + |
| 41 | +```woodpecker-cli exec --secrets-file [.woodpecker/local-secrets.yaml] [.woodpecker/deploy.yaml]``` |
| 42 | + |
| 43 | +**List** repositories registered on the server |
| 44 | + |
| 45 | +```woodpecker-cli repo ls``` |
| 46 | + |
| 47 | +Show **pipeline history** for a repository |
| 48 | + |
| 49 | +```woodpecker-cli pipeline ls [owner/repo]``` |
| 50 | + |
| 51 | +Show the **latest pipeline** for a repository |
| 52 | + |
| 53 | +```woodpecker-cli pipeline last [owner/repo]``` |
| 54 | + |
| 55 | +Show a **specific pipeline** (omit the number to use the latest) |
| 56 | + |
| 57 | +```woodpecker-cli pipeline show [owner/repo] [42]``` |
| 58 | + |
| 59 | +**Start** a pipeline and inject extra step environment |
| 60 | + |
| 61 | +```woodpecker-cli pipeline start [owner/repo] [42] -p [KEY=value]``` |
| 62 | + |
| 63 | +Add a **repository secret** |
| 64 | + |
| 65 | +```woodpecker-cli repo secret add --repo [owner/repo] --name [deploy_token] --value [$DEPLOY_TOKEN]``` |
| 66 | + |
| 67 | +Switch the **current context** |
| 68 | + |
| 69 | +```woodpecker-cli context use [production]``` |
| 70 | + |
| 71 | +**Update** the CLI binary to the latest release |
| 72 | + |
| 73 | +```woodpecker-cli update``` |
| 74 | + |
| 75 | +# SYNOPSIS |
| 76 | + |
| 77 | +**woodpecker-cli** [_global-options_] _command_ [_command-options_] [_arguments_] |
| 78 | + |
| 79 | +# DESCRIPTION |
| 80 | + |
| 81 | +**woodpecker-cli** is the official command-line client for **Woodpecker CI**, a container-based continuous integration engine. It talks to a Woodpecker server over its HTTP API (list and trigger pipelines, manage repositories, secrets, registries, and users) and can also compile and run workflow files on the local machine without a server. |
| 82 | + |
| 83 | +Workflows live in **.woodpecker.yaml**, **.woodpecker.yml**, or a **.woodpecker/** directory of YAML files. **lint** and **exec** search that default order when no path is given. **exec** auto-detects a backend (**docker**, **kubernetes**, or **local**); Docker needs a running daemon, while **local** runs step commands on the host and does not reproduce the container image environment. |
| 84 | + |
| 85 | +Server commands need a server URL and an authentication token. **woodpecker-cli setup** writes a named context and stores the token in the operating-system keyring. Flags and environment variables override stored context values. |
| 86 | + |
| 87 | +# COMMANDS |
| 88 | + |
| 89 | +**setup** [_server_] |
| 90 | +> Create a named context (default **default**), save the server URL, and store the token in the keyring. If **--token** is omitted, the CLI opens the Woodpecker UI to issue one. **--context** / **--ctx** names the context. |
| 91 | +
|
| 92 | +**context**, **ctx** |
| 93 | +> Manage named server contexts: **list** / **ls**, **use**, **delete** / **rm**, **rename**. |
| 94 | +
|
| 95 | +**lint** [_path_...] |
| 96 | +> Lint workflow YAML. With no path, uses the project's default config. **--strict** treats warnings as errors. |
| 97 | +
|
| 98 | +**exec** [_path_...] |
| 99 | +> Compile and run workflows from the local checkout (or **--repo-path**). **--backend-engine** selects **docker**, **kubernetes**, **local**, or auto-detect. **--env** _KEY=value_ sets pipeline environment. **--secrets** and **--secrets-file** supply secrets (not downloaded from the server). **--pipeline-event**, **--commit-branch**, **--commit-sha**, **--repo**, and related flags override CI metadata. **--metadata-file** replays metadata downloaded from the UI (same CLI/server version only). Default timeout is **1h**. |
| 100 | +
|
| 101 | +**info** |
| 102 | +> Show the authenticated user. |
| 103 | +
|
| 104 | +**repo** |
| 105 | +> Manage repositories: **ls**, **show**, **add**, **rm**, **sync**, **update**, **chown**, **repair**, plus **secret**, **registry**, and **cron** subcommands. **repo ls --all** includes inactive repos; **--org** filters by organization. |
| 106 | +
|
| 107 | +**pipeline** |
| 108 | +> Manage pipelines for a repository identified by id or **owner/name**: **ls**, **show**, **last**, **create**, **start**, **stop**, **approve**, **decline**, **deploy**, **ps**, **queue**, **purge**, and **log show** / **log purge**. **pipeline ls** accepts **--branch**, **--event**, **--status**, **--limit** (default 25), **--before**, and **--after** (RFC3339). |
| 109 | +
|
| 110 | +**org** |
| 111 | +> Manage organization **secret** and **registry** entries. **--organization** / **--org** takes an id or full name. |
| 112 | +
|
| 113 | +**admin** |
| 114 | +> Server administration: **log-level**, global **secret** and **registry**, **user**, and **org ls**. Requires an admin token. |
| 115 | +
|
| 116 | +**update** |
| 117 | +> Replace the CLI binary with the latest release. **--force** reinstalls even when already current. |
| 118 | +
|
| 119 | +# PARAMETERS |
| 120 | + |
| 121 | +**-s**, **--server** _url_ |
| 122 | +> Woodpecker server address. Overrides the current context. Environment: **WOODPECKER_SERVER**. |
| 123 | +
|
| 124 | +**-t**, **--token** _token_ |
| 125 | +> Server authentication token. Overrides the keyring entry for the current context. Environment: **WOODPECKER_TOKEN**. Prefer **setup** or the environment variable so the token is not visible in process listings. |
| 126 | +
|
| 127 | +**-c**, **--config** _file_ |
| 128 | +> Path to the **legacy** `config.json` file. Environment: **WOODPECKER_CONFIG**. Does not select a named context. |
| 129 | +
|
| 130 | +**--log-level** _level_ |
| 131 | +> Log level (default **info**). Environment: **WOODPECKER_LOG_LEVEL**. |
| 132 | +
|
| 133 | +**--log-file** _path_ |
| 134 | +> Log destination. **stdout** and **stderr** are accepted; default is **stderr**. |
| 135 | +
|
| 136 | +**--pretty** |
| 137 | +> Pretty-print debug output. |
| 138 | +
|
| 139 | +**--nocolor** |
| 140 | +> Disable color in pretty debug output. |
| 141 | +
|
| 142 | +**--disable-update-check** |
| 143 | +> Skip the CLI update check. |
| 144 | +
|
| 145 | +**--skip-verify** |
| 146 | +> Skip TLS verification of the server certificate. |
| 147 | +
|
| 148 | +**--socks-proxy** _addr_ |
| 149 | +> SOCKS proxy for server requests. **--socks-proxy-off** ignores it. |
| 150 | +
|
| 151 | +# CONFIGURATION |
| 152 | + |
| 153 | +**~/.config/woodpecker/contexts.json** |
| 154 | +> Named contexts on Linux and other Unix systems (`XDG_CONFIG_HOME` overrides the base). macOS uses `~/Library/Application Support/woodpecker/contexts.json`. Each entry stores **name**, **server_url**, and **log_level**. **current_context** must name one of those entries. Tokens are **not** written here; they live in the OS keyring, keyed by server URL. |
| 155 | +
|
| 156 | +**~/.config/woodpecker/config.json** |
| 157 | +> Legacy single-server file used when no current context can be loaded. Accepts **server_url** and **log_level**. **--config** / **WOODPECKER_CONFIG** point at this file, not at `contexts.json`. |
| 158 | +
|
| 159 | +**.woodpecker/**, **.woodpecker.yaml**, **.woodpecker.yml** |
| 160 | +> Default workflow locations, searched in that order by **lint** and **exec**. |
| 161 | +
|
| 162 | +Precedence for connection settings: command-line flags, then **WOODPECKER_SERVER** / **WOODPECKER_TOKEN** / **WOODPECKER_LOG_LEVEL**, then the current context (or legacy config). |
| 163 | + |
| 164 | +# CAVEATS |
| 165 | + |
| 166 | +Server commands fail without a reachable server and a valid token. Tokens in argv appear in process listings and shell history; use **setup** (keyring) or **WOODPECKER_TOKEN**. |
| 167 | + |
| 168 | +**exec --backend-engine docker** needs a Docker daemon. **local** runs commands on the host and does not match container images, users, or packages used on agents. |
| 169 | + |
| 170 | +Secrets used by **exec** must be passed with **--secrets** or **--secrets-file**; they are not fetched from the server. Keep local secret files out of version control. |
| 171 | + |
| 172 | +**--metadata-file** is not a stable API. Replay only with the same Woodpecker version that produced the file. |
| 173 | + |
| 174 | +Match CLI and server versions. **--skip-verify** disables TLS verification. |
| 175 | + |
| 176 | +The npm package **@woodpecker.co/cli** is a different product (command name **woodpecker**). This binary is **woodpecker-cli** from Woodpecker CI. |
| 177 | + |
| 178 | +# HISTORY |
| 179 | + |
| 180 | +Woodpecker CI was forked from **Drone 0.8** by **@laszlocph** in **April 2019** after Drone's license change, and renamed Woodpecker in **August 2019**. The project is Apache 2.0 licensed and remains community-maintained. **woodpecker-cli** is built from the same Go tree as the server and agent (`cmd/cli`). Current releases are in the **3.x** series (3.18 as of August 2026). |
| 181 | + |
| 182 | +# INSTALL |
| 183 | + |
| 184 | +```pacman: sudo pacman -S woodpecker-cli``` |
| 185 | + |
| 186 | +```apk: sudo apk add woodpecker-cli``` |
| 187 | + |
| 188 | +```zypper: sudo zypper install woodpecker-cli``` |
| 189 | + |
| 190 | +```brew: brew install woodpecker-cli``` |
| 191 | + |
| 192 | +```nix: nix profile install nixpkgs#woodpecker-cli``` |
| 193 | + |
| 194 | +<!-- packages: 2026-09-04 --> |
| 195 | + |
| 196 | +# SEE ALSO |
| 197 | + |
| 198 | +[docker](/man/docker)(1), [git](/man/git)(1), [act](/man/act)(1), [circleci](/man/circleci)(1), [gitea](/man/gitea)(1) |
| 199 | + |
| 200 | +# RESOURCES |
| 201 | + |
| 202 | +```[Source code](https://github.com/woodpecker-ci/woodpecker)``` |
| 203 | + |
| 204 | +```[Homepage](https://woodpecker-ci.org/)``` |
| 205 | + |
| 206 | +```[Documentation](https://woodpecker-ci.org/docs/cli)``` |
| 207 | + |
| 208 | +<!-- verified: 2026-09-05 --> |
0 commit comments