Developer
News and Updates
Get Support
Sign in
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
assistant
build
containers
custom-scopes
deploy
developer-spaces
environments
install
manifest
module
providers
settings
show
site
skills
storage
variables
version
webtrigger
Last updated Nov 20, 2026

CLI overview

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
2
npm i -g @forge/cli@latest

To log in, run:

1
2
forge login

Local .forge directory

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
2
git 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:

  • Generated function code and runtime files used by the local tunnel.
  • A copy of your packaged runtime code when you use forge build --inspect or forge deploy --inspect.
  • Local application cache data.
  • Generated configuration and authentication material used for container tunneling.

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.

Non-interactive mode

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.

Turning it on

Pass --non-interactive to any command to turn it on for that run. Otherwise, the non-interactive setting decides:

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
2
forge settings set non-interactive off

To see the current value, run forge settings list.

Missing inputs

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.

Confirmations and secrets

  • Some commands that would ask you to confirm need --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.
  • Secrets are never passed as arguments. Pipe them in on stdin with the command's --read-* option, for example forge login --read-token or forge variables set --encrypt --read-secret-value.

Upgrading

To upgrade the Forge CLI, completely remove the Forge CLI and install it again.

1
2
3
npm uninstall -g @forge/cli
npm i -g @forge/cli@latest

Supported versions

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: