CLI overview

From Canasta Wiki

This page provides an overview of the canasta command-line tool. For a more straightforward listing of the CLI commands, generated from the CLI's own definitions, see CLI:Canasta.

About the CLI

The Canasta CLI is the single tool you use to operate Canasta wikis throughout their lifecycle: provisioning the host, creating instances, managing wikis inside an instance, configuring extensions and skins, running maintenance, taking backups, and tearing down. It runs against either of the two supported orchestrators β€” Docker Compose for single-host deployments, Kubernetes for multi-host or HA setups β€” and the same verbs work on both.

For the orchestrator choice and where each is appropriate, see Help:Orchestrators. For the conceptual model of an "instance" and how multiple instances coexist on one host, see Help:General concepts.

Invocation

There are two equivalent ways to invoke the CLI. Both accept the same verbs and flags; the difference is what's on the host.

  • canasta-native β€” installs Ansible into a Python virtual environment on the host and runs playbooks directly. Faster startup, easier to read or customize the playbooks, and required for some commands (notably canasta install k8s-cp, which provisions software on the host).
  • canasta-docker β€” pulls a Canasta CLI Docker image and runs Ansible inside it. Only Docker is needed on the host. Convenient for ephemeral controllers; not suitable for installing host packages.

Both wrappers are installed via a single bootstrap (curl -fsSL https://get.canasta.wiki | bash for Docker mode; add -s -- --native for native). See Help:Installation for the install matrix and platform-specific prerequisites.

Targeting hosts

By default canasta manages instances on the local host (localhost). To manage instances on a remote host (typical for production: dedicated wiki host, controller on your laptop or a CI runner), pass --host <name>. Hosts can be SSH destinations or short names from a saved-host inventory. See Help:Multi-host management for the full targeting model.

The verbs by workflow stage

Lifecycle

The core verbs you'll use to operate any Canasta instance β€” create it, watch it, change state.

  • create β€” create a new instance from scratch (provisions storage, starts containers, runs MediaWiki's installer)
  • list β€” list all registered instances and their status
  • status β€” orchestrator-aware view of one instance's pods/containers, volumes, ingress, and TLS state
  • version β€” show the CLI version, the target Canasta image version, and per-instance image versions
  • start / stop / restart β€” change container state
  • reconcile β€” converge a drifted instance's containers with its declared configuration without a disruptive restart (fix companion to doctor)
  • rebuild β€” rebuild an instance's custom image and recreate its containers, e.g. to pick up changes to a custom Dockerfile or local source (Docker Compose only; on Kubernetes, push a locally built image with image push). When the instance uses its own wiki database account, or CrowdSec setup is pending, it restarts the instance the same way restart does, which takes longer. Like restart, it holds the instance lock, so it never runs alongside a restore, start, stop, restart or delete of the same instance
  • scale β€” adjust replica counts (Kubernetes only)
  • delete β€” tear down an instance and remove it from the registry

Setup

  • install β€” install a dependency on the target host: docker, k8s-cp (k3s control plane), k8s-worker, git-crypt, sops (the SOPS + age toolchain for encrypted Kubernetes gitops secrets), podman (Podman + podman-compose as the container runtime β€” see Installation: container runtime), uv (the uv Python package manager) or uv:<tool> (a tool installed with uv β€” e.g. uv:podman-compose, the fix for the broken podman-compose 1.3.0 that Debian 13 ships; see Installing Podman), or canasta itself. Not available in canasta-docker mode; see Help:Multi-node Kubernetes for the K8s topology rules
  • uninstall β€” remove a Kubernetes cluster from the target host (k8s: k3s, kubectl, helm, and the iptables rules). This is the only package uninstall accepts β€” the others are removed with the host's own package manager
  • doctor β€” check that the target host has all the dependencies the CLI expects
  • wiki-check β€” check that each of an instance's configured wikis actually answers over HTTP (see Help:Troubleshooting)
  • host β€” manage the saved-host inventory (add, list, remove)

Wikis inside an instance

A Canasta instance can run a single wiki or many (a wiki farm). These verbs manage which wikis live inside.

  • add β€” add a new wiki to an existing instance
  • remove β€” remove a wiki from an instance (without tearing the instance down)
  • import β€” import a SQL dump into an existing wiki (e.g., migrating from another MediaWiki install)
  • export β€” export a wiki's database

For the conceptual model of wiki farms, including subdomain vs path-based routing, see Help:Wiki farms.

Configuration

  • config β€” read or modify per-instance configuration (get, set, unset, refresh-template). get/set/unset persist in the instance's .env file; refresh-template adopts updated (or restores deleted) template-seeded config files such as config/default.vcl. To re-render an instance's configuration from its sources, use reconcile.

For configuration that lives in PHP settings rather than environment variables (LocalSettings.php-style), edit the per-wiki settings directory directly β€” see Help:General concepts.

Extensions and skins

  • extension β€” list / enable / disable extensions; add / remove extensions that aren't bundled (cloning them from git if needed); set-version to pin a GitOps-managed user extension to a branch, tag or commit
  • skin β€” list / enable / disable skins; add / remove skins that aren't bundled

add and remove are Docker Compose only. For details, and for installing extensions by hand, see Help:Extensions and skins.

Application sidecars

  • sidecar β€” declare and manage companion services the wiki talks to (a cache, a citation/parsing service, an app backend), in config/sidecars.yaml. Subverbs: add, list, remove, migrate. The same declaration renders on both Docker Compose and Kubernetes; run canasta restart to apply.

For the schema, image building, and the web environment bridge, see Help:Sidecars.

Maintenance

  • maintenance β€” run MediaWiki maintenance scripts (maintenance/update.php and the standard catalog) without exec-ing into the container manually. Subverbs: exec, extension, script, update.

Security

  • crowdsec β€” inspect and manage the CrowdSec behavioral threat-detection engine and its Caddy bouncer (status, ban, unban, bouncer-enroll, console-enroll, reload, scenarios, alerts, metrics). Enable it with canasta config set CANASTA_ENABLE_CROWDSEC=true; see Help:CrowdSec.

Backup and restore

  • backup β€” Restic-based backup operations: init, create, list, files, restore, diff, delete, check, unlock, purge, schedule (with set/list/remove), databases (with add/list/remove, to declare a wiki's extra databases, such as Cargo's).

For the conceptual model β€” what's captured, where it lands, RPO/RTO β€” see Help:Backup and restore and Help:Storage.

GitOps

  • gitops β€” manage instance configuration in a git repository for version-controlled, multi-environment workflows. Subverbs: init, join, add, rm, push, pull, sync, status, diff, fix-submodules.

For the source/sink role model and shared/per-host variable rules, see Help:GitOps.

Kubernetes-specific

  • storage β€” manage shared StorageClasses on the cluster (list, setup nfs, setup efs). See Help:Storage.
  • argocd β€” interact with the bundled Argo CD controller (password, apps, ui) when the cluster's API isn't reachable from the controller.
  • image β€” manage the in-cluster image registry (push a locally built image into it, prune images it no longer needs). image prune also works on a Docker Compose host, where it removes the Canasta images no instance on the host is pinned to, the --build-from images of instances that are not registered, and dangling layers. build-args, set-build-arg and unset-build-arg show and change the build arguments of an instance created with --build-from, on either orchestrator; see Changing build arguments.

Sitemaps

  • sitemap β€” generate or remove a wiki's sitemap.xml (generate, remove).

Upgrades

  • upgrade β€” update the CLI to the latest released version (or, with --dev, the latest development build), then upgrade all registered instances. See Help:Upgrading for the upgrade flow.

Development mode

  • devmode β€” toggle a development-friendly state (enable, disable) that mounts the MediaWiki source tree from the instance directory for live editing. Docker Compose only. See Help:Development mode.

Where to find per-command details

Every verb above links to its CLI: page, which is the canonical reference for that command β€” synopsis, parameters with types and defaults, examples, exit codes, and orchestrator-specific behavior. Those pages are auto-generated from the CLI's command definitions and stay in lockstep with the shipped tool, so they're the source of truth for "what does this flag actually do" questions.

This Help: page is the conceptual map; CLI: pages are the API reference. The two together cover every operation Canasta supports.

See also