CLI Usage

Complete command reference for the Forge CLI.

Site Management

List Sites

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 Filter by environment (production, staging, development)
--org Filter by organisation ID (personal or 0 for personal sites)
--page Page number (shows single page instead of all results)
--limit Results per page (default: 100, max: 500)

Create a Site

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 Site name, 3–63 chars, alphanumeric and hyphens (required)
--custom Custom domain to assign
--org Create under an organisation

Link a Directory

forge add my-site.getforge.io           # Link current directory to a site
This writes the site URL to forge.json so subsequent commands know which site to target.

Site Info

forge info                               # Show info for linked site
forge info --site my-site.getforge.io    # Show info for a specific site

Displays site configuration including SSL, compiler, build settings, environment variables, current version, and deploy status.

Delete a Site

forge destroy                            # Delete the linked site (with confirmation)
forge destroy --site my-site.getforge.io # Delete a specific site
forge destroy --force                    # Skip confirmation prompt

Deployment

forge 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 name to deploy to
-m, --message Version description
-d, --directory 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.

Versions & Rollback

List Versions

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 name
--limit Versions per page (default: 20, max: 100)
--page Page number

Rollback

forge rollback --version-id 789          # Rollback to a specific version
forge rollback -s my-site --version-id 789
Option Description
-s, --site Site name
--version-id Version ID to rollback to (required, from forge versions output)

Site Settings

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 minification

Multiple settings can be updated in one call:

forge settings --ssl on --force-ssl on --compiler webpack --build-folder dist
Option Description
-s, --site Site name
--ssl off> Enable or disable SSL
--force-ssl off> Enable or disable forced HTTPS redirects
--compiler Compiler (nothing, hammer, jekyll, middleman, webpack)
--build-command Custom build command
--build-folder Build output folder
--squish off> Enable or disable TurboJS minification

Environment Variables

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 Set one or more KEY=VALUE pairs
forge env unset Remove one or more variables by key

All env commands accept -s, --site to target a specific site.

Domain Management

Check DNS

forge domain check --domain mysite.com   # Verify DNS is configured correctly
Returns the current DNS records and instructions for configuring your domain if they don't match.

Set Custom Domain

forge domain set --site-token abc123 --domain mysite.com
Option Description
--site-token Site token for the target site (required)
--domain Custom domain to assign (required)

Usage & Bandwidth

forge usage                              # Show bandwidth and build usage
forge usage --days 7                     # Include daily breakdown for last 7 days
Option Description
-s, --site Site name
--days Days of daily breakdown (default: 30, max: 365)

Displays bandwidth (today, this week, this month, last 30 days), build minutes, and monthly history.

Organisations

List Organisations

forge orgs                               # List your organisations

Switch Context

forge org switch --id 123                # Switch to an organisation
forge org switch --id personal           # Switch back to personal context

When you switch context, subsequent commands like forge sites and forge create operate within that organisation.

CI/CD Usage

GitHub Actions with CLI token:

- name: Deploy to Forge
  env:
    FORGETOKEN: ${{ secrets.FORGETOKEN }}
  run: |
    npm install -g @beachio/forge-cli
    forge deploy --json

GitHub Actions with site token (deploy-only access):

- name: Deploy to Forge
  env:
    FORGESITETOKEN: ${{ secrets.FORGESITETOKEN }}
  run: |
    npm install -g @beachio/forge-cli
    forge deploy --json

Command Reference

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 Revoke a CLI token
forge sites List your sites
forge create Create a new site
forge add 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

Join the Discussion

Have questions or want to share your experience? Join our community discussion to connect with other developers and get help from the Forge team.

Visit Forum Discussion