Request access

Reference

forge CLI

The command line tool, every command, and how it finds your key.

Install

curl -fsSL https://get.useblackforge.com | sh   # macOS and Linux
forge version

One static binary in ~/.forge/bin. It reads the key from BF_KEY, or from ~/.forge/config after forge login.

Commands

CommandDoes
forge loginSave a key for this machine
forge forgesFree GPUs and waits per plan
forge runStart a job. Everything after -- is the command
forge lsYour team's recent jobs
forge watch IDLive heat for a job's GPUs
forge logs ID [-f]Print or follow logs
forge stop IDStop a job
forge shell / notebookStart an interactive session
forge cp SRC DSTCopy to and from /shared
forge bankHour bank balance
forge usage [--month]Billed GPU hours and cost

forge run flags

FlagSame as API field
--imageimage
--gpusgpus
--planplan, default strike
--limitlimit, default 1h
--env KEY=VALUEenv, repeatable
--port 8000ports, repeatable
--resumeresume, Ember only
--tag key=valuetags, repeatable
--detachReturn at once instead of following the stages

A job file

For runs you repeat, put the flags in a file and pass it with -f.

# train.forge.toml
image   = "ghcr.io/yourlab/train:latest"
command = ["torchrun", "--nproc-per-node=8", "train.py"]
gpus    = 8
plan    = "bank"
limit   = "2d"

[env]
WANDB_PROJECT = "tide-7b"
forge run -f train.forge.toml

Exit codes

forge run without --detach exits with your container's exit code, so it works in CI. It exits 75 if the job was preempted and 70 for a hardware result.