CLI Reference
The forg CLI manages your license, sessions, and adapter connections. All commands communicate directly with the FORG engine at https://engine.forg.pro — there is no local agent daemon.
Global flags
| Flag | Description |
|---|---|
--version | Print version and exit |
--help | Print help for the current command |
forg activate
forg activate <license_key> [flags]Validates the license key against forg.pro/agent/v1/activate, stores the identity bundle in the OS keychain, auto-detects installed AI tools, and starts a monitoring session.
forg activate lic_a3f9e2c1b84d7f6e0a2c
# device fingerprint: a3f9e2c1b84d...
# Device name [mymac]:
# ✓ Claude Code
# ✓ Cursor
#
# FORG OS activated. 2 tool adapter(s) installed.
# forg: session started (a3f9e2c1)| Flag | Description |
|---|---|
--category | Work category: frontend | backend | data | infra | other |
--name | Device display name (skips interactive prompt) |
forg deactivate
forg deactivate [flags]Ends any active session, removes the identity bundle from the OS keychain, and wipes all local FORG data. The license remains valid on other machines — this only de-registers this device. Requires --confirm to prevent accidental data loss.
forg deactivate
# This will remove your license and delete all local FORG data.
# Run with --confirm to proceed.
forg deactivate --confirm
# forg: deactivated. All local data removed.| Flag | Description |
|---|---|
--confirm | Required. Confirms the destructive action. |
forg on
forg on [flags]Starts a new monitoring session. If a paused session exists, resumes it instead of creating a new one.
forg on
# forg: session started (a3f9e2c1)
forg on --goal "Build the auth flow"
# forg: session started (a3f9e2c1)
# forg: goal → Build the auth flow
# If a paused session exists:
# forg: resuming paused session (a3f9e2c1)| Flag | Description |
|---|---|
--goal | Declare the session's intent (sent to the behavioral engine) |
forg off
forg offStops the active monitoring session and clears local session state. Use forg done instead if you want the engine to generate a session summary.
forg off
# forg: session ended (a3f9e2c1)forg done
forg done [flags]Ends the session and requests the end-of-session report from the engine. Clears local session state after the engine acknowledges.
| Flag | Description |
|---|---|
--session | Session UUID (default: active persisted session) |
forg pause
forg pauseSuspends interventions without ending the session. The session remains open and can be resumed with forg on or re-anchored with forg refocus.
forg pause
# forg: session paused (a3f9e2c1) — run `forg on` to resumeforg refocus
forg refocusResumes a paused session and re-anchors the engine to the declared goal. If the session was not paused, still emits a refocus-ack signal.
forg refocus
# forg: refocused (a3f9e2c1)forg set-goal
forg set-goal <text...> [flags]Updates the goal for the active session. All arguments are joined as the goal text.
forg set-goal Refactor the payment module
# goal recorded for session a3f9e2c1| Flag | Description |
|---|---|
--session | Session UUID (default: active persisted session) |
forg status
forg status [flags]Shows the current state of your activation and active session.
forg status
# user_id: usr_a3f9e2c1b84d7f6e0a2c
# device: a3f9e2c1b84d...
# engine: https://engine.forg.pro
# license worker: https://api.forg.pro
#
# session: a3f9e2c1 (active)
# goal: Build the auth flow
#
# Installed adapters:
# ✓ Claude Code (free)
# ✓ Cursor (free)If no session is active:
# session: none (run 'forg on' to start)| Flag | Description |
|---|---|
--inline | One-line statusline format for Claude Code status bar |
forg connect
forg connect <tool>Manually installs the adapter for a specific tool. Useful if auto-detection during forg activate missed a tool that was installed later.
forg connect claude-code
# connected: claude-codeforg emit
forg emit [flags]Emits a lifecycle signal to the engine. This command is invoked automatically by tool adapter hooks — you typically won't run it manually.
When called from a piped context (e.g., a Claude Code hook), stdin is read automatically. There is no --stdin flag; stdin detection is based on whether the process has a TTY.
# Emit a PostToolUse signal (hook reads stdin automatically):
forg emit --event PostToolUse
# Emit with explicit session and tool context:
forg emit --event SessionStart --tool claude-code --session <uuid>| Flag | Description |
|---|---|
--event | Lifecycle event: SessionStart | SessionEnd | Stop | PreToolUse | PostToolUse | PreCompact | UserPromptSubmit |
--tool | Tool name reported to the engine (e.g., claude-code) |
--session | Session UUID (default: FORG_SESSION_ID env var) |
--goal | Session goal text (passed to engine on SessionStart events) |
forg update
forg updateChecks for a newer version of the CLI on the FORG release channel. If found, downloads and replaces the binary in-place.
forg update
# forg: checking for updates...
# forg: updated to v3.1.0forg version
forg versionPrints the CLI version and platform.
forg version
# forg 3.0.3 (darwin/arm64)Environment variables
| Variable | Description |
|---|---|
FORG_KEYSTORE | Set to file:// to use file-backed keystore instead of OS keychain |
FORG_SESSION_KEY | HMAC session key (set by the engine for hook processes) |
FORG_SESSION_ID | Current session UUID (set by the engine for hook processes) |
FORG_DATA_DIR | Override the data directory (default: OS-specific app data path) |