CLI Reference
The semilayer CLI is the primary way to interact with SemiLayer: configure projects,
push schemas, manage sources, generate the typed client, and monitor ingest status.
Installation
Verify with:
Authentication
semilayer login
Authenticate with SemiLayer Cloud or your enterprise instance.
| Flag | Description |
|---|---|
--service-url <url> | Target a self-hosted instance |
semilayer logout
Clear stored credentials.
semilayer whoami
Show the currently authenticated user.
Project Setup
semilayer init
Interactive wizard — select or create an org, project, and environment. Saves context
to .semilayerrc and optionally creates a starter sl.config.ts.
Run this first when setting up a new codebase. The .semilayerrc file tells all
subsequent CLI commands which org/project/environment to target.
| Flag | Description |
|---|---|
--service-url <url> | Override the service API URL |
semilayer config
View or update the active context (org, project, environment, service URL).
Schema
semilayer push
Push your sl.config.ts to the service. Registers new lenses, updates changed ones,
and marks removed ones for cleanup.
| Flag | Description |
|---|---|
--resume-ingest | Start ingest for new/modified lenses after push |
--rebuild | Full re-index for ALL lenses (clears existing data — prompts for confirmation) |
--skip-confirmation-dangerously | Skip rebuild confirmation for CI/CD |
--force | Skip drift detection — push even if Console has newer changes |
Drift detection runs automatically on every push. If the Console has modified a lens since your last push, you'll see a warning and a confirmation prompt.
semilayer export config
Pull the remote config back to your local sl.config.ts. Useful when the Console has
changes you want to sync back to code.
semilayer status
Show lens statuses, ingest queue, and (in SaaS mode) quota usage.
Output:
Code Generation
semilayer generate
Generate the typed Beam client from your sl.config.ts. Outputs TypeScript files
to ./generated/semilayer/ by default.
| Flag | Default | Description |
|---|---|---|
--out <dir> | ./generated/semilayer | Output directory |
The generated module exports a createBeam factory and a Beam class, both fully
typed against your lens definitions. See Beam Client.
Ingest Control
semilayer pause
Pause ingest for one or all lenses.
semilayer resume
Resume ingest for one or all lenses.
semilayer sync
Trigger a one-off incremental sync for a lens (or all lenses).
Streaming
semilayer stream
Subscribe to a live tail for a lens and print events to stdout.
semilayer observe
Watch a single record for changes.
Sources
semilayer sources connect
Interactively connect a new data source and introspect available targets.
Prompts for a bridge package, connection details, and a name. Stores the source in your current environment. Lists available tables/collections/endpoints after connecting.
semilayer sources list
semilayer sources remove
Organization Management
These commands manage your org, projects, environments, members, and API keys from the terminal.
Billing (SaaS)
Global Flags
--help / -h — Show help for any command.
--version / -v — Show the CLI version.
Config File
The .semilayerrc file in your project root (or any parent directory) stores context:
The CLI walks up the directory tree to find the nearest .semilayerrc. Credentials
(auth tokens) are stored separately in ~/.semilayer/credentials.json.