The mf CLI
Preview mf is the official managed.dev
command-line client. It’s generated from the same OpenAPI 3.1 spec as the
public API and the SDKs, so every command maps to an
endpoint and the CLI never drifts from the platform. It’s free on every plan — the
CLI is just a client; what it can do is governed by your
API key’s scopes and your role.
sign in
Section titled “sign in”mf login opens your browser, authenticates against the dashboard, and mints a
short-lived, TTL’d API key for the CLI to use — you never paste a long-lived secret
into your shell.
mf loginFor CI, skip the browser flow and pass a service token via the environment instead:
export FORGE_TOKEN="mfs_live_…"mf sites listdeploy
Section titled “deploy”mf deploy triggers a deployment for an environment and follows the resulting
async job to completion, streaming progress as it goes.
mf deploy --site acme-store --env feature-checkout --waitThe command returns non-zero if the build or roll fails, so it drops cleanly into a
pipeline step. Day-to-day, you’ll still deploy most changes with
git push managed — mf deploy is for scripting and
re-deploys.
manage environments
Section titled “manage environments”mf env create --site acme-store --branch feature/checkoutmf env rm --site acme-store --env feature-checkoutBoth are async jobs; add --wait to block until the environment is live or fully
removed. See environment lifecycle for how creation,
sleeping, and teardown work.
tail logs
Section titled “tail logs”mf logs --tail streams an environment’s logs over
server-sent events — it stays open and prints lines as
they arrive, like tail -f.
mf logs --site acme-store --env production --tailmf logs --site acme-store --env production --tail --since 15m --level errorrun a command on an environment
Section titled “run a command on an environment”mf exec runs a command inside an environment — the same surface as a
WP-CLI shell, but driven by the API and gated by the
wp.cli:exec scope.
mf exec --site acme-store --env feature-checkout -- wp plugin list --status=activemf exec --site acme-store --env staging -- \ wp search-replace 'staging.example.com' 'example.com' --dry-runforward webhooks to localhost
Section titled “forward webhooks to localhost”mf listen subscribes to your team’s events and forwards
them to a local URL, so you can develop a webhook handler
against real site.deployed, build.succeeded, and malware.detected events
without exposing a public endpoint.
mf listen --forward-to http://localhost:4000/webhooksmf listen --events site.deployed,deployment.failed \ --forward-to http://localhost:4000/webhooksSignatures are verified locally and the original
Forge-Signature header is preserved, so your
handler’s verification path is exercised exactly as it will be in production.
saved exec bookmarks and batch
Section titled “saved exec bookmarks and batch”Frequently-run mf exec invocations can be saved as named bookmarks and replayed
by name, and a batch file runs a list of bookmarks (or raw commands) in order
against a target environment — useful for a repeatable post-deploy checklist.
mf exec save flush-and-warm --site acme-store -- \ sh -c 'wp cache flush && wp rewrite flush'mf exec run flush-and-warm --env stagingmf batch run post-deploy.batch --site acme-store --env production