corgi exec
corgi exec
Run a one-off command inside a service's resolved environment
Synopsis
Run a one-off command in a service's working directory with the same env corgi uses for that service's start commands (its .env is sourced via the same mechanism, honoring autoSourceEnv). stdout/stderr stream through and the child's exit code becomes corgi's exit code.
Examples: corgi exec api -- npm run migrate corgi exec api --json -- pytest -q corgi exec api --ensure-deps -- npm run migrate
corgi exec <service> -- <cmd> [args...] [flags]
Options
--ensure-deps Wait for the service's depends_on_db and depends_on_services to be ready before running.
-h, --help help for exec
--ready-timeout duration Max time to wait for dependencies when --ensure-deps is set. (default 15s)
--service-branch stringArray Run a service on a git branch via a reused worktree under
corgi_services/.worktrees: --service-branch name=branch (repeatable).
Non-destructive — the main checkout is untouched. Clean up with: corgi worktree prune.
--service-checkout stringArray Run a service on a git branch by checking it out in place:
--service-checkout name=branch (repeatable). Refuses on a dirty tree; leaves the
repo on that branch afterwards.
--service-dir stringArray Override a service's working dir: --service-dir name=/path (repeatable),
e.g. a git worktree. The dir must exist.
Options inherited from parent commands
--describe Describe contents of corgi-compose file
--dockerContext string Specify docker context to use, can be default,orbctl,colima (default "default")
-l, --exampleList List examples to choose from. Click on any example to download it
-f, --filename string Custom filepath for for corgi-compose
--fromScratch Clean corgi_services folder before running
-t, --fromTemplate string Create corgi service from template url
--fromTemplateName string Create corgi service from template name and url
-g, --global Use global path to one of the services
--interactive Force interactive prompts even when no TTY/agent detected
--json Emit machine-readable JSON output
--privateToken string Private token for private repositories to download files
-o, --runOnce Run corgi once and exit
--silent Hide all welcome messages
SEE ALSO
- corgi - Corgi cli magic friend