Skip to main content

Quickstart

That is the whole thing. The wizard:
  1. Picks your tools — arrow keys and space, with a live installed / not installed mark against each one.
  2. Installs what’s missing — the exact command is shown and you approve it. Anything already installed is skipped.
  3. Chooses your models — read live from the gateway, grouped by tier with context window and price. A primary, any number of secondary models, and a small/fast one.
  4. Takes your key — masked input, written only to the tools you picked.
  5. Writes and verifies — one real request confirms the gateway answers before you leave.
Or do it in one non-interactive line — handy for scripts and dotfiles:
--tool all configures every supported tool at once. Add --install --yes to install the missing ones too.
The CLI is zero-dependency, needs Node 18+, and never sends your key anywhere except into your own local config files. Point it at a different gateway with --url (default is the hosted gateway).
Piped or in CI, npx layerx1 --key lx1_… runs the same steps deterministically — the tools already on the machine plus the catalog’s recommended models — because there is no TTY to prompt on. Without a key it points you at setup instead of prompting into a void.

The model catalog is dynamic

Model ids are not compiled into the CLI. Each run resolves the catalog live from GET /v1/models, caches it at ~/.layerx1/catalog.json for six hours, and falls back to a bundled snapshot only when there is no network. A model added to Layer X1 therefore appears in the picker — and in Codex’s declared context window — with no CLI release. Use --refresh-catalog to bypass the cache, or --offline to never touch the network.

Setup commands

Agent-run commands

The same binary is a client for the agent-native API — useful for submitting and following a run without writing any code.
Submit a run and watch it
--exact on an upload asserts the artifact is a lossless projection of its source; without it, provenance records that the content may be lossy. See Artifacts.

Flags

Secondary models

The gateway has no client-side “fallback model” parameter, so --fallback does not pretend otherwise. Each tool receives your extra picks in a slot it genuinely has:

Installing the tools

The CLI detects each tool by executable on PATH first, then by its config or extension directory, and reports which signal it used. Already installed means skipped. Where a vendor only ships a curl … | bash installer, that downloads and executes a remote script — the CLI labels it as such, prints the exact command, and runs nothing until you agree (or pass --yes). Desktop apps (Cursor, Windsurf) are never fetched: the CLI prints the download link. npx layerx1 doctor lists the install command it would use for each tool on your platform.

Supported tools

--tool accepts claude-code, codex, hermes, aider, continue, cline, cursor, cursor-cli, windsurf, antigravity, kiro — or all. Aliases: agyantigravity, kiro-clikiro, cursor-agentcursor-cli, hermes-agenthermes. Per-tool detail, and how to do each by hand, lives in the agent guides.

Safe by design

  • Deep-merge — it merges into your existing config; it never overwrites a whole file.
  • Managed blocks — additions are fenced with # >>> layerx1 … <<< markers, so they are easy to find and unset removes only what the CLI added.
  • Backups — every change writes a timestamped <file>.layerx1.bak-<timestamp> copy first.
  • Idempotent — re-running updates in place instead of duplicating, and it will not clobber a model you already set (it prints the value instead).

Your key for Codex

Codex gets the key from experimental_bearer_token in ~/.codex/config.toml. Setup does not require LAYERX1_API_KEY in the environment (Codex Desktop never sees User env vars). --persist-key still writes that variable for shells and scripts if you want it.

Verify it worked

A successful run prints a model reply served from https://api.layerx1.com. If it fails, check npx layerx1 status and your key.