CLI
Install the wardn CLI, point it at your Wardn, and find the command you need.
The wardn CLI does the things that have to start from your own machine: it installs the operator in a cluster, checks who you are and what you may do, and opens a shell in a pod. Everything else (sources, apps, deployments, settings) is in the web app and the HTTP API.
It talks to Wardn with an API token, the same way a script does, so it can never do more than the person who made the token. The one command that also talks to a cluster, wardn cluster, uses your kubeconfig for the install only and never stores or sends it.
Install and connect
Download and verify
Download the archive for your system from the release page, check its signature and checksum, and unpack it. The checksums file is signed with cosign keyless signing by Wardn's release workflow.
VERSION=0.1.0 OS=linux ARCH=amd64 # OS: linux or darwin; ARCH: amd64 or arm64
curl -fsSLO https://github.com/wardn/wardn/releases/download/v$VERSION/wardn_${VERSION}_${OS}_${ARCH}.tar.gz
curl -fsSLO https://github.com/wardn/wardn/releases/download/v$VERSION/checksums.txt
curl -fsSLO https://github.com/wardn/wardn/releases/download/v$VERSION/checksums.txt.sigstore.json
cosign verify-blob checksums.txt --bundle checksums.txt.sigstore.json \
--certificate-identity-regexp '^https://github.com/wardn/wardn/\.github/workflows/release\.yml@refs/tags/v' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
sha256sum --check --ignore-missing checksums.txt
tar -xzf wardn_${VERSION}_${OS}_${ARCH}.tar.gz
sudo install wardn_${VERSION}_${OS}_${ARCH}/wardn /usr/local/bin/wardncosign verify-blob proves the checksums file came from the release workflow, and sha256sum proves your archive matches it. To skip the install, run the CLI as a container: docker run --rm ghcr.io/future-pirate-king/cli:0.1.0 version. To build from source, run go build -o wardn ./cmd/wardn in the cli directory.
Check the version
wardn --versionwardn version 0.1.0wardn version prints the same number. Match the CLI to your control plane: the operator image the CLI installs defaults to the CLI's own version (Upgrading).
Make an API token and point the CLI at Wardn
In the web app, make a token (API tokens) and give the CLI its address and the token:
export WARDN_API_URL=https://wardn.example.com
export WARDN_TOKEN=wrd_...Check the connection
wardn statusapi: ok
Ada Lovelace <[email protected]>
role: adminThe first line says the API answered. The next two say who the token acts as. See wardn status.
Global flags and settings
Every command accepts these flags. Each has an environment variable that sets its default, so scripts and CI need no flags.
| Flag | Environment | Default | Meaning |
|---|---|---|---|
--api | WARDN_API_URL | none | The address of your Wardn, such as https://wardn.example.com. It may be the web address or the API root; /api/v1 is added when it is missing. Required by every command that calls the API. |
--token | WARDN_TOKEN | none | An API token (wrd_...) made in the web app. Sent as a bearer token. |
--help, -h | Print help for the command. | ||
--version | Print wardn version <version>. Only on the root command. |
A flag overrides its variable. Prefer the variable for the token: a --token value is visible to other users of the machine in the process list and is kept in your shell history.
If --api is not set, a command that calls the API stops with the API URL is not set (--api or WARDN_API_URL). A token that is missing or wrong comes back from the API as an error naming the problem, such as Sign in to use this API.. wardn cluster connect and wardn cluster disconnect check for the token themselves, before they call anything.
wardn cluster has settings of its own: KUBECONFIG for the cluster to install into, and WARDN_GATEWAY_URL for the address the operator dials. See wardn cluster.
Output and exit codes
| Result | Exit status | Output |
|---|---|---|
| Success | 0 | The command's output on standard output. |
| Any error | 1 | error: <message> on standard error. A refusal from the API reads error: <what failed>: wardn API error: <message> (<code>, HTTP <status>); the code is a stable API error code. |
wardn can-i when the answer is no | 1 | no on standard output, then the reason and error: not allowed on standard error. |
wardn exec of a command that exits non-zero | that command's exit status | What the command printed. |
Tables and records are plain text for reading. For anything a script has to parse, call the HTTP API, which returns JSON.
Commands
| Command | What it does | Page |
|---|---|---|
wardn cluster connect | Create a join token and install the operator in a cluster. | wardn cluster |
wardn cluster disconnect | Revoke a cluster's credentials. | wardn cluster |
wardn cluster uninstall | Delete the operator's manifests and leave workloads alone. | wardn cluster |
wardn clusters | List clusters with their status, Kubernetes version and operator. | wardn clusters |
wardn clusters get <name-or-id> | Show one cluster. | wardn clusters |
wardn status | Check that the API answers, then show who you are. | wardn status |
wardn whoami | Show your name, email and organization role. | wardn status |
wardn can-i <permission> | Ask whether you hold a permission. | wardn status |
wardn exec <deployment> | Open a terminal, or run one command, in a pod. | wardn exec |
wardn bundle create | Copy a release, with its signatures and SBOMs, into one archive. | wardn bundle |
wardn bundle push <archive> | Load a bundle into a private registry and write a values file for the charts. | wardn bundle |
wardn version | Print the CLI version. | below |
wardn version
Prints the CLI version as wardn <version>, for example wardn 0.1.0. A build made from source without a version prints wardn dev. It takes no arguments and calls nothing.
wardn versionwardn 0.1.0wardn version writes to standard error, like the rest of the CLI's notices. To capture it, redirect with 2>&1, or use wardn --version, which writes to standard output.