DocsFeaturesCLI (lfc)

CLI (lfc)

Install and use the Lifecycle CLI to examine Environments, manage Services, stream logs, and validate configuration.

lfc is the command-line interface for Lifecycle. Use it to view and manage preview Environments (Builds), redeploy Services, stream logs, host static sites, and validate configuration. Use --json for machine-readable results.

lfc init selects the Lifecycle deployment before first use.

These examples use generic placeholder hosts such as https://lifecycle.example.com and myorg/myrepo. Your commands must use your deployment values.

Overview

Node ≥ 20 is necessary.

  • --help for all commands. lfc <command> --help works on all commands and subcommands and lists all flags.
  • --json for automation. Add --json, or set LFC_JSON=1.
  • --quiet when scripting. Add --quiet to suppress informational output while preserving command results and errors.
  • Humans and agents. Interactive prompts show only on a TTY. Without one, commands fail fast and name the missing flag or argument. This behavior keeps scripts and agents deterministic. Run lfc llms to print agent-oriented instructions.

Profiles and output

Each profile selects one Lifecycle deployment. Use separate profiles for deployments such as production and staging.

Commands use these exit codes:

CodeMeaning
0Success
1API error, failed build, or invalid schema
2Watch timeout or lfc doctor warning
3Not found, missing config, or unresolved lfc doctor --fix error
4Authentication error
⚠️

If the exit code is 4, use one login command:

  • lfc login
  • lfc login --device on a headless machine

Retry the failed command. Make sure of your identity: lfc whoami

Configuration

Point the CLI at your deployment. Interactively:

Or non-interactively (for scripts, dotfiles, onboarding docs):

init validates the URL format and tries to reach the API. If the API is not reachable, init shows a warning and saves the profile. When authentication is on, it starts the SSO login. These flags are useful:

  • --ui-url enables lfc builds open.
  • --no-login skips the login step.
  • --device uses device-code login.
  • --name <profile> names the profile.
  • --force overwrites an existing profile.

Manage profiles

Environment variables

VariableEffect
LIFECYCLE_API_URLOverride the API base URL.
LFC_PROFILESelect the active profile by name.
LFC_JSON=1Force JSON output globally.
LFC_CONFIG_DIROverride the config directory location.

One-off usage with no saved config (auth-less deployments only):

Commands

Authentication

Builds (preview Environments)

When you know the pull request or branch but do not know the Environment ID, use lfc builds find. A full pull request URL identifies the repository. A pull request number or branch name also needs --repo.

When you use --json, a successful result contains found, build, and matches. Exit code 3 means that no build exists. Exit code 1 means that the scan stopped before it could give a conclusive result.

Use lfc builds list --search <text> to search by Environment ID, namespace, pull request title, repository, or author. By default, list excludes torn_down and pending. Use --all or add --exclude to change that filter.

Per-build environment-variable overrides:

Services in a build

Pods & runtime logs

On an interactive terminal, run the command without pod-name to select a pod and container. In automation, specify the pod and container.

Schema validation

Exit code 0 means valid. Exit code 1 means invalid and prints errors for each field. Exit code 3 means that the CLI did not find a configuration file.

⚠️

Offline validation uses the schema in your installed CLI. If results differ, use --repo and --branch. The server result controls that deployment.

Static sites

User uploads default to private. Public uploads require confirmation when you specify --visibility public. Only the owner can change a site. --mine selects ownership, and --public selects public sites. These filters cannot be combined.

--deleted shows your deleted sites that you can restore. --deleted cannot be combined with --public.

The CLI prints the site’s openUrl. Renaming or changing visibility keeps the Site ID and content URL. After delete, the CLI shows the time until which you can restore the site. restore keeps the Site ID and URL. If a change returns 409, fetch the site again before you retry. See Sites for access rules and API details.

Diagnostics & agent instructions

All commands support --help. For automation, send --json results to a JSON processor. For example, use lfc builds get <uuid> --json | jq '.deploys[] | {name: .deployable.name, url: .publicUrl}'.