The mf CLI
Preview mf is the command-line client for the
managed.dev API. It’s generated from the same
OpenAPI 3.1 spec as the SDKs and the
Terraform provider, so every command maps directly to a
/v1 endpoint and the tool never drifts from the platform. The CLI is free on
every plan — it’s just a client; what it can do is bounded by your
key’s scopes and your team role.
command reference
Section titled “command reference”Every command resolves to one or more /v1 calls and inherits that endpoint’s
required scope. Mutating commands accept --wait to follow the resulting
async job to completion and exit non-zero on failure.
| Command | Does | Endpoint(s) | Scope |
|---|---|---|---|
mf login |
Browser auth; mints a short-lived personal key | POST /v1/auth/login |
— |
mf sites list |
List your sites | GET /v1/sites |
sites:read |
mf deploy |
Deploy an environment, follow the job | POST …/deployments |
deployments:write |
mf env create |
Create a preview/staging environment | POST …/environments |
environments:write |
mf env rm |
Tear an environment down | DELETE …/environments/{id} |
environments:write |
mf logs --tail |
Live log stream over SSE | GET …/insights/logs/stream |
observability:read |
mf exec |
Run a command on an environment | POST …/exec |
wp.cli:exec |
mf exec save / run |
Save and replay a named bookmark | …/exec/bookmarks |
wp.cli:exec |
mf batch run |
Run a batch of bookmarks/commands | …/exec:batch |
wp.cli:exec |
mf listen --forward-to |
Forward webhook events to a local URL | GET /v1/events |
jobs:read |
mf backup / restore |
Snapshot and restore an environment | …/backups, …/snapshots/{id}/restore |
backups:write |
mf jobs watch |
Watch a job to completion | GET /v1/jobs/{id}/stream |
jobs:read |
Run mf <command> --help for the full flag list, or mf --help for the top-level
command tree.
sign in
Section titled “sign in”mf login opens your browser, authenticates against the dashboard, and mints a
short-lived, TTL’d personal key for the CLI — you never paste
a long-lived secret into your shell.
mf loginFor CI, skip the browser flow and pass a service token through the environment:
export FORGE_TOKEN="mfs_live_…"mf sites listdeploy and wait
Section titled “deploy and wait”mf deploy triggers a deployment and follows the job to
completion, streaming progress. It exits non-zero if the build or roll fails, so it
drops cleanly into a pipeline step.
~/acme-store ❯ mf deploy –site acme-store –env feature-checkout –wait → job_01J9F2KQ deployment queued build ████████████████ done roll ████████████████ done ✓ deployed env_01J8C4RX in 41shttps://acme-store-feature-checkout-9a3f.preview.managed.dev
Day-to-day you’ll still deploy 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/checkout --waitmf env rm --site acme-store --env feature-checkout --waitBoth are async jobs; --wait blocks 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 --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. The call returns a job; add --wait to stream
output to completion.
mf 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 --events site.deployed,deployment.failed \ --forward-to http://localhost:4000/webhooksThe original Forge-Signature header is preserved,
so your handler’s signature verification path runs
exactly as it will 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; a batch runs an ordered list of bookmarks (or raw commands) against a
target environment — handy 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