CLI installation
The 4RGE CLI installs from the terminal and authenticates against your 4RGE account. After sign-in, it shares your organization's access boundaries, model policy, and budget rules with the desktop and cloud surfaces.
Prerequisites
Org admins may restrict personal API keys — if headless auth fails, ask an admin to enable keys
in Settings or use interactive 4rged login locally.
Install and authenticate
Install the CLI
Install from 4rged.ai/cli/install for your platform:
# macOS and Linux curl -fsSL https://4rged.ai/cli/install | sh # Verify 4rged --versionOn Windows, run the PowerShell installer from 4rged.ai/cli/install.ps1.
Sign in interactively
Run
4rged loginand complete the browser flow atauth.4rged.ai. The CLI stores a session bound to your user and active organization.4rged login 4rged whoami # org: acme-corp role: member surfaces: desktop, cli, cloudConfigure headless credentials (optional)
For scripts and CI, create a User API key from Dashboard → Integrations → User API Keys. Export it as an environment variable — never commit it to the repository.
export X4RGE_API_KEY="x4rge_live_..." 4rged whoamiRun from a repository
cdinto a linked project repo and start a local or cloud-backed run:cd ~/work/payments-api 4rged agent run --project pay-platform --prompt "Explain middleware chain"
What the install script does
The install script served from 4rged.ai/cli/install downloads a versioned tarball from the CLI
release base (X4RGE_CLI_RELEASE_BASE_URL, default https://downloads.4rged.ai/cli), verifies the
SHA-256 checksum, and installs the 4rged binary. By default it lands in ~/.local/bin on macOS
and Linux (override with X4RGE_CLI_INSTALL_DIR). Pin a build with X4RGE_CLI_VERSION before
running the script — for example X4RGE_CLI_VERSION=1.2.0 curl -fsSL https://4rged.ai/cli/install | sh.
Device sign-in
Interactive login uses the same auth gateway as the dashboard. The CLI opens a device-auth handoff
at auth.4rged.ai/cli with a device code; after you approve in the browser, return to the terminal
to continue. If sign-in fails, confirm auth.4rged.ai is reachable and that your account belongs to
an organization with agent entitlement.
Verify policy before production use
After install, confirm the CLI sees the models and repos you expect:
Check effective models
4rged policy models --surface cliLists allowed models for the CLI surface after org (and team/project) policy.
Check repo access
4rged policy repos --project pay-platformShows linked repositories and enforcement mode (warn vs enforce) for hosted agents.
Dry run
4rged agent run --prompt "List top-level packages" --dry-runValidates auth, policy, and repo scope without consuming usage (when supported by your CLI version).
Updating and side-by-side versions
Install commands are served from 4rged.ai/cli/install. Internal 4RGE orgs may use a separate build channel — follow your platform team's instructions.
User API keys grant programmatic access equivalent to your account for allowed surfaces. Store them in your CI secret manager, rotate on offboarding, and scope keys to the minimum org/project needed for the automation.