The Forge CLI is the command line interface for building and deploying Forge apps.
For detailed instructions on setting up your Forge development environment, refer to our getting started guide.
To install the CLI, run:
1 2npm i -g @forge/cli@latest
To log in, run:
1 2forge login
The Forge CLI and local runtime can create a .forge directory in your app's root directory during development. This is expected: it holds generated files and local working data for tasks such as tunneling and inspecting packaged code. Its contents depend on the commands you run and the features your app uses, and can change between CLI versions.
Do not commit .forge to source control. Add the following entry to your app's .gitignore file:
1 2.forge/
If files in this directory are already tracked by Git, adding an ignore rule does not untrack them. Run the following command from your app's root directory to stop tracking them while keeping your local files:
1 2git rm -r --cached .forge/
Commit the staged removals together with your .gitignore change. This does not remove files from Git history; if you have committed credentials, revoke or rotate them.
The directory can contain:
forge build --inspect or forge deploy --inspect.Treat these as CLI-managed files, not app source files to edit or share. They can contain sensitive information, including resolved app configuration and authentication tokens.
Stop any active tunnels before removing .forge. Generated files are recreated when needed, but removing the directory also discards local cache data and saved inspection output. Some files can remain after a command finishes.
In non-interactive mode, Forge CLI commands never wait for input. When a command needs a value you haven't provided, it fails with an error instead. In most cases, the error lists every missing option and the command to run next. Use it in scripts, CI/CD pipelines and AI coding agents.
Pass --non-interactive to any command to turn it on for that run. Otherwise, the non-interactive setting decides:
| Value | Behaviour |
|---|---|
auto (default) | On when a known AI coding agent, such as Claude Code or Rovo Dev, runs the CLI. Off otherwise. Agents are detected with @vercel/detect-agent, plus Rovo Dev and Windsurf. |
on | Always on. |
off | Off unless you pass --non-interactive. |
Change the setting with forge settings set non-interactive <auto|on|off>, or set the FORGE_NON_INTERACTIVE environment variable to one of these values, which overrides the saved setting.
When you run the CLI yourself in a terminal, or in CI/CD pipelines and scripts, non-interactive mode stays off unless you turn it on. To get prompts even when an agent runs the CLI, run:
1 2forge settings set non-interactive off
To see the current value, run forge settings list.
When a command is missing required values, it fails with a MISSING_INPUT error that lists all of them at once and ends with a Next: command that includes the options you already passed:
1 2 3 4 5 6 7 8$ forge feedback --non-interactive Error: [MISSING_INPUT] Missing required inputs for non-interactive mode. Missing inputs: • -m, --message <message> the feedback to send Next: forge feedback --message <message> --non-interactive
Replace the placeholders in the Next: command with your values and run it.
--force in non-interactive mode, such as forge uninstall --batch, forge autocomplete install and forge assistant on. Without it, forge uninstall --batch lists the installations it would uninstall and stops.--read-* option, for example forge login --read-token or forge variables set --encrypt --read-secret-value.To upgrade the Forge CLI, completely remove the Forge CLI and install it again.
1 2 3npm uninstall -g @forge/cli npm i -g @forge/cli@latest
Each CLI version will only be supported 6 months after release. After this period, the CLI version will be no longer be supported. We recommend regularly updating to the latest CLI version to benefit from new features and improvements.
Rate this page: