Introduction
We've leaned on wf the whole way through — running apps, migrating
databases, extracting translations. This chapter steps back and looks at the CLI as a whole,
because it is the one tool you keep returning to, and the place where everything we built by
hand finally gets handed to you for free.
One command, many doors
The wf command is built on Typer and
groups its functionality into a small set of sub-commands:
$ wf --help
create Scaffold projects, apps and additives.
run Run an app from its config.
node Forward a command to the bundled Node runtime.
tailwind Forward a command to the Tailwind CLI.
migrate (extension) Manage Alembic migrations.
babel (extension) Extract translation catalogs.
The first four are built in. The last two are interesting: migrate and
babel aren't part of the core CLI at all — they are extension CLIs that
attach themselves to wf.
How extensions extend the CLI
Remember the very first thing we did in the Extensions chapter? We registered an extension
through the webfluid.extensions entry-point. That is exactly how
migrate and babel show up here: on startup the CLI walks every
installed entry-point in that group and mounts each extension's Typer app as a sub-command
named after it. Your own wf myext hello from back then worked for the same
reason.
So the CLI is open in both directions: the built-in commands cover the framework, and any extension you (or someone else) installs can graft its own commands on without you touching a thing. wf is as modular as the runtime it drives.
The map ahead
The next two chapters cover the two commands you'll reach for daily:
- Create — scaffolding projects, apps and Additives. This is where the whole documentation comes full circle.
- Run — running an app from its config, in plain, debug or interactive mode.
Continue reading
From here you can continue straight with Create.