wagtail-cli¶
A command-line client for the Wagtail v3 API
wagtail-cli is a command-line client for the Wagtail
v3 API. Install it, point it at a site's API, and your CMS is available from
the terminal — for local dev, live sites, and AI agents. wt docs puts
docs.wagtail.org in your terminal as Markdown.
This documentation covers installation, usage, and the package's internals.
Features¶
- All Wagtail v3 API operations from one command:
pages,images,documents,snippets,sites,locales,redirects, andschema, pluswt api initandwt api whoamifor setup. - Script-friendly conventions: JSON when piped and human-readable on a
terminal,
--dry-runon every mutating command, confirmation gates with--yes, and descriptive exit codes. - Markdown-first content: rich-text fields accept Markdown via
.mdfile references, sent to the API asdb_markdown. wt docs— docs.wagtail.org as Markdown: release notes, the v3 API reference, and search. Needs no configuration at all.wt start— scaffold a new Django/Wagtail project.- Delegation — any unknown
wt <command>is forwarded to the current project's Django management runner, sowtalso fronts Django commands likewt runserverandwt makemigrations.
When to use it¶
Use wt to manage a Wagtail site without opening the admin: batch content
updates, content checks in CI, scripted publishing, or AI-orchestrated content
management. For example, publishing a blog post written in Markdown is one
command:
wt api pages create blog.BlogPage --parent /blog/ \
--title "Hello world" --field body:@post.md --publish
Where to go next¶
- New to
wt? Follow Getting started to install it and publish your first page. - Looking up a command? Browse the command reference for every command and flag.
- Scripting the CLI? See Configuration for the config cascade, and the API reference built from the source docstrings.
- Working with an agent? See Agent skills for the machine-readable skill published with these docs.
- Contributing? Read the contribution guidelines and the development guide, and follow the documentation style guide when writing docs.
License¶
wagtail-cli is licensed under the BSD-3-Clause license. See LICENSE for details.