forge env-cmd
Run a command with resolved environment variables from the project config.
Command
forge env-cmd <command> [args...] [--app <name>]
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
| string | yes | Command to run |
| string[] | no | Arguments passed to the command |
Flags
| Flag | Type | Default | Notes |
|---|---|---|---|
| string | — | Resolve env vars for a specific app |
Examples
Run a script with project env vars:
forge env-cmd node my-script.js
Target a specific app:
forge env-cmd --app my-api pnpm test
Errors
| Exit code | Meaning |
|---|---|
| 0 | Command completed successfully |
| 1 | Failed to resolve environment or command |
Pitfalls
- Env resolution — environment variables are resolved from the project config's app definitions and secrets.
See also
{auto-injected}
Tested against
{auto-injected}