Skip to main content

wagtail-cli

🚧 This is a prototype / early MVP. Feedback very welcome! See CMS with AI, not AI CMS: Wagtail 8.0’s new API for context.

A command-line client for the Wagtail v3 API. Install it, point it at a Wagtail site's API, and drive CMS operations (pages, images, documents, snippets, sites, locales, redirects, schema) from your terminal — handy for automation and AI-orchestrated content management. It can also put the Wagtail documentation in your terminal: wt docs releases/8.0 prints the release notes as Markdown.

Installation

Pick the command for your preferred package installer. The console script is wt (the package name is wagtail-cli):

uv tool install wagtail-cli      # permanent install; then run `wt …`
uvx --from wagtail-cli wt       # one-shot, no install

Quick start

export WAGTAIL_CLI_BASE_URL="https://cms.example.com/api/v3/"
export WAGTAIL_CLI_TOKEN="your-api-token"

wt api whoami        # verify authentication
wt api pages list    # browse pages
wt api schema list   # discover page types

Or run wt api init once to save these to ~/.wagtail-cli.toml interactively.

Reading the Wagtail docs needs no configuration at all:

wt docs releases/8.0    # release notes, as Markdown
wt docs api             # index of v3 API operations
wt docs search picture  # search the docs

Create and publish a blog page from a Markdown file:

wt api pages create blog.BlogPage --parent /blog/ \
  --title "Hello world" --field body:@post.md --publish

Rich-text fields accept Markdown via a .md file reference: the value is sent to the API as {"format": "db_markdown", "content": …}.

Command surface

  • wt api … — all Wagtail v3 API operations (pages, images, documents, snippets, sites, locales, redirects, schema), plus wt api init and wt api whoami.
  • wt start … — scaffold a new Django/Wagtail project (mirrors wagtail start / django-admin startproject; default custom base-page template).
  • wt docs … — read docs.wagtail.org as Markdown: wt docs releases/8.0, wt docs api for the v3 API reference, wt docs search picture to search.
  • Delegation — any other wt <command> is forwarded to ./manage.py (if present) or django-admin (when DJANGO_SETTINGS_MODULE is set), so wt also fronts Django commands like wt runserver/wt makemigrations.
  • wt --version / wt --help — custom, enhanced with detected Wagtail/Django versions and ./manage.py --help when available.

Documentation

Development

just install           # set up the environment
just test              # run the test suite
just lint              # lint with Ruff
just test-integration  # run integration tests against a live site

See the development guide for details.

Metadata

Release files for wagtail-cli 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wagtail-cli 0.2.0
File Size Uploaded
wagtail_cli-0.2.0.tar.gz 22.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wagtail-cli 0.2.0
File Interpreter ABI Platform
wagtail_cli-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 58.2 kB

Release files / wagtail_cli-0.2.0.tar.gz

Download URL wagtail_cli-0.2.0.tar.gz
Size 22.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d30ee7ae42675e60ed8cfe5998ceb05e357f460687999fa64e76234e27632811
BLAKE2b-256 checksum
How to use checksums
a782c335bac1e929cb78a8687bd245358daf644a655c9f9c688a1ae4362a50ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / wagtail_cli-0.2.0-py3-none-any.whl

Download URL wagtail_cli-0.2.0-py3-none-any.whl
Size 35.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7b7375f509bf36ae72e9325869ed92aa97fdb2cde2d87caf3d26f1fe6816467
BLAKE2b-256 checksum
How to use checksums
d5385b8bc20292efc025cb9b1d12cbdc30130a572f6117ed8fd8a3a29821d729
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page