Docs/CLI & MCP

CLI Installation & Auth

Install the Forge CLI, authenticate via browser, and verify your setup.

The Forge CLI is how developers interact with tickets from the terminal. This page covers installation, authentication, and credential management.

Installation

Install globally via npm:

bashnpm install -g forge-aec

Verify the installation:

bashforge --version

🚧 Requires Node.js 20 or later. Run node --version to check.

Updating

Update to the latest version:

bashnpm update -g forge-aec

Verify the update:

bashforge --version

📘 We recommend updating regularly — new features and bug fixes ship frequently.

Authentication

forge login

Authenticate using a browser-based device code flow:

bashforge login

Terminal transcript:

$ forge login

  Forge CLI — Authentication

  Opening browser for authentication...

  Enter this code when prompted:
    ABCD-1234

  Waiting for authorization...

  Success! Authenticated as jane@example.com

How it works:

  1. The CLI generates a device code and opens your browser
  2. You log in to Forge (Google or GitHub OAuth) in the browser
  3. Enter the device code shown in the terminal
  4. The CLI receives an access token and refresh token
  5. Credentials are saved to ~/.forge/config.json

📘 If the browser doesn't open automatically, copy the URL from the terminal and paste it into your browser.

Where Credentials Live

OSPathPermissions
macOS / Linux~/.forge/config.json0600 (owner read/write only)
Windows%USERPROFILE%\.forge\config.jsonStandard user permissions

Credentials are stored securely with restricted file permissions. Tokens refresh automatically in the background.

🚧 Never share or commit your config file. It contains authentication tokens.

Verify Identity

forge whoami

Check who you're authenticated as:

bashforge whoami
$ forge whoami
Email:  jane@example.com
Team:   Acme Corp
Token:  Valid (expires in 29d)

If your token is expired, the CLI automatically refreshes it on the next API call. If the refresh token is also expired, you'll need to run forge login again.

Logout

forge logout

Clear stored credentials:

bashforge logout
$ forge logout
Logged out successfully.

This clears all stored credentials.

Diagnostics

forge doctor

Run 6 diagnostic checks to verify your setup:

bashforge doctor
$ forge doctor

  Forge Doctor — Checking your setup

  1. Config file        OK
  2. Authenticated      jane@example.com           OK
  3. API reachable      OK
  4. Token valid        Expires in 29d             OK
  5. Claude CLI         Installed                  OK
  6. MCP registered     Configured                 OK

  All 6 checks passed. You're ready to go.

What each check does:

CheckWhat It VerifiesFix If Failed
Config fileCredentials file exists and is validRun forge login
AuthenticatedYou're signed inRun forge login
API reachableConnection to Forge servers succeedsCheck your network
Token validAuth token is not expiredAutomatic refresh, or forge login
Claude CLIClaude Code is installedInstall Claude Code
MCP registeredMCP server is configured for your AI assistantRun forge mcp install

👍 Run forge doctor first whenever something isn't working. It catches the most common issues.