Skip to content

CLI Reference

The build-flags command is available after installing the expo-build-flags package. It is registered as a local bin, so it works in npm scripts and via npx without a global install.

Scaffold a new flags.yml and generate the initial runtime module.

Terminal window
build-flags init

Detects your source directory (src/ or app/) and sets mergePath accordingly. If a .gitignore exists, the generated module path is appended to it.

Generate the runtime module from flags.yml, optionally enabling or disabling specific flags.

Terminal window
build-flags override [+flag ...] [-flag ...]

Prefix a flag name with + to enable it or - to disable it. Flags not listed keep their default value from flags.yml.

Terminal window
# Use defaults
build-flags override
# Enable one flag, disable another
build-flags override +newCheckout -legacyAuth

Same as override, but also enables flags whose ota.branches patterns match the current CI branch.

Terminal window
build-flags ota-override [+flag ...] [-flag ...]

The branch is read from GITHUB_HEAD_REF (GitHub Actions) or CI_COMMIT_REF_NAME (GitLab CI). Manual +/- overrides are applied on top of branch-matched flags.

Skip execution if the named environment variable is set. Works with any command.

Terminal window
build-flags override --skip-if-env EAS_BUILD

If EAS_BUILD is present in the environment (any value), the command exits immediately as a no-op. This is useful for avoiding conflicts with the Config Plugin during EAS builds.