The forge CLI
A single-file Node.js script. Push and pull projects to Forge from your terminal — no Git required.
1 · Install as `forge`
One-liner — downloads the CLI and installs it as forge on your $PATH (Node 18+ required):
curl -fsSL https://forgeinit.app/forge-cli.mjs -o /usr/local/bin/forge \ && chmod +x /usr/local/bin/forge \ && forge help
No write access to /usr/local/bin? Install to your home dir instead:
Bash:
mkdir -p ~/.local/bin \ && curl -fsSL https://forgeinit.app/forge-cli.mjs -o ~/.local/bin/forge \ && chmod +x ~/.local/bin/forge \ && echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc \ && source ~/.bashrc \ && forge help
Zsh:
mkdir -p ~/.local/bin \ && curl -fsSL https://forgeinit.app/forge-cli.mjs -o ~/.local/bin/forge \ && chmod +x ~/.local/bin/forge \ && echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc \ && source ~/.zshrc \ && forge help
Verify: forge help
2 · Get a token
Go to settings → access tokens and generate one. Copy it.
3 · Log in
forge login fg_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Stored at ~/.forge/config.json.
4 · Push a project
cd ~/code/my-app forge init <your-username>/my-app forge push -m "initial commit"
Add a .forgeignore at the repo root to skip files — gitignore-style patterns:
# .forgeignore *.log secrets/ .env.local !important.log
5 · Pull / clone
forge clone <owner>/<repo> # or inside an initialized folder forge pull
Branches & merging
forge branches # list all branches forge branch feature-x --from master # create a branch forge branch rename old new # rename a branch (updates locally too) forge branch use feature-x # point local folder at an existing branch forge checkout feature-x # switch to it (pulls latest) forge where # show current owner/repo (branch) forge status # show local changes vs remote HEAD forge merge feature-x # merge feature-x into the current branch
Merges fast-forward when possible; otherwise a 3-way merge runs server-side. On conflict, the CLI writes standard <<<<<<< markers into the affected files and aborts — resolve them, then forge push -m "merge ...".
Stashing local changes
Save your uncommitted changes and revert the working tree to the remote HEAD — useful when you need to pull, switch branches, or try something clean without losing work. Stashes live in .forge/stash/.
forge stash -m "wip: refactor auth" # save current changes + revert to HEAD forge stash list # show all saved stashes forge stash show # preview the latest stash forge stash apply # re-apply the latest stash (keeps it) forge stash apply 17512340 # apply a specific stash by id (suffix ok) forge stash pop # apply the latest stash and drop it forge stash drop 17512340 # delete a stash forge stash clear # delete all stashes
Stash is entirely local — nothing is uploaded. Apply overwrites matching files in your working tree with the stashed versions and deletes files the stash recorded as removed.
All commands
forge login <token>— save your access tokenforge logout— clear local credentialsforge whoami— show signed-in userforge init <owner/repo>— link this folder to a repoforge clone <owner/repo>— copy a repo into a new folderforge push -m "msg"— upload all files as a new commitforge pull— replace local files with the latest commitforge status— local changes vs remote HEADforge log— show commit historyforge branches— list branchesforge branch <name> [--from <branch>]— create branchforge branch rename <old> <new>— rename a branchforge branch use <name>— point local folder at a branch (no pull)forge checkout <name>— switch + pullforge where— show current repo + branchforge merge <source>— merge into current branchforge stash [-m "msg"]— save local changes + revert to HEADforge stash list— list saved stashesforge stash apply [id]— re-apply a stash (keeps it)forge stash pop [id]— apply a stash and drop itforge stash show [id]— show files in a stashforge stash drop [id]— delete a stashforge stash clear— delete all stashes