fargone / docs / cli

fargone CLI

fargone is the official command-line interface for the platform. Deploy apps, attach databases, manage env vars and tail logs straight from your terminal — same account, same OAuth, zero passwords. It runs on any machine with Node ≥ 18 and has no dependencies.

Install

npm install -g fargone-cli

Sign in

fargone login

The CLI signs in through the platform's OAuth device flow: it opens your browser, you confirm with a passkey (Face ID, Touch ID, Windows Hello, a security key) or SSO, and the terminal receives a scoped access token. Nothing is stored on disk until you approve — see the OAuth guide.

  • No browser on this machine? fargone login --no-browser prints the URL + code.
  • Scripting? FARGONE_TOKEN=<token> fargone apps --json.
  • Point at a self-hosted instance with --host https://paas.example.com (or the FARGONE_HOST env var) — credentials are stored per host in ~/.config/fargone/config.json and refreshed automatically.

Command reference

Area Command
Auth fargone login, fargone logout, fargone whoami
fargone status, fargone doctor
Apps fargone apps, fargone apps create <name>
fargone apps info <slug>, fargone apps stop|restart|delete <slug>
fargone apps deploy <slug> --watch
fargone deploy <slug> <dir|.zip> --watch
Logs fargone logs <slug> --follow [--build]
Env fargone env <slug>, fargone env set <slug> KEY=V …
fargone env unset <slug> KEY
DB fargone db <slug> list, fargone db <slug> add postgres|redis|mariadb|mongo
Files fargone cdn, fargone cdn upload <file>, fargone cdn rm <id>
fargone cdn env <slug>, fargone cdn rotate <slug>
Quota fargone quota, fargone quota request <type> <amount> "<reason>"
Misc fargone open [slug]

Every command accepts --host <url> and --json (machine-readable output for jq).

CDN env for local development

Every deployed app receives a managed CDN token injected as environment variables: FARGONE_CDN_URL, FARGONE_CDN_PUBLIC_URL, FARGONE_CDN_TOKEN, FARGONE_CDN_PREFIX. To mirror that locally:

fargone cdn env my-app       # prints the export block for your local .env
fargone cdn rotate my-app    # rotates the token; old tokens die immediately

After a rotation, redeploy the app so its container picks up the new token. See the CDN guide for the full story.

Node.js library

fargone-cli also ships a typed client you can import in your own code — deploys, env vars, databases, CDN and quota against the same API, with FargoneClient.forHost() reusing your CLI session:

import { FargoneClient } from "fargone-cli";

const client = FargoneClient.forHost("https://fargone.sh");
const apps = await client.listApps();
await client.deployZip("my-app", zipBytes);

Examples

fargone login
fargone apps
fargone apps create my-app --github https://github.com/you/repo
fargone deploy my-app ./project --watch
fargone env set my-app DATABASE_URL=postgres://… NODE_ENV=production
fargone logs my-app --follow
fargone db my-app add postgres
fargone quota request storage 10 "media uploads"

fargone deploy <slug> <dir> zips the folder locally (skipping node_modules and .git) and uploads it, so you can ship straight from your working tree.

Next steps

  • OAuth provider — how device flow and scopes work under the hood
  • REST API — the endpoints the CLI talks to