CLI Reference
Complete reference for all EMB commands.
Global Options
Section titled “Global Options”These options are available on every command:
| Option | Env Var | Description |
|---|---|---|
-C, --root <path> | EMB_ROOT | Run as if emb was started in <path> |
--verbose / --no-verbose | EMB_VERBOSE | Enable verbose output |
--help | — | Show help for command |
Two more options are widely available but not universal. Passing one to a
command that doesn’t accept it fails with Nonexistent flag, so their scope is
listed below. emb <command> --help is always authoritative.
—flavor
Section titled “—flavor”--flavor <name> (env var: EMB_FLAVOR) selects a flavor.
It is accepted by:
up, down, start, stop, restart, ps, components, config print,
images, images push, resources, resources build, resources publish,
secrets, secrets providers, secrets validate
It is not accepted by clean, components shell, containers,
containers prune, images delete, images prune, logs, logs archive,
tasks, tasks run, or any kubernetes command.
emb run does not support flavors. emb run is an alias of emb tasks run,
which has no --flavor flag — and because the flag doesn’t exist there, EMB_FLAVOR
is ignored too, silently. EMB_FLAVOR=production emb run api:test runs the task
against the base configuration and prints no warning.
--json formats output as JSON. It is available on every command except:
ps, logs, components shell, kubernetes ps, kubernetes restart,
kubernetes logs, kubernetes shell
Environment Variables
Section titled “Environment Variables”Any flag with an env-var fallback is resolved in the following order (first non-empty value wins):
- The CLI flag, if provided
- The environment variable
- The command’s built-in default
This lets you set defaults in your shell (or CI pipeline) and still override them on individual invocations:
export EMB_FLAVOR=productionexport EMB_VERBOSE=1
emb resources build # uses the production flavor, verboseemb resources build --flavor staging # flag overrides EMB_FLAVORemb resources build --no-verbose # flag overrides EMB_VERBOSEAn environment variable only reaches commands that declare the matching flag.
EMB_ROOT and EMB_VERBOSE are honored everywhere, but EMB_FLAVOR is read only
by the commands listed under --flavor above — notably not by
emb run. Exporting EMB_FLAVOR in CI does not flavor your task runs.
For Kubernetes commands, the namespace also honors the K8S_NAMESPACE environment variable — see Kubernetes Integration.
Core Commands
Section titled “Core Commands”emb up
Section titled “emb up”Start the project services.
emb up [SERVICE...] [OPTIONS]Arguments:
SERVICE...- Optional services to start (defaults to all)
Options:
-f, --force- Bypass build caches (force-rebuild all resources) and force recreation of containers-j, --jobs <n|auto>- Build up tonresources in parallel, orautofor min(CPU count, 4). Defaults to serial (1).-k, --keep-going- After a failure, keep building resources that don’t depend on the failed one. Off by default (fail-fast).--flavor <name>- Use a specific flavor
emb up builds any required resources before starting the services. --jobs and
--keep-going apply to that build phase only — they do not affect how the
services themselves are started. See
Parallel builds for details.
-f also applies to both phases, so emb up -f is a full no-cache rebuild of
every resource — not just a docker compose --force-recreate. Reach for it only
when you mean it.
Examples:
emb up # Start all servicesemb up api web # Start specific servicesemb up --flavor production # Start with production configemb up -f # Force rebuild resources and recreate containersemb up -j auto # Build resources in parallel, then startemb down
Section titled “emb down”Stop and remove the project’s containers (defaults to all).
emb down [SERVICE...]Arguments:
SERVICE...- Optional services to stop and remove (defaults to all)
emb start
Section titled “emb start”Start existing (already created) project containers without recreating them.
emb start [SERVICE...]Arguments:
SERVICE...- Optional services to start (defaults to all)
emb stop
Section titled “emb stop”Stop project containers without removing them (contrast with emb down, which removes them).
emb stop [SERVICE...]Arguments:
SERVICE...- Optional services to stop (defaults to all)
emb restart
Section titled “emb restart”Restart project services.
emb restart [SERVICE...] [OPTIONS]Arguments:
SERVICE...- Optional services to restart (defaults to all)
Options:
-f, --no-deps- Don’t restart dependent services (note: the short form is-f, and it does not mean “force” as it does onemb up)
emb ps
Section titled “emb ps”List running containers.
emb ps [OPTIONS]Options:
-a, --all- Show all stopped containers
emb ps does not support --json.
emb logs
Section titled “emb logs”View container logs.
emb logs [SERVICE...] [OPTIONS]Arguments:
SERVICE...- Optional services to show logs for (defaults to all)
Options:
-f, --follow / --no-follow- Follow log output (default: true)
Examples:
emb logs # Follow logs for all containersemb logs api # Follow API logsemb logs api web # Follow logs for multiple servicesemb logs --no-follow api # Get log snapshot without followingemb logs archive
Section titled “emb logs archive”Archive docker compose logs to files (one file per service).
emb logs archive [SERVICE...] [OPTIONS]Arguments:
SERVICE...- Optional services to archive logs for (defaults to all)
Options:
-t, --timestamps- Include timestamps in logs (default: false)--tail <n>- Number of lines to show from the end of the logs-o, --output <dir>- Output directory for log files (defaults to.emb/<flavor>/logs/docker/compose)
Examples:
emb logs archive # Archive logs for all servicesemb logs archive api web # Archive logs for specific servicesemb logs archive --timestamps # Include timestampsemb logs archive --tail 1000 # Only the last 1000 lines per serviceemb shell
Section titled “emb shell”Get a shell in a running container.
emb shell <SERVICE> [OPTIONS]Arguments:
SERVICE- The service to get a shell on (required)
Options:
-s, --shell <shell>- The shell to run (default:bash)
Examples:
emb shell api # bash shell in the api containeremb shell api -s sh # for images without bash (e.g. alpine)emb clean
Section titled “emb clean”Tear the project down and remove its containers, images and EMB store (logs/sentinels).
Runs down, containers prune, images delete and images prune in sequence.
emb clean [OPTIONS]Options:
-f, --force- Force the deletion of containers & images (also prunes all project images, not just dangling ones)
Build Commands
Section titled “Build Commands”emb resources build
Section titled “emb resources build”Build project resources (images, files).
emb resources build [RESOURCE...] [OPTIONS]Arguments:
RESOURCE...- Optional resources to build (defaults to all)
Options:
-f, --force- Force rebuild, bypass cache-j, --jobs <n|auto>- Build up tonresources in parallel, orautofor min(CPU count, 4). Defaults to serial (1). Overridesdefaults.build.concurrency.-k, --keep-going- After a failure, keep building resources that don’t depend on the failed one. Off by default (fail-fast).--dry-run- Show what would be built without building--publishable- Only build resources marked as publishable (and their dependencies)--flavor <name>- Use a specific flavor
Examples:
emb resources build # Build allemb resources build api:image # Build specific resourceemb resources build -f # Force rebuild allemb resources build --flavor production # Build for productionemb resources build --publishable # Build only publishable resourcesemb resources build -j 4 # Build up to 4 resources in parallelemb resources build --jobs auto # Parallelism = min(CPU count, 4)emb resources build -j auto -k # Parallel, don't stop at the first failureParallel builds
Section titled “Parallel builds”By default EMB builds resources one at a time. Pass -j/--jobs to build several
at once, or set defaults.build.concurrency
in .emb.yml to make it the default for your project. The flag wins over the config.
Dependency order is always respected, whatever the concurrency: a resource starts
only once all of its dependencies have finished successfully, so only
independent resources ever run at the same time. Raising --jobs can therefore
speed up a wide dependency graph a lot and a deep, narrow one not at all. Resources
still waiting on a dependency show Waiting for <deps> while they queue.
auto resolves to min(CPU count, 4). The cap is deliberately conservative because
builds are usually IO- and daemon-bound rather than CPU-bound — Docker already
parallelises work internally, so a high --jobs can oversubscribe the daemon and
end up slower.
When a build fails
Section titled “When a build fails”By default builds are fail-fast: on the first failure EMB stops starting new
resources, lets the ones already running finish, and skips the rest. With
-k/--keep-going it instead keeps building everything that doesn’t depend on the
failure; only the failed resource’s dependents are skipped, since building them
against a missing dependency would be meaningless.
Either way the command exits non-zero and ends with a BUILD_FAILED summary
naming every resource that failed and every dependent that was skipped:
Failed to build: api:image. Skipped dependent(s): api:bundle. (<the first error>)Each failing resource’s own output is shown above the summary.
emb resources publish
Section titled “emb resources publish”Publish resources to their registries (e.g., push Docker images).
emb resources publish [RESOURCE...] [OPTIONS]Arguments:
RESOURCE...- Optional resources to publish (defaults to all publishable)
Options:
--dry-run- Show what would be published without publishing--flavor <name>- Use a specific flavor
Only resources with publish: true in their configuration are published. The registry and tag can be configured via defaults.docker.publish or per-resource params.publish.
Examples:
emb resources publish # Publish all publishable resourcesemb resources publish api:image # Publish specific resourceemb resources publish --dry-run # Preview without pushingemb resources publish --flavor production # Publish with production configList Commands
Section titled “List Commands”emb components
Section titled “emb components”List discovered components.
emb componentsTakes no options beyond the global ones. The container columns (NAME, ID,
CREATED, STATUS) are filled in from the component’s running container, if any,
and are blank for components that aren’t currently up. NAME is the container
name as reported by Docker, so it carries a leading /; the component name is in
the COMPONENT column.
Example output:
COMPONENT NAME ID CREATED STATUS api /myapp-api-1 fe0648593184 2 hours ago Up 2 hours web /myapp-web-1 8c7d6e5f4a3b 2 hours ago Up 2 hoursemb resources
Section titled “emb resources”List all resources.
emb resources [OPTIONS]Options:
--publishable- Only show resources marked as publishable
Example output:
ID NAME TYPE PUBLISHABLE REFERENCE api:image image docker/image ✓ myapp/api:latest web:image image docker/image ✓ myapp/web:latestemb tasks
Section titled “emb tasks”List available tasks.
emb tasks [OPTIONS]Example output:
NAME COMPONENT DESCRIPTION ID test api Run API tests api:test build web Build frontend web:buildemb images
Section titled “emb images”List Docker images for the project.
emb images [OPTIONS]Options:
-a, --all- Show all images. Only images from a final layer (no children) are shown by default.
emb containers
Section titled “emb containers”List Docker containers for the project.
emb containers [OPTIONS]Options:
-a, --all- Return all containers. By default, only running containers are shown.
Task Commands
Section titled “Task Commands”emb run
Section titled “emb run”Run one or more tasks.
emb run <TASK...> [OPTIONS]Arguments:
TASK...- Task IDs or names to run
Options:
-x, --executor <type>- Force executor:local,container, orkubernetes-a, --all-matching- Run all tasks matching name
Examples:
emb run test # Run task by nameemb run api:test # Run specific component taskemb run test --all-matching # Run all 'test' tasksemb run deploy -x local # Force local executionemb run migrate -x kubernetes # Run on Kubernetes podConfiguration Commands
Section titled “Configuration Commands”emb config print
Section titled “emb config print”Print the resolved configuration.
emb config print [OPTIONS]Useful for debugging configuration issues.
Examples:
emb config print # Print full configemb config print --flavor production # Print production configUtility Commands
Section titled “Utility Commands”emb autocomplete
Section titled “emb autocomplete”Set up shell autocompletion.
emb autocomplete [SHELL]Supported shells: bash, zsh, fish
emb update
Section titled “emb update”Update EMB to the latest version.
emb updateemb help
Section titled “emb help”Show help for a command.
emb help [COMMAND]Command Topics
Section titled “Command Topics”Some commands are grouped into topics with subcommands:
components
Section titled “components”emb components # List componentsemb components shell # Get shell in service (alias: emb shell)emb logs # View service logsemb logs archive # Archive service logs to filesresources
Section titled “resources”emb resources # List resourcesemb resources build # Build resourcesemb resources publish # Publish resources to registriesemb tasks # List tasksemb tasks run # Run tasks (alias: emb run)images
Section titled “images”emb images # List imagesemb images delete # Delete imagesemb images prune # Prune unused imagesemb images push # [DEPRECATED] Push images — use `emb resources publish` insteadcontainers
Section titled “containers”emb containers # List containersemb containers prune # Prune stopped containersconfig
Section titled “config”emb config print # Print configurationsecrets
Section titled “secrets”EMB discovers secret references (${vault:...}, ${op:...}) across .emb.yml and all component Embfiles.
emb secrets # List secret references in configurationemb secrets validate # Validate that secrets can be resolvedemb secrets providers # Show configured secret providersCommon flags:
--flavor <name>- Evaluate against a specific flavor--json- Machine-readable output
emb secrets
Section titled “emb secrets”Lists every secret reference found in the config (aggregated by provider + path + key), along with usage count and the component(s) that reference it. Values are never fetched or displayed.
PROVIDER PATH KEY COMPONENT USAGECOUNT vault secret/myapp/database url api 2 op Production/db-credentials password api 1emb secrets validate
Section titled “emb secrets validate”Attempts to resolve each reference against its provider and reports pass/fail per secret, without printing values. Useful in CI to catch missing or renamed secrets before deploy.
Additional flag:
--fail-fast- Stop on the first validation error
emb secrets providers
Section titled “emb secrets providers”Shows configured secret providers and their connection status (e.g. vault, op). Handy for diagnosing auth/connectivity issues before running validate.
See Secrets Management for provider configuration, authentication methods (including OIDC with cached tokens), and reference syntax.
kubernetes
Section titled “kubernetes”emb kubernetes shell <COMPONENT> # Open shell in podemb kubernetes logs <COMPONENT> # View pod logsemb kubernetes ps # List all pods in the namespaceemb kubernetes restart [DEPLOYMENT...] # Restart deployments (all in the namespace if omitted)emb kubernetes ps is namespace-scoped, not component-scoped: it lists every pod
in the target namespace, and any argument you pass it is ignored.
emb kubernetes restart takes Kubernetes deployment names as they exist in the
cluster — not EMB component names. Omit the argument and it restarts every
deployment in the target namespace.
Common options:
-n, --namespace <name>- Target namespace
See Kubernetes Integration for detailed usage.
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error (build/task failure, unresolvable reference, unknown command, …) |
| 2 | Invalid invocation — unknown flag, bad flag value, or a missing required argument |
An unknown command exits 1, not 2: emb foo falls through to emb tasks run,
which reports Unknown reference `foo` with the code UNKNOWN_REF.