Command line interface for GetForge.com — deploy and manage your Forge sites from the terminal.
npm install -g @beachio/forge-cliRequires Node.js 18 or later.
# Log in with your Forge credentials
forge login
# Create a new site
forge create --name my-site
# Link your project directory to a site
forge add my-site.getforge.io
# Deploy
forge deployThese options apply to all commands:
| Option | Description |
|---|---|
--json |
Output results as JSON |
--quiet |
Suppress all output except errors |
--token <token> |
Authenticate with a CLI token |
--site-token <token> |
Authenticate with a site token |
-v, --version |
Show version |
--help |
Show help for any command |
Forge CLI supports multiple authentication methods for different workflows.
forge login # Prompts for email and password
forge login --email me@example.com # Prompts for password onlyforge login --with-token <cli-token> # Store a pre-existing CLI tokenforge login --browser # Opens browser for authenticationFor CI/CD pipelines and automation:
export FORGE_TOKEN=<cli-token> # CLI token for general access
export FORGE_SITE_TOKEN=<site-token> # Site token for deploy-only accessforge whoami # Show current user, token type, and org contextforge logout # Clear stored credentialsCreate scoped tokens for CI/CD and AI agents:
# Full-access token
forge token create
# Scoped deploy token for specific sites
forge token create --name "CI Deploy" --scopes sites:deploy --site-ids 101,102
# Short-lived token for AI agents
forge token create --name "AI Agent" --scopes sites:deploy --site-ids 101 --expires-in-days 7
# List active tokens
forge token list
# Revoke a token
forge token revoke <id>| Option | Description | Default |
|---|---|---|
--name <name> |
Human-readable label | — |
--scopes <scopes> |
Comma-separated scopes | unrestricted |
--site-ids <ids> |
Comma-separated site IDs to restrict access | all sites |
--expires-in-days <n> |
Days until token expires | 90 |
| Scope | Grants |
|---|---|
sites:read |
List sites, view version info |
sites:write |
Create new sites |
sites:deploy |
Deploy to sites |
forms:read |
Read form submissions |
analytics:read |
Read site analytics |
bandwidth:read |
Read bandwidth usage |
organisations:read |
Read organisations |
organisations:write |
Manage organisations |
Tokens created with no scopes have unrestricted access.
forge sites # List all your sites
forge sites --org personal # Personal sites only
forge sites --org 123 # Sites under an organisation
forge sites --environment production # Filter by environment
forge sites --page 1 --limit 20 # Paginate results| Option | Description |
|---|---|
--environment <env> |
Filter by environment (production, staging, development) |
--org <id> |
Filter by organisation ID (personal or 0 for personal sites) |
--page <n> |
Page number (shows single page instead of all results) |
--limit <n> |
Results per page (default: 100, max: 500) |
forge create --name my-site # Create a site at my-site.getforge.io
forge create --name my-app --custom mysite.com # With a custom domain
forge create --name my-site --org 123 # Under an organisation| Option | Description |
|---|---|
--name <name> |
Site name, 3–63 chars, alphanumeric and hyphens (required) |
--custom <domain> |
Custom domain to assign |
--org <id> |
Create under an organisation |
forge add my-site.getforge.io # Link current directory to a siteThis writes the site URL to forge.json so subsequent commands know which site to target.
forge info # Show info for linked site
forge info --site my-site.getforge.io # Show info for a specific siteDisplays site configuration including SSL, compiler, build settings, environment variables, current version, and deploy status.
forge destroy # Delete the linked site (with confirmation)
forge destroy --site my-site.getforge.io # Delete a specific site
forge destroy --force # Skip confirmation promptforge deploy # Deploy the linked site
forge deploy -m "added new page" # Deploy with a version message
forge deploy -d ./build # Deploy a specific directory
forge deploy --site my-site.getforge.io # Deploy to a specific site
forge deploy --no-watch # Skip real-time deploy tracking| Option | Description |
|---|---|
-s, --site <site> |
Site name to deploy to |
-m, --message <msg> |
Version description |
-d, --directory <dir> |
Directory to deploy (overrides forge.json) |
--no-watch |
Skip real-time deploy log streaming |
Deploys create a zip archive of your project, upload it, and stream real-time build logs back to the terminal. Use --no-watch to fire and forget.
forge versions # List version history for linked site
forge versions --site my-site # For a specific site
forge versions --limit 50 --page 2 # Paginate results| Option | Description |
|---|---|
-s, --site <site> |
Site name |
--limit <n> |
Versions per page (default: 20, max: 100) |
--page <n> |
Page number |
forge rollback --version-id 789 # Rollback to a specific version
forge rollback -s my-site --version-id 789| Option | Description |
|---|---|
-s, --site <site> |
Site name |
--version-id <id> |
Version ID to rollback to (required, from forge versions output) |
forge settings --ssl on # Enable SSL
forge settings --ssl off # Disable SSL
forge settings --force-ssl on # Force HTTPS redirects
forge settings --compiler jekyll # Set compiler mode
forge settings --build-command "npm run build" # Set custom build command
forge settings --build-folder dist # Set build output folder
forge settings --squish on # Enable TurboJS minificationMultiple settings can be updated in one call:
forge settings --ssl on --force-ssl on --compiler webpack --build-folder dist| Option | Description |
|---|---|
-s, --site <site> |
Site name |
--ssl <on|off> |
Enable or disable SSL |
--force-ssl <on|off> |
Enable or disable forced HTTPS redirects |
--compiler <compiler> |
Compiler (nothing, hammer, jekyll, middleman, webpack) |
--build-command <cmd> |
Custom build command |
--build-folder <folder> |
Build output folder |
--squish <on|off> |
Enable or disable TurboJS minification |
forge env # List environment variables
forge env set NODE_ENV=production # Set a variable
forge env set KEY1=val1 KEY2=val2 # Set multiple at once
forge env unset API_KEY # Remove a variable
forge env unset KEY1 KEY2 # Remove multiple| Command | Description |
|---|---|
forge env |
List all environment variables for the site |
forge env set <pairs...> |
Set one or more KEY=VALUE pairs |
forge env unset <keys...> |
Remove one or more variables by key |
All env commands accept -s, --site <site> to target a specific site.
forge domain check --domain mysite.com # Verify DNS is configured correctlyReturns the current DNS records and instructions for configuring your domain if they don't match.
forge domain set --site-token abc123 --domain mysite.com| Option | Description |
|---|---|
--site-token <token> |
Site token for the target site (required) |
--domain <domain> |
Custom domain to assign (required) |
forge usage # Show bandwidth and build usage
forge usage --days 7 # Include daily breakdown for last 7 days| Option | Description |
|---|---|
-s, --site <site> |
Site name |
--days <n> |
Days of daily breakdown (default: 30, max: 365) |
Displays bandwidth (today, this week, this month, last 30 days), build minutes, and monthly history.
forge orgs # List your organisationsforge org switch --id 123 # Switch to an organisation
forge org switch --id personal # Switch back to personal contextWhen you switch context, subsequent commands like forge sites and forge create operate within that organisation.
forge init # Create forge.json interactively
forge init --force # Overwrite existing forge.jsonCreates a forge.json in your project root:
{
"site": "my-site.getforge.io",
"deploy_directory": ".",
"compiler": "none",
"ignore": ["node_modules", ".git", ".env"]
}| Property | Description |
|---|---|
site |
Site URL to deploy to |
site_token |
Site token (optional, alternative to CLI token) |
deploy_directory |
Directory to deploy (default: .) |
compiler |
Compiler mode (none, jekyll, middleman, etc.) |
ignore |
Patterns to exclude from deployment |
You can create a .forgeignore file with gitignore-style patterns to exclude files from deployment. This works alongside the ignore array in forge.json.
For commands that operate on a site, the target is resolved in this order:
--siteflag on the command--site-tokenglobal optionsiteorsite_tokeninforge.json- Stored site tokens from login
forge sites --json # JSON output for scripting and CI/CD
forge deploy --quiet # Minimal output, exit codes onlyAll commands support --json and --quiet. JSON mode outputs structured data suitable for piping to jq or consuming from scripts and AI agents.
# GitHub Actions example
- name: Deploy to Forge
env:
FORGE_TOKEN: ${{ secrets.FORGE_TOKEN }}
run: |
npm install -g @beachio/forge-cli
forge deploy --jsonFor deploy-only access with a site token:
- name: Deploy to Forge
env:
FORGE_SITE_TOKEN: ${{ secrets.FORGE_SITE_TOKEN }}
run: |
npm install -g @beachio/forge-cli
forge deploy --json| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Authentication failure |
| 3 | Insufficient token scope |
| 4 | Rate limited |
| Command | Description |
|---|---|
forge login |
Authenticate with Forge |
forge logout |
Clear stored credentials |
forge whoami |
Show current auth status |
forge token create |
Create a scoped CLI token |
forge token list |
List active CLI tokens |
forge token revoke <id> |
Revoke a CLI token |
forge sites |
List your sites |
forge create |
Create a new site |
forge add <site> |
Link directory to a site |
forge info |
Show site details |
forge destroy |
Delete a site |
forge deploy |
Deploy to Forge |
forge versions |
List version history |
forge rollback |
Rollback to a previous version |
forge settings |
Update site settings |
forge env |
List environment variables |
forge env set |
Set environment variables |
forge env unset |
Remove environment variables |
forge domain check |
Check DNS configuration |
forge domain set |
Assign a custom domain |
forge usage |
Show bandwidth and build usage |
forge orgs |
List organisations |
forge org switch |
Switch organisation context |
forge init |
Create forge.json |
git clone https://github.com/beachio/forge-cli.git
cd forge-cli
npm install
npm run build
npm run dev # Watch modeMIT — Beach.io