Search forkrail

Search documentation, comparisons, and CLI commands.

CLI reference

Every forkrail command, grouped by what it’s for. Run forkrail help COMMAND for a command’s full options.

Install the CLI

curl -fsSL https://forkrail.com/install | sh

Check it with forkrail --version. The CLI is one file with no dependencies, for macOS, Linux and Windows on x64 and Arm.

Options every command takes

OptionDoes
--profile NAMEThe AWS profile to use. Defaults to AWS_PROFILE, then the one forkrail link saved, then the AWS SDK’s default.
--region REGIONThe install’s home region. Defaults to FORKRAIL_HOME_REGION, then the saved one, then us-east-1.
--awsUse this machine’s AWS credentials even though the terminal is signed in. FORKRAIL_AWS=1 does the same.
-h, --helpShow a command’s options.
-V, --versionShow the CLI’s version.

A terminal works in one of two ways: signed in (forkrail login), acting as a team member with their role, or with the install’s AWS credentials, as its administrator. Signed-in commands go through the dashboard and need no AWS access.

Deploy and manage deployments

CommandDoes
forkrail [DIR], forkrail deploy [DIR]Deploy a preview of the folder (the current one by default). --prod for production. With no command, forkrail deploys, as vercel does.
forkrail ls [PROJECT]List projects, or a project’s deployments.
forkrail inspect IDShow a deployment’s record. --logs for its build log.
forkrail promote IDMake a deployment production. --allow-preview-env promotes a preview whose env vars differ from production’s.
forkrail rollback [PROJECT]Point production back at the previous production deployment, or --to ID.
forkrail redeploy IDMake a deployment again with today’s env vars and settings. --prod, --skip-domain, --no-cache.
forkrail cancel IDStop a build.
forkrail rm IDRemove a deployment that isn’t production. rm --project NAME deletes a whole project.
forkrail retentionHow long deployments are kept: show, set, sweep.
forkrail restore IDBring a deleted deployment back, within 30 days.
forkrail build DIR --out OUT, forkrail publish OUTBuild without publishing, then publish that build.
forkrail curl URL -- ARGScurl a protected deployment as a team member.

deploy options

OptionDoes
--prodDeploy to production.
--project NAMEThe project. Defaults to the folder’s name.
--memory MBMemory for this deployment only (128 to 10,240).
--concurrent true|falseConcurrent compute for this deployment only.
--skip-domainWith --prod: build production but leave your domains on the current deployment (a staged release).
--no-cacheBuild without the build cache.
--localBuild on this machine instead of the install’s builder (needs AWS credentials).
--prebuiltDeploy a framework’s existing build output.

Projects and functions

CommandDoes
forkrail project NAMEShow a project’s settings, or change them with the options below.
forkrail limits NAMEShow or set --max-workers N (1 to 1,000, or default). Applies within seconds.
forkrail regionsRouter regions and where functions run: ls, add, rm, setup, copy.
forkrail linkCheck the account has an install, and save the profile and region for later commands.

project options

OptionDoes
--memory MB, --max-duration SFunction memory and timeout. default clears one.
--concurrent true|falseConcurrent compute (alias --fluid).
--max-inflight NMax requests per instance: how many requests share one worker, 2 to 50. Not a limit on the project: workers still scale out.
--keep-warm N|autoEnvironments kept warm per region (0 to 20).
--regions LISTFunction regions, comma-separated.
--role ROLEThe IAM role functions run as, by name or ARN; default for the shared one.
--framework NAMEThe framework preset.
--auto-assign-domains on|offWhether production deploys move your domains (off for staged releases).
--skew-protection on|offSkew protection, with --skew-max-age, --skew-threshold, --skew-allowed-domains.
--analytics on|offWeb Analytics.
--rename NEWRename the project.

Env vars, domains, schedules and hooks

CommandDoes
forkrail env ls PROJECT, env add|rm PROJECT KEYList, add or remove env vars. -e production|preview|development, --git-branch BRANCH. Values come from stdin or a prompt, never the command line.
forkrail env pull [FILE]Write Development’s variables to .env.local (or FILE).
forkrail env run -- CMDRun a command with Development’s variables, writing no file: forkrail env run -- next dev.
forkrail domains add DOMAIN PROJECTAdd a custom domain. --redirect OTHER --status 308, or --branch BRANCH to follow a branch.
forkrail domains ls|inspect|check|update|rmList, inspect, check DNS, change or remove domains.
forkrail schedules ls|run|enable|disable|syncA project’s cron schedules (alias crons).
forkrail deploy-hooks ls|create|rmSecret URLs that build a branch. create --branch BRANCH.
forkrail git setup|status|repos|connect|disconnect|deployThe install’s GitHub App, and connecting a project to a repository.

Routing and cache

CommandDoes
forkrail redirects ls|add|rm|import|export|testBulk redirects. add SRC DEST --permanent, import FILE --replace.
forkrail redirects publish|discard|versions|restorePublish staged redirects, or go back to a version.
forkrail routes ls|add|update|rm|move|enable|disable|testRouting rules. add NAME --src --src-syntax --action --dest --status --has --missing.
forkrail routes publish|discard|versions|restore|import|exportPublish staged rules, or go back to a version.
forkrail cache invalidate|dangerously-delete -p PROJECT --tag TAGSPurge by tag. --target production|preview, --revalidation-deadline-seconds.
forkrail cache purge -p PROJECTInvalidate everything the project cached.
forkrail cache ls PROJECTThe latest purges.

Security, team and spend

CommandDoes
forkrail firewall show|test|diff|publish|discard|versions|rollback PROJECTLook at, test and publish a project’s firewall. --install for the install’s own.
forkrail firewall rule add|rm|on|off|moveCustom rules: --if, --and, --or, --then, --for, rate limit options.
forkrail firewall ip add|rmIP blocks.
forkrail firewall attack-mode PROJECT --for 1h|6h|24hChallenge every visitor. --off to stop.
forkrail firewall system-bypass add|rm, mitigations, limits, pause, resumeDDoS mitigations and their exceptions.
forkrail firewall enable|disable, import FILETurn custom rules on or off, or import a Vercel firewall configuration.
forkrail protection show|set PROJECTDeployment protection: --scope, --members, --trusted-ips, --exceptions, --options-paths, --sign-out.
forkrail protection bypass add|rm PROJECTBypass secrets for automation. --env also sets FORKRAIL_AUTOMATION_BYPASS_SECRET.
forkrail protection default SCOPEThe default scope for every project (owners).
forkrail spend show|budget|no-budget|exempt|pause|resumeBudgets and paused projects.
forkrail owners ls|add|rmThe install’s owners (needs AWS credentials).
forkrail login [URL], logout, whoamiSign a terminal in or out, and see who it is.

Monitor

CommandDoes
forkrail logs PROJECTRequests, newest last. --since, --status, --path, --host, -f, --request ID, --app.
forkrail stats PROJECTStatus, latency, workers, cold starts and busiest paths. --since 24h by default.
forkrail usage [PROJECT]Requests, function time, transfer and cost on AWS. --since 30d, --daily.
forkrail routersEach router’s CPU, memory, disk, network and requests.

Install and administer

CommandDoes
forkrail installInstall forkrail in an AWS account. --domain, --email, --check (checks only), --yes, --terminal. Run it again to continue where it stopped.
forkrail uninstallDelete everything install made. Asks you to type the domain unless --yes.
forkrail dashboard [URL]Show or set the dashboard’s address.
forkrail sweepList stored files no deployment uses; --yes deletes them.
forkrail state status|mode|migrate|checkWhere project records are kept.

Environment variables the CLI reads

VariableDoes
FORKRAIL_TOKEN, FORKRAIL_APISign in without a login file, for CI: the token and the dashboard’s address.
FORKRAIL_AWS=1Use AWS credentials even when signed in.
FORKRAIL_HOME_REGIONThe install’s home region.
AWS_PROFILEThe AWS profile, as in the AWS CLI.
FORKRAIL_DASHBOARD_URLThe dashboard’s address, for one command.
FORKRAIL_CLOUDFLARE_TOKENFor install --yes: the Cloudflare API token for your domain’s DNS.
New to forkrail? Install it in your AWS account and deploy your first app in about 20 minutes.
Quickstart