Appearance
CLI
fjordrun is the command-line interface for Fjordrun: log in, link a directory to a service, deploy, follow logs and manage variables and domains from your terminal.
Install
bash
curl -fsSL https://fjordrun.com/install.sh | shbash
go install github.com/fjordrun/fjordrun-cli/cmd/fjordrun@latestPrebuilt binaries for Linux, macOS and Windows (amd64 and arm64) are attached to each GitHub release.
Check the installation:
bash
fjordrun versionLog in
bash
fjordrun loginThe CLI opens your browser at a page like https://app.fjordrun.com/cli/authorize?code=ABCD-EFGH and prints the same code in the terminal:
- Check that the code in the browser matches the one in your terminal.
- Choose Approve (or Deny if you did not start this login).
- The terminal confirms the login.
The code expires after 10 minutes. On a machine without a browser, use fjordrun login --no-browser and open the printed URL on another device.
Logging in creates a personal access token for your user, which the CLI stores in ~/.config/fjordrun/config.json. It acts as you, with your roles in all your teams. You can see and revoke your personal access tokens in Account settings; fjordrun logout revokes the token and removes it from the machine.
In CI, set FJORDRUN_TOKEN instead of logging in (see API tokens):
bash
export FJORDRUN_TOKEN=fjr_...FJORDRUN_TOKEN always overrides the stored login.
Link a directory
Most commands act on a service. Link the current directory once:
bash
fjordrun linkYou pick the team, project, environment and service from lists. The choice is saved in ./.fjordrun/link.json (the CLI adds a .gitignore inside .fjordrun/, so the link is not committed). Without prompts, for scripts:
bash
fjordrun link --team acme --project shop --environment production --service webfjordrun status shows what is linked; fjordrun unlink removes the link.
Global flags
| Flag | Meaning |
|---|---|
--json | Machine-readable JSON output |
--team <id, slug or name> | Team to use |
--project <id or name> | Project (default: the linked project) |
--service <id or name> | Service (default: the linked service) |
--environment <id or name> | Environment (default: the linked one, else production) |
Flags override the link, so you can act on another service without relinking: fjordrun logs --service api.
Commands
login, logout, whoami
bash
fjordrun login # browser login (device code)
fjordrun login --no-browser # print the URL instead of opening it
fjordrun whoami # the logged-in user and their teams
fjordrun logout # revoke the token and remove itteams, projects
bash
fjordrun teams
fjordrun projects # projects of the linked team, --team, or all your teams
fjordrun projects --team acme --jsonlink, unlink, status
See Link a directory.
deploy
Redeploys the linked service (for a GitHub source, a fresh build of its branch).
bash
fjordrun deploy
fjordrun deploy --wait # stream the logs and wait until it finishes
fjordrun deploy --service api --environment stagingWith --wait, the exit code is non-zero if the deployment fails, which is useful in CI.
logs
bash
fjordrun logs # last 100 lines of runtime logs
fjordrun logs -f # follow
fjordrun logs -n 500 # more lines
fjordrun logs --build # build logs of the latest deployment
fjordrun logs --deployment <id> # logs of a specific deploymentvars
bash
fjordrun vars list
fjordrun vars list --resolved # with ${{...}} references resolved
fjordrun vars set NODE_ENV=production API_URL=https://example.com
fjordrun vars unset OLD_KEYSetting or unsetting variables redeploys the service if it is running. See Variables and references.
domains
bash
fjordrun domains list
fjordrun domains add # generate a *.fjordrun.app domain
fjordrun domains add app.example.com # custom domain; prints the DNS records to createSee Domains and HTTPS.
open
bash
fjordrun open # open the service's URL
fjordrun open --dashboard # open the service in the dashboard
fjordrun open --print # only print the URLtemplates
bash
fjordrun templates listLists the one-click templates and their codes.
version
bash
fjordrun versionConfiguration files
| Path | Contents |
|---|---|
~/.config/fjordrun/config.json | Your login token |
./.fjordrun/link.json | The linked team, project, environment and service of this directory |
| Environment variable | Effect |
|---|---|
FJORDRUN_TOKEN | Access token; overrides the stored login |
FJORDRUN_API_URL | API base URL (default https://api.fjordrun.com/api/v1) |