@lightfastai/cli
v0.1.0
Published
Lightfast CLI - command-line tools for the Lightfast platform
Readme
@lightfastai/cli
Command-line tools for signing in to Lightfast from local developer workflows.
Purpose
Provides command-line tools for:
- Signing in with Clerk OAuth Authorization Code + PKCE
- Binding the native session to a Lightfast organization selected in the browser
- Inspecting and clearing the stored CLI session
Installation
Install the published CLI package:
npm install -g @lightfastai/cliRun without a global install:
pnpm dlx @lightfastai/cli --helpUsage
Sign in
lightfast loginThe CLI starts a temporary loopback listener on 127.0.0.1, opens your browser, and signs in with Clerk OAuth Authorization Code + PKCE. Organization selection happens in the Lightfast web app during sign-in, and the stored native session is bound to that selected organization.
Show current session
lightfast whoamiSign out
lightfast logoutEnvironment
| Variable | Description |
| --- | --- |
| LIGHTFAST_APP_URL | Overrides the Lightfast app URL. Defaults to https://lightfast.ai. |
| LIGHTFAST_CLI_CONFIG_DIR | Overrides where the CLI stores auth.json. |
Development
Install dependencies from the monorepo root:
pnpm installBuild and test the CLI:
pnpm --filter @lightfastai/cli build
pnpm --filter @lightfastai/cli test
pnpm --filter @lightfastai/cli typecheckPack the npm tarball for inspection:
SCRATCH=$(mktemp -d)
pnpm --dir core/cli pack --pack-destination "$SCRATCH"Run in watch mode:
pnpm --filter @lightfastai/cli devCommands
login
Signs in with Clerk OAuth Authorization Code + PKCE and stores the org-bound native CLI session in auth.json. The browser callback uses an ephemeral loopback port.
lightfast loginwhoami
Shows the currently stored CLI session.
lightfast whoamilogout
Removes the stored CLI session.
lightfast logoutDocumentation
For CLI specification, see docs/architecture/phase1/package-structure.md.
