The spotlight command

spotlight is one binary. A host runs spotlight host serve. Each sandbox runs spotlight runner and spotlight egress from the runner image. A shared egress for push pools runs spotlight egress serve. An agent runs the agent commands inside its sandbox. A person or a CI job runs spotlight replay check from anywhere to check the station changes in a Terraform plan. A person runs spotlight login so that spotlight replay and the Terraform provider act as them. spotlight token prints a token for Terraform's http backend. spotlight secret lists the workspace's secrets and sets the values that Terraform does not set. A person runs spotlight ssh setup once so that ssh, VS Code and Cursor reach the sandbox of a task or chat through spotlight ssh proxy.

Synopsis

spotlight
spotlight status [--json]
spotlight update [<release>]
spotlight host
spotlight host serve
spotlight host init
spotlight host config
spotlight host status
spotlight host reload
spotlight host start
spotlight host stop
spotlight host restart
spotlight host logs
spotlight host uninstall
spotlight runner
spotlight runner harnesses <json>
spotlight runner ssh
spotlight egress
spotlight egress serve
spotlight replay <subcommand>
spotlight login [--url <address>] [--no-browser]
spotlight logout [--url <address>]
spotlight token [--url <address>]
spotlight secret list [--workspace <slug>] [--url <address>]
spotlight secret set <NAME> [--workspace <slug>] [--url <address>]
spotlight ssh setup [--url <address>] [--editor-timeout | --no-editor-timeout] [--print]
spotlight ssh proxy [--url <address>] <task-or-chat>.<workspace>.spotlight
spotlight version
spotlight help [--all] [<command>...]

The agent commands work inside a run.

Help

InvocationOutputExit code
spotlight help, -h or --helpThe commands, by group, on standard output. Inside a run, the agent commands. Outside one, the commands by goal: the login, secrets, editors, hosts and replays.0
spotlightIn a terminal outside a run, the dashboard. In the terminal of a sandbox that an editor opened, a note. Else the same as spotlight help.0
spotlight help --allEvery command, by group.0
spotlight <command> --help, -h, or spotlight help <command>The command's usage, flags, environment, examples, exit codes and docs link.0
spotlight replayThe help for spotlight replay.0
spotlight version or --versionThe release, such as v0.1.0. A binary built without one prints dev.0

A word that is not a command fails with spotlight: no command "<word>". on standard error and exits 1. A near command follows, as Did you mean spotlight host config?, then the help to run.

A usage error prints the command's usage line, then Run spotlight <command> --help for flags and examples.

spotlight

spotlight

In a terminal outside a run, opens the dashboard for this computer. It refreshes every 5 seconds. It shows:

LineShows
hostThe service and the sandboxes in use, then the checks and the live log. When the machine has no host settings and no service, one line: ○ not set up on this computer.
accountThe login of the command line, by user and address, or ○ not logged in.
editorsWhat spotlight ssh setup set up: ssh, and each editor it found, with ! when its connect timeout is less than 600 seconds. Without the ssh configuration, ○ not set up for VS Code or Cursor.

When the host is not set up, the header shows no host name, and the footer shows i set up a host in place of the settings and the log.

When there is no login, no ssh configuration and no host, the dashboard asks What do you want to do here? in place of the three lines. ↑↓ chooses and Enter starts:

ChoiceWhat it does
Open tasks in VS Code or CursorLogs in, then runs spotlight ssh setup, as e does
Run agents on this computerOpens the host set-up, as i does
Manage Spotlight with Terraform or replaysLogs in, as a does

The keys of each line, such as a, e and i, also work there.

When the user is not root and /etc/spotlight/host.env exists, root has a host on this computer. The host line then shows ○ belongs to root · to manage it, run: sudo spotlight, and i does nothing. Run as root, the dashboard shows only the host: the login and the editors belong to a person, so a and e do nothing. : finds an action or a setting by name, and ? shows every key. Each action runs a spotlight command and shows it with the last line of its output. Run as root, i runs spotlight host init, which asks questions, so it runs in the whole terminal. When it ends, it prints Press Enter to go back to spotlight., so its output stays to read. A command that failed shows exited with code <code>, and one stopped with Ctrl-C shows stopped. See Manage the host in a terminal. q, Esc or Ctrl+C closes the dashboard. The host keeps serving. When the help does not fit, the arrow keys, j and k scroll it.

u asks, then runs spotlight update. It does nothing when the host is not set up.

i opens Set up this computer as a host when no service is installed. It does nothing when a service is installed, or when root has a host on this computer. See Host set-up.

a logs in on the dashboard when there is no login. It shows Log in to Spotlight and the address that spotlight login uses without --url. Change the address, or press Enter to keep it. An address without a scheme gets https://. Then the dashboard shows the login page and the code, and opens the page in the browser. o opens the page again, and Esc stops the login. After you approve the login, the dashboard shows Logged in to <address> as <email>. If the login fails, the dashboard shows the reason under the address. Correct the address and press Enter again. With one login, a asks, then runs spotlight logout --url <address>, and : log in logs in to another address. With more than one, a lists them, to choose the one to end.

e sets up ssh for VS Code and Cursor. When there is no login for the address, it logs in first, as a does. When an editor's connect timeout is less than 600 seconds, it asks Let <editor> wait up to 10 minutes to connect?. y runs spotlight ssh setup --url <address> --editor-timeout, n runs it with --no-editor-timeout, and Esc stops. With ready editors, it runs it with --no-editor-timeout at once. With more than one login, e lists them, to choose the address for ssh. The footer shows e when ssh is not set up, or when an editor's connect timeout is too short.

When standard input or standard output is not a terminal, spotlight prints the help.

When SPOTLIGHT_EDITOR_SESSION is set, as in the terminal of a sandbox that VS Code or Cursor opened, spotlight prints this note and exits 0:

This terminal is in the sandbox of a Spotlight task.
Run spotlight login, spotlight ssh setup and the host commands on your own computer.
Agent commands work only in a run. To see them: spotlight help --all

spotlight status

spotlight status [--json]

Prints what is set up on this computer, as the dashboard shows it: the logins, the ssh configuration and each editor's connect timeout, and the host. Each line has a mark: ✓ set up, ! needs an action, ✗ the host has a failed check, ○ not set up. The line below a mark is the command to run. Run as root, it shows only the host.

This computer
  ✓ Logged in to https://app.usespotlight.ai as you@example.com.
  ✓ ssh reaches Spotlight sandboxes.
  ✓ VS Code waits 600 seconds for a connection.
  ○ This computer has no host.
      to run agents here: spotlight host init
Host lineWhen
The host is <service>. <n> of <capacity> sandboxes run.The host has settings or a service. The service is as in spotlight host status. for its checks: spotlight host status follows.
The host on this computer belongs to root.The user is not root, and /etc/spotlight/host.env exists. to manage it: sudo spotlight follows.
This computer has no host.Neither.

With --json, it prints one object:

FieldValue
loginsEach login, as address and user. null when run as root.
editorsconfigured, and editors: each editor found, as name, ready and message. null when run as root.
hostThe object that spotlight host status --json prints, or null when the computer has no host.
host_as_roottrue when root has a host on this computer and the user is not root.

It exits 0, and 1 when the logins cannot be read or with a usage error.

spotlight update

spotlight update [<release>]

Replaces this spotlight binary with a release, such as 20261020-01. Without a release, it uses the release of the Spotlight that this computer's host serves. A running host restarts on the new binary at once. Its running sandboxes keep going, and the restarted host takes them over. See Updates.

MessageWhen
spotlight update: downloading release <release>The download starts.
spotlight update: <path> is now release <release>. A running host restarts on it now and keeps its running sandboxes.The binary was replaced.
spotlight update: already on release <release>The binary is on that release. Nothing changes.
ErrorCause
this computer has no host settings, so Spotlight cannot be asked for its release. Name a release: spotlight update <release>No release was given, and there is no host configuration file.
<path> can't reach the control plane, so name a release (spotlight update <release>): <error>No release was given, and the host settings have a problem.
the control plane at <address> doesn't name a release; name one: spotlight update <release>No release was given, and Spotlight names none.

Each error is printed after spotlight update: on standard error. It exits 0 on success and 1 on an error.

spotlight host

spotlight host

Prints the help for spotlight host: its commands and flags. The service runs spotlight host serve. The dashboard opens with spotlight.

spotlight host serve

spotlight host serve

Serves a pull pool or a runner trust. The host claims work and starts a sandbox and egress for it. A task's or chat's sandbox takes the later runs of its task or chat until Spotlight drains it; a check's sandbox ends with the check. The host then destroys the sandbox and its egress. The host also keeps one connection open to Spotlight that editors reach sandboxes through. See Sandbox lifetime. An unknown subcommand fails as described in Help.

The host writes its process id to host.lock in the state directory while it holds the lock. The other spotlight host commands find it there.

SignalAction
SIGHUPReloads the settings. See spotlight host reload. Settings with a problem are logged as could not reload the settings, so the host keeps the ones it has.
SIGUSR1Stops claiming, lets the running sandboxes finish, then starts again in the same process. See restart.
SIGINT, SIGTERMStops the running sandboxes and exits 0.
ReadsReference
The host configuration file and environmentHost settings
The container engineHost settings
The state directoryHost settings

The host logs JSON lines to standard output. Each line a sandbox prints appears in the host's log as an entry with the message sandbox and the line in line. Errors that stop the host print to standard error as spotlight host: <error>. When the settings have a problem, such as no URL or no credential on a machine that is not set up, the error ends with To set up this machine as a host, run: spotlight host init.

MessageWhen
servingThe host started.
the container runtime is not answering yetThe engine did not respond. The host retries.
could not report to the control plane, still tryingSpotlight did not respond. The host retries.
took over a running sandboxAt start, the host found a running sandbox of an earlier host process. It reports the sandbox, delivers its next runs, and destroys it when it ends.
could not take over a sandbox left behind, so it is destroyedA running sandbox of an earlier host process has no running egress container, no /run/spotlight-host/takeover.json in its egress container, or no network. The host also destroys it when a harness key that the sandbox started with is no longer in sandbox-env.
destroyed a sandbox left behindA container of an earlier host process that no running sandbox uses was removed at start.
removed a sandbox network left behindA sandbox network that no sandbox uses was removed. The host looks for these at start and every 5 minutes.
started a sandboxA run or check began in a new sandbox.
started a sandbox with no run; it restores its workspace and waits for runsAn editor asked for the sandbox of a task or chat that had none.
delivered the next run into the sandboxA run of the sandbox's task or chat began in the live sandbox.
the control plane drains the sandboxSpotlight drained the sandbox. It is stopped with a 30-second grace, then destroyed.
the sandbox stops, because a run could not be delivered into itThe host could not deliver a run into the live sandbox. The sandbox is stopped.
the sandbox finishedThe sandbox exited.
the sandbox ran past its timeA check's sandbox ran past SPOTLIGHT_RUN_TIMEOUT. It is stopped with a 30-second grace.
opened the tunnel for editorsThe host's connection for editors is open.
the tunnel to the control plane closed; editors cannot reach sandboxes until it opens againThe connection for editors closed. The host opens it again.
an editor connected to the sandbox, an editor left the sandboxAn editor connection began or ended.
could not start a sandbox; claiming from this image pausesClaims for that image pause, longer after each failure in a row, up to about 30 seconds.
failed the work: its egress sidecar did not startEgress did not start. The run fails, or the check is skipped.
the host is stopping, so the work is left to be claimed againThe host stopped before the sandbox started.
the host binary was replaced; it restarts now, and the restarted host takes over its running sandboxesspotlight update replaced the binary. See Updates.
updated to release <release>; it restarts now, and the restarted host takes over its running sandboxesauto-update replaced the binary with Spotlight's release. See Updates.
the host restarts, and leaves the sandbox running for the restarted hostThe host restarts on a new binary. The sandbox keeps going.
the control plane will not have this host; it stops claiming and lets its sandboxes finishSpotlight did not accept the host. It exits 3.

Updates

The host updates when spotlight update replaces its binary, or when auto-update is on and Spotlight is on another release. Then the host:

  1. Stops claiming. A sandbox that it already claimed starts.
  2. Lets each run that it delivers into a live sandbox take its assignment.
  3. Starts the new binary in the same process. Its sandboxes, their egress containers and their networks keep going.
  4. Takes over each running sandbox before its first heartbeat, so Spotlight does not count the sandbox as lost. It reads the sandbox's proxy credential, extra hosts and harness key names from /run/spotlight-host/takeover.json in the egress container. It takes the values of those harness keys from its own sandbox-env.
  5. Claims new work up to capacity. Each sandbox that it took over uses one place of the capacity until it ends.

A sandbox that it took over still stops at SPOTLIGHT_RUN_TIMEOUT and when Spotlight drains it. An editor connection to a sandbox closes at the restart. Connect again when the host is back.

Exit codes

CodeMeaning
0Stopped on SIGINT or SIGTERM.
1A configuration or runtime error.
3Spotlight did not accept the host: an unknown or rotated credential, a host id that is in use by another pool or trust (409 host-in-use), or a host that sent no heartbeat through that pool or trust.

spotlight host init

spotlight host init
spotlight host init [--url URL] [--token TOKEN | --token-stdin | --trust ID --oidc-token-file PATH]
                    [--capacity N] [--sandbox-memory SIZE] [--image IMAGE] [--name NAME]
                    [--no-service] [--yes]

Writes the host settings, pulls the default runner image and runs the host as a service. Running it again keeps the saved values as the defaults.

With no flags or with --url alone, as a user other than root, when standard input and standard output are terminals, and when the host settings hold no pool token and no trust, init opens the dashboard at the host set-up, for the address of --url when you give it. In all other cases, it works as below.

FlagSettingWithout the flag
--urlurlAsks Spotlight URL. Default: the saved value, else the address of the login as spotlight ssh setup chooses it, else https://app.usespotlight.ai.
--tokentokenAsks Pool token, without showing what you type. Enter keeps a saved token. Not asked when a trust is given or saved.
--token-stdintokenReads the token from standard input, at most 4,096 bytes, without leading and trailing white space. Not together with --token.
--trust, --oidc-token-filetrust, oidc-token-fileThe saved values. Either flag removes a saved token, and --token removes a saved trust.
--capacitycapacityAsks Sandboxes at once. Default: the saved value, else 5.
--sandbox-memorysandbox-memoryAsks Memory per sandbox (none sets no limit). Default: the saved value, else the container runtime's memory less 2g, divided by the capacity and rounded down to whole mebibytes, such as 2688m for 23 GiB and 8 sandboxes. none is saved, so a later init keeps it. No default when that share is below 6m, or when the runtime does not give its memory; then init prints The container runtime does not give its memory, so init suggests no memory limit: <error>.
--imageimageAsks Runner image. Default: the saved value, else ghcr.io/usespotlightai/spotlight-runner:<release>. That default is not saved, so the host follows its own release.
--namenameThe saved value. Not asked.
--no-serviceSaves and pulls, but installs no service. Prints Start the host with: spotlight host serve.
--yesAsks nothing.

init asks its questions on the terminal (/dev/tty), so they work when the command reads its standard input from a pipe. With no terminal, or with --yes, it uses the saved value or the default, and stops when it has no token and no trust.

StepAction
1Checks that a container runtime answers, at the saved DOCKER_HOST, else at the usual sockets of Docker, Podman, OrbStack and Colima. Without one it stops before it asks anything, and nothing is saved.
2Settles each value from its flag, the answer, the saved value or the default.
3Checks the settings as the host does. On a problem it saves nothing.
4Asks Spotlight for the host's requirements with the credential. A refused credential stops it, and nothing is saved. When Spotlight does not answer, it warns and goes on.
5Saves the settings file in one rename, with mode 0600. Comments and settings it does not set stay.
6Pulls the default image with the registry credentials. An image with * is not pulled, and neither is an image built on this machine, which has no registry digest. When the pull fails and the machine has a copy, it warns and goes on.
7When a host already runs from these settings, restarts it when its sandboxes finish. Otherwise, without --no-service, installs and starts the service.
8When the default image is Spotlight's runner image, prints that it holds no harness.
MessageWhen
Spotlight at <url> accepts the credentialStep 4.
Spotlight at <url> does not answer, so the credential is not checked: <error>Step 4, a warning.
Saved the settings in <config path>Step 5.
Pulled <image>Step 6.
Uses <image>, built on this machineStep 6, for an image with no registry digest.
Could not pull <image>, so the host uses the copy on this machine: <error>Step 6, a warning.
Started the systemd service spotlight-host (<unit path>)Step 7 on Linux.
Started the launchd agent ai.usespotlight.host (logs in <log path>)Step 7 on macOS.
The host serves <url>. It shows on the Runners page when it connects.Step 7, when the service started.
The runner image holds no harness, so this host runs checks but no agent run.Step 8. The line Run spotlight host init in a terminal, without flags, to build an image with Claude Code, Codex, Cursor or OpenCode. follows.

As a user other than root on Linux, when lingering is off, it also prints:

To keep the host running after you log out, run:
  loginctl enable-linger <user>
ErrorCause
nothing saved, because no container runtime answers. A host runs each sandbox in a container: start Docker or Podman (on macOS, Docker Desktop, OrbStack or Colima), then run this again: <error>Step 1.
nothing saved, because <problems>Step 3. The problems name the settings by key.
nothing saved, because Spotlight at <url> does not accept the credentialStep 4.
--token is required: a pull pool's token, from Settings → Runners → Add a hostNo token, no trust and no terminal to ask on.
give the token with --token or --token-stdin, not bothBoth flags.
read the token from stdin: <error>--token-stdin, and standard input could not be read.
--token-stdin reads the token from a pipe, as in: printf %s "$POOL_TOKEN" | spotlight host init --token-stdin--token-stdin, and standard input is a terminal.
a pool token is requiredThree empty answers to Pool token.
pull <image>: <error>Step 6, and the machine has no copy.
installing a service on <os> is not supported; run `spotlight host serve` under your own supervisorStep 7 on a platform other than Linux or macOS.

Host set-up

spotlight host init with no flags, i and the first-run choice Run agents on this computer open Set up this computer as a host in the dashboard. It asks one step at a time. ↑↓ (or k and j) moves, Enter goes on and Esc goes back a step.

StepAsksDefault
LoginWhen the address has no login, the login screen of a. With more than one saved login and no --url, : offers set up a host for <address> for each.The address of --url, else the address spotlight login uses without --url.
WorkspaceWhich workspace does this host serve?, only when the login belongs to more than one workspace.
HarnessesWhich agents run on this host? Space picks, Enter goes on.: Claude Code, Codex, Cursor CLI and OpenCode.None picked.
KeyFor each picked harness that has none of its keys as a workspace secret or as the key of a harness before it: Which key does <harness> use? when it has more than one, then Paste the <key>.. What you paste is not shown.The first key in the list.
PoolThe name of the pull pool: lowercase letters, digits and single dashes, at most 63 characters.The computer's host name up to its first ., in lowercase, with each run of other characters as -. Else host.
SandboxesHow many sandboxes run at once, at least 1.5
ConfirmEnter saves the keys, makes the pool, builds the image and installs the host service.

The key choices:

HarnessChoices
Claude CodeClaude subscription token, from claude setup-token (CLAUDE_CODE_OAUTH_TOKEN), Anthropic API key (ANTHROPIC_API_KEY)
CodexOpenAI API key (OPENAI_API_KEY), OpenAI API key for Codex (CODEX_API_KEY)
Cursor CLICursor API key (CURSOR_API_KEY)
OpenCodeAnthropic API key (ANTHROPIC_API_KEY), OpenAI API key (OPENAI_API_KEY), OpenRouter API key (OPENROUTER_API_KEY)

After Enter, it takes these steps in order:

StepShowsAction
1Saving <NAME> as a workspace secretSaves each pasted key as the workspace secret <NAME>, with one binding to the provider's host.
2Making the pull pool <name>Makes a pull pool with the name as its key and a token that the CLI makes. The token goes only to step 4.
3Building the image with <harnesses>, and the last line of the buildBuilds spotlight-harnesses:<release>-<harness ids> FROM ghcr.io/usespotlightai/spotlight-runner:<release>, with the container runtime at the saved DOCKER_HOST, else at the usual sockets. See Installation.
4The commandRuns spotlight host init --url <address> --token-stdin --image <tag> --capacity <n> --name <name> --yes, with the pool's token on standard input.

Steps 1 and 2 use the login, through the resource API, and need the secrets and runners permissions of a workspace owner or admin. When a step fails, the dashboard shows why. r tries again from that step, without the steps that are done, and Esc closes. While a step works, Esc stops it.

MessageCause
Your login belongs to no workspace. Make one in Spotlight first.The login has no workspace.
Pick at least one harness with space.Enter with no harness picked.
Paste the key. Spotlight keeps it as a workspace secret.Enter with no key.
Use lowercase words joined by dashes, as in my-laptop.A pool name with other characters, more than 63 characters, or a dash at an end or next to a dash.
Give a whole number of 1 or more.A number of sandboxes that is not a count of at least 1.
A pool named <name> is in the workspace. Pick another name.Spotlight answered 409 to step 2. The dashboard goes back to the pool name, and a new name gets a new token.
only a workspace admin can keep keys and make pools. Ask an admin to set up this host, or for a pool token for spotlight host init --token.Spotlight answered 403 to step 1 or 2.
no container runtime answers. Start Docker or Podman, then try again: <error>.Step 3 found no container runtime.

spotlight host config

spotlight host config [--json]
spotlight host config get KEY
spotlight host config set KEY=VALUE… [--now]
spotlight host config set KEY --stdin [--now]
spotlight host config unset KEY… [--now]
spotlight host config keys

Reads and changes the host settings file. A KEY is a setting's key, such as capacity, or its variable, such as SPOTLIGHT_CAPACITY. Any other name in capitals, such as HTTPS_PROXY, is taken as a variable that applies at a restart.

SubcommandAction
config, config listPrints the path and each setting the file sets, by key. The token shows as •••• and its last four characters.
config --jsonPrints {"path": …, "settings": [{"key": …, "variable": …, "value": …}]}, the token masked.
config get KEYPrints the value the file sets, the token in full. Exits 1 when the file does not set it.
config set KEY=VALUE…Sets each value, trimmed. A value is one line.
config set KEY --stdinSets one value from stdin, without its last line break. The value is not in the command line, so other users of the machine cannot see it in ps. An empty value is an error: to remove a setting, use config unset.
config unset KEY…Removes each setting, so its default applies.
config keysPrints each key, its variable, and whether it applies live or at a restart.

set and unset check the whole file as the host does, and save nothing when a check fails:

spotlight host: nothing changed, because capacity: "0" is not a count of at least 1

They save the file in one rename, with mode 0600, and keep its comments and order. When the environment sets a variable they change, they print The environment sets <variable>, which wins over the file. Then they apply the change:

HostChanged settingsActionMessage
none runs, service installedanynoneThe host is stopped. The change applies when it starts: spotlight host start
none runs, no serviceanynoneNo host runs from these settings. The change applies when it starts.
runsall livereloadThe running host applied the change
runsany applies at a restartrestart when the running sandboxes finishThe host restarts with the change when its <n> running sandboxes finish. …
runsany, with --nowrestart at once, stopping the running sandboxesRestarted the host

spotlight host status

spotlight host status [--json]

Prints the settings path, the service, the sandboxes that run against the capacity, the settings as config lists them, and these checks:

CheckNameFails when
The settings are validsettingsA setting does not pass the host's checks.
The host runsserviceNo process holds the state directory's lock.
Spotlight accepts the credentialspotlightSpotlight refuses the credential or does not answer.
The container runtime answersruntimeNo engine answers.
The default image holds a harnessimageA warning only, when the default image is Spotlight's runner image.

Each failed check prints a line saying what to do. The sandboxes are the runs whose containers run with the label ai.usespotlight.host=<host id>.

With --json it prints:

{
  "config": "<config path>",
  "name": "<host name>",
  "service": { "installed": true, "unit": "<unit path>", "running": true, "process": 4242 },
  "sandboxes": { "running": 2, "capacity": 5 },
  "settings": [{ "key": "capacity", "variable": "SPOTLIGHT_CAPACITY", "value": "5" }],
  "checks": [{ "name": "settings", "status": "passed", "message": "The settings are valid." }]
}

A check's status is passed, warning or failed, and a failed check has a fix. sandboxes.running is null when no container runtime answers.

CodeMeaning
0No check failed.
1A check failed.

spotlight host reload

spotlight host reload

Sends SIGHUP to the running host. The host reads its settings, sandbox.env and egress.env again, and applies the live settings to the sandboxes it starts from then on. Running sandboxes keep going. A lower capacity lets them finish. Settings that apply at a restart wait for the next one.

MessageWhen
The running host reloaded its settings, sandbox.env and egress.envThe signal was sent.
nothing reloaded, because <problems>A setting does not pass the checks. Nothing is sent.
no host runs from <config path>No process holds the state directory's lock.

spotlight host start, stop and restart

spotlight host start
spotlight host stop
spotlight host restart [--now]
CommandLinuxmacOS
startsystemctl start spotlight-hostlaunchctl bootstrap, or launchctl kickstart when loaded
stopsystemctl stop spotlight-hostlaunchctl bootout
restart --nowsystemctl restart spotlight-hostlaunchctl kickstart -k

systemctl takes --user when the command does not run as root. stop and restart --now stop the running sandboxes with the host.

restart without --now sends SIGUSR1 to the running host. The host stops claiming, lets its running sandboxes finish, and starts again in the same process with the settings it reads then. While it has sandboxes, it keeps sending heartbeats and tells Spotlight that it stops. Spotlight then drains each of its sandboxes once no run is in it: a run in progress finishes, and an idle sandbox stores its working copy and stops. The host delivers no more runs into them. The task's next run starts in a new sandbox, on this host after the restart or on another. When no host runs, restart starts the service. When the settings do not pass the host's checks, restart sends nothing and fails with nothing restarted, because the host would not start: <problems>.

When no service is installed, each command fails with the host is not installed as a service; to install it, run spotlight host init.

spotlight host logs

spotlight host logs [-f] [-n LINES]

Prints the service's log: the last LINES lines, 100 by default. -f or --follow keeps printing new lines.

PlatformReads
Linuxjournalctl --unit spotlight-host, with --user when not root
macOS~/Library/Logs/spotlight-host.log

spotlight host uninstall

spotlight host uninstall [--purge] [--yes]

Stops the service and removes its unit or agent file. Then it asks Also delete the settings <config path> and the state <state>?. --purge deletes them without the question, and --yes keeps them without it. The state directory is deleted only when it holds a host-id file. The binary stays; the command prints its path.

Service files

init writes the service with the binary at its resolved path (symbolic links followed) and SPOTLIGHT_HOST_CONFIG set to the settings path.

systemd unit

As rootAs another user
Unit file/etc/systemd/system/spotlight-host.service~/.config/systemd/user/spotlight-host.service
systemctl scopesystem--user
WantedBymulti-user.targetdefault.target

After writing the unit, init runs systemctl daemon-reload, systemctl enable spotlight-host and systemctl restart spotlight-host.

SettingValue
DescriptionSpotlight host: a fresh runner for every run
Afternetwork-online.target docker.service podman.socket
Wantsnetwork-online.target
ExecStart"<binary>" host serve
Environment"SPOTLIGHT_HOST_CONFIG=<config path>"
ExecReload/bin/kill -HUP $MAINPID
Restartalways
RestartSec5
RestartPreventExitStatus3
TimeoutStopSec90
OOMScoreAdjust-500, as root only. A user unit cannot lower its score.

launchd agent

KeyValue
File~/Library/LaunchAgents/ai.usespotlight.host.plist
Labelai.usespotlight.host
ProgramArguments<binary>, host, serve
EnvironmentVariablesSPOTLIGHT_HOST_CONFIG=<config path>, PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin
RunAtLoadtrue
KeepAlivetrue
ThrottleInterval60
ExitTimeOut90
StandardOutPath, StandardErrorPath~/Library/Logs/spotlight-host.log

init runs launchctl bootout gui/<uid>/ai.usespotlight.host, then launchctl bootstrap gui/<uid> <plist path>. The agent restarts after exit code 3 as after any other.

spotlight runner

spotlight runner

The runner image's entrypoint. In the sandbox of a task or chat, it restores the working copy once, then does each run the host delivers, one after another. On SIGUSR1 it reads the next assignment. On SIGTERM between runs it stores the working copy if it changed, then exits. For a check, or a run a push pool provisioned, it does that one piece of work, then exits. It takes no arguments other than harnesses and ssh. Any other argument fails with usage: spotlight runner [harnesses <json>].

spotlight runner ssh answers one SSH connection on standard input and output, as the agent user, in the working copy. The host runs it in the sandbox for each editor connection. See Editor connections.

VariableDefaultDescription
SPOTLIGHT_URLrequiredThe Spotlight address.
SPOTLIGHT_ASSIGNMENT_FILEnoneThe file with the work a host assigned to the sandbox. The host sets it.
SPOTLIGHT_RUN_TOKENnoneThe one-run credential a push pool's provider passes.
SPOTLIGHT_RUN_TIMEOUTnoneA Go duration. The runner stops a run that works longer, and reports it timed-out. 0 or none is no limit. The host sets it.
SPOTLIGHT_WORKSPACE/workspaceThe directory of the working copy.
SPOTLIGHT_AGENT_USERnoneThe user the harness runs as. Spotlight's runner image sets agent. When set, the runner must run as root.
SPOTLIGHT_GIT_AUTHOR_NAMESpotlightuser.name in each checkout.
SPOTLIGHT_GIT_AUTHOR_EMAILnoreply@usespotlight.aiuser.email in each checkout.
SPOTLIGHT_EGRESS_URLnoneWith SPOTLIGHT_RUN_TOKEN only. The URL of the shared egress the runner sends its traffic through: runner.egress.url of the provision call.
SPOTLIGHT_EGRESS_PROXY_CREDENTIALnoneWith SPOTLIGHT_EGRESS_URL. The run proxy credential: runner.egress.credential of the provision call.
SPOTLIGHT_EGRESS_TRAFFICallWith SPOTLIGHT_EGRESS_URL. bound sends traffic to hosts that are not bound directly, not through egress. The provisioner passes runner.egress.traffic here. See The runner's local proxy.

Exactly one of SPOTLIGHT_ASSIGNMENT_FILE or SPOTLIGHT_RUN_TOKEN must be set. The runner reads the SPOTLIGHT_EGRESS_ variables only with SPOTLIGHT_RUN_TOKEN.

Messages

MessageCause
SPOTLIGHT_URL is requiredNo address.
SPOTLIGHT_RUN_TOKEN and SPOTLIGHT_ASSIGNMENT_FILE are different ways to get work; set oneBoth set.
SPOTLIGHT_ASSIGNMENT_FILE names the file with the work a host assigned to this runner, or SPOTLIGHT_RUN_TOKEN is the one-run credential a push pool provisioned it withNeither set.
its assignment has no one-run credentialThe assignment file contains no credential.
could not trust the egress authority, so TLS through egress may failA warning. The egress authority could not be added to the image's bundles.
nothing was reserved for it in timeWith SPOTLIGHT_RUN_TOKEN, no work arrived within 5 minutes. The runner exits 0.
SPOTLIGHT_EGRESS_URL and SPOTLIGHT_EGRESS_PROXY_CREDENTIAL go together; set both or neitherOnly one of the two is set.
SPOTLIGHT_EGRESS_TRAFFIC: "<value>" is not all or boundA value that is not all or bound.
SPOTLIGHT_EGRESS_URL "<value>" is not an address such as https://egress.example.comNot an http or https URL with a host.
could not open the local proxy, so the work failsThe runner's local proxy did not open. The run fails before the agent starts. See The runner's local proxy.
SPOTLIGHT_RUN_TIMEOUT: "<x>" is not a duration such as 6h, or 0 for no limitA run timeout that is not a duration, or is negative.
could not check, because the local proxy did not openThe runner's local proxy did not open. The change stack check fails.
could not trust the authority of the local proxy, so TLS through it can failA warning. The authority of the local proxy could not be added to the image's bundles.

The runner logs JSON lines to standard output. See Inside a sandbox for what it does inside the sandbox.

Exit codes

CodeMeaning
0The run or check ended, whatever its outcome, the sandbox drained, or nothing was reserved in time.
1The runner could not start, or Spotlight did not accept it.

spotlight runner harnesses

spotlight runner harnesses '<json array>'

Looks for the given harnesses in the image and prints one JSON line with the runner's release and each harness it found, with its models and version. The host runs it against each image it supports. See Harnesses.

spotlight runner harnesses '[]'
{"release":"v0.1.0","harnesses":[]}

Exit codes

CodeMeaning
0Printed.
1The argument is not a JSON array: spotlight runner: read the harnesses to look for: <error>.

spotlight egress

spotlight egress

The egress sidecar a host starts next to each sandbox. It injects the run's secrets into requests to their hosts. spotlight egress serve runs one egress for the sandboxes of a push pool. An unknown subcommand fails as described in Help.

It logs egress is the sidecar of the sandbox when it listens. It reads the config the host gave it from /run/spotlight/egress.json and deletes the file. See Egress.

spotlight egress serve

The shared egress: one long-lived process for the runs of the push pools that name it. It reads its settings from the environment and logs JSON lines to standard output. See Shared egress for its settings and messages.

Exit codes

CodeMeaning
0Stopped on SIGINT or SIGTERM.
1Egress could not start.

spotlight login

spotlight login [--url <address>] [--no-browser]

Logs a person in to Spotlight through the browser, with the OAuth 2.0 device authorization grant (RFC 8628), and keeps the login in the credentials file.

FlagDescription
--urlThe Spotlight address. Without it, SPOTLIGHT_URL. Else the address of the one saved login. Else, in a terminal, it asks Spotlight address [https://app.usespotlight.ai]: an empty answer is that default. Without a terminal, https://app.usespotlight.ai. With more than one saved login, it asks in a terminal, and without one it fails with there are logins for <addresses>. Say which one with --url, or set SPOTLIGHT_URL.
--no-browserDoes not open the browser.

An address without a scheme gets https://. The address must use https. Only a local address, localhost, 127.0.0.1, ::1 or a name that ends in .localhost or .test, may use http. The address is kept as its scheme and host, and its port when that is not the default, so https://app.usespotlight.ai/ and https://app.usespotlight.ai:443 are the same address.

StepAction
1Asks Spotlight for a device code, as the client spotlight-cli.
2Prints the page to open, <address>/device?user_code=<code>, and the code as XXXX-XXXX.
3When standard output is a terminal and --no-browser is not given, opens the page with open on macOS, or with xdg-open on Linux when DISPLAY or WAYLAND_DISPLAY is set.
4Asks Spotlight for the login every 5 seconds, 5 seconds more after each slow_down answer, until the code is approved, denied or expires after 15 minutes.
5Reads the person's email from the new session.
6Writes the login for the address to the credentials file, and keeps the logins for other addresses.

The page is the web app's /device page. The login is a session of the person who approves it. It acts as that person, with their role in each workspace they are a member of, and ends after 7 days without use. Each use renews it.

MessageWhen
Open this page to log in to <address>:Step 2. The page follows on the next line.
Check that the page shows the code <code>.Step 2.
Opened the page in your browser.Step 3.
Waiting for you to approve the login. Press Ctrl-C to stop.Step 4 starts.
Logged in to <address> as <email>.Step 6.
Next: to open tasks in VS Code or Cursor, run: spotlight ssh setupStep 6, when ~/.ssh does not include the configuration of spotlight ssh setup. For an address other than https://app.usespotlight.ai, the command ends with --url <address>.
ErrorCause
the code expired before the login was approved. Run spotlight login again15 minutes passed.
the login was denied in the browserThe person clicked "Deny".
Spotlight refused the login: <error>. <description>Another OAuth error.
Spotlight at <address> did not give a device code. It answered 404, so it may not be a Spotlight address. To log in to another address, run: spotlight login --url <address>Step 1 answered 404.
Spotlight at <address> did not give a device code. It answered <status>Step 1 failed another way.
Spotlight did not accept the new login token. It answered <status>Step 5 failed.
"<value>" is not a Spotlight address. Use a URL such as https://app.usespotlight.aiThe address is not an http or https URL with a host.
<value> does not use https. Only a local address may use httpAn http address that is not local.
HOME is not set. Set SPOTLIGHT_CONFIG_DIR to keep loginsNo place for the credentials file.
stopped. No login was keptCtrl-C or SIGTERM.

Each error is printed after spotlight login: on standard error.

CodeMeaning
0Logged in.
1An error.
130Stopped with Ctrl-C or SIGTERM.

spotlight logout

spotlight logout [--url <address>]

Ends the session in Spotlight and removes the login for the address from the credentials file. The address is --url, else SPOTLIGHT_URL, else the address of your one login, else https://app.usespotlight.ai. With more than one login and neither of the first two, the command stops with there are logins for <addresses>. Say which one with --url, or set SPOTLIGHT_URL.

MessageWhen
Logged out of <address>.The login was removed.
You are not logged in to <address>.The file has no login for the address.
Spotlight did not end the session: <error>. The token stays valid until it expires.Spotlight did not answer, or answered with an error. The login is still removed.

Errors are printed after spotlight logout: on standard error. The exit codes are those of spotlight login.

spotlight token

spotlight token [--url <address>]

Prints a token for Spotlight on standard output, followed by a newline, for the state backend to send as TF_HTTP_PASSWORD. The address is found as for spotlight logout; SPOTLIGHT_API_TOKEN needs no address. It takes the first of these that is set:

SourcePrints
SPOTLIGHT_API_TOKENThe token, as it is.
SPOTLIGHT_OIDC_TRUSTA token issued through the OIDC trust, for the OIDC token in SPOTLIGHT_OIDC_TOKEN, else the one GitHub Actions issues to the job for the audience in SPOTLIGHT_OIDC_AUDIENCE, else spotlight.
The login for the address in the credentials fileThe login's token.
ErrorCause
no token for <address>. Run spotlight login --url <address>, or set SPOTLIGHT_API_TOKEN, or SPOTLIGHT_OIDC_TRUST in CINone of the sources is set. For https://app.usespotlight.ai, the command is spotlight login.
there are logins for <addresses>. Say which one with --url, or set SPOTLIGHT_URLMore than one login, and no address.
SPOTLIGHT_OIDC_TRUST is set, but no OIDC token was found. Set SPOTLIGHT_OIDC_TOKEN, or run in a GitHub Actions job with the permission id-token: writeA trust without SPOTLIGHT_OIDC_TOKEN, outside a GitHub Actions job that may request OIDC tokens.
GitHub Actions did not give an OIDC token; the job needs the permission id-token: write: <error>GitHub Actions refused the request.
Spotlight at <address> did not exchange the OIDC token through the OIDC trust <id>: it answered <status>: <body>The trust did not accept the job's token.

Each error is printed after spotlight token: on standard error. The exit codes are those of spotlight login.

spotlight secret

spotlight secret <command> [flags]

Lists the workspace's secrets, and sets the value of a secret that Terraform does not set. See Values set outside Terraform. With no command, or an unknown one, it prints its usage and exits 1.

Both commands take the same flags and environment:

FlagDescription
--workspace <slug>The workspace. Without it, SPOTLIGHT_WORKSPACE. Else the one workspace the caller is in.
--url <address>The Spotlight address. Without it, SPOTLIGHT_URL. Else the address of the one login in the credentials file. Else https://app.usespotlight.ai.
VariableDescription
SPOTLIGHT_URLThe address, when --url is not given.
SPOTLIGHT_WORKSPACEThe workspace slug, when --workspace is not given.
SPOTLIGHT_API_TOKENA workspace token with the secrets scope. Without it, the login for the address.

The address is checked as spotlight login checks it.

ErrorCause
no login for <address>. Run spotlight login, or set SPOTLIGHT_API_TOKENNo token and no login for the address. For another address, the command is spotlight login --url <address>.
there are logins for <addresses>. Say which one with --url, or set SPOTLIGHT_URLMore than one login, and no address.
you are in no workspaceNo --workspace or SPOTLIGHT_WORKSPACE, and the caller is in no workspace.
you are in the workspaces <slugs>. Say which one with --workspace, or set SPOTLIGHT_WORKSPACENo --workspace or SPOTLIGHT_WORKSPACE, and the caller is in more than one workspace.
<doing>: your login ended. Run spotlight loginSpotlight answered 401.
<doing>: you do not manage the workspace's secretsSpotlight answered 403: the caller does not have the secrets permission.
<doing>: no such secret or workspaceSpotlight answered 404.
<doing>: <message>Another refusal, with Spotlight's message.

<doing> is list the secrets or set <NAME>. Each error is printed after spotlight secret: on standard error.

CodeMeaning
0Done.
1An error.

spotlight secret list

spotlight secret list [--workspace <slug>] [--url <address>]

Prints a table of the workspace's secrets, by name. It never shows a value. Every member can list them.

ColumnContents
NAMEThe secret's name.
VALUEAwaiting a value, Stored in Spotlight or Set by Terraform.
SET ATWhen Spotlight last stored a value, in local time as 2006-01-02 15:04, or - while the secret awaits a value.
HOSTSThe bound hosts, joined with , .

A workspace without secrets prints The workspace <slug> has no secrets. Terraform defines them with spotlight_secret.

spotlight secret set

spotlight secret set <NAME> [--workspace <slug>] [--url <address>]

Sets the value of the secret <NAME>. Spotlight encrypts it and sends it to the secret's bound hosts. For a secret with sandbox = "env", the runs whose harness profile names it in env also get it in their sandbox. It needs the secrets permission.

The value never comes from an argument. In a terminal, the command asks Value of <NAME>: and does not show what is typed. Spaces at either end of a typed value are removed. Else it reads standard input to its end and removes one newline at the end:

op read op://staging/login/password | spotlight secret set STAGING_LOGIN_PASSWORD
MessageWhen
Spotlight stores the new value of <NAME>.Spotlight stored the value.
ErrorCause
the value is empty. Type it, or send it to stdinThe value is empty.
set <NAME>: Terraform sets the value of secret <NAME> (value_wo_version <n>). Change the value in Terraform, or remove value_wo_version and value_wo there first.The secret has value_wo_version.
set <NAME>: Secret value must be one line, since Spotlight sends <NAME> in a request header or query parameter.The value has more than one line, and the secret is bound to a host.
set <NAME>: Secret value must have at least 8 characters that are not whitespace, and no NUL byte, since a run gets <NAME> in its sandbox.The secret has sandbox = "env", and the value has fewer than 8 characters that are not whitespace, or a NUL byte.

A run that failed with secret_awaiting_value does not start again when the value is set. See Run failure messages.

spotlight ssh

spotlight ssh <command> [flags]

Opens the working copy of a task or chat in VS Code, Cursor or ssh. With no command, it fails with spotlight ssh: say which command; with an unknown one, spotlight ssh: no command "ssh <command>". Both exit 1.

A sandbox is named by an alias:

task-<task id>.<workspace>.spotlight
chat-<chat id>.<workspace>.spotlight

<workspace> is the workspace's slug, as in the app's addresses. Case does not matter, and a trailing . is ignored. Any other name fails with "<name>" is not a Spotlight sandbox. Use task-<id>.<workspace>.spotlight or chat-<id>.<workspace>.spotlight.

Both commands take the address from --url, else SPOTLIGHT_URL, else the address of the one login in the credentials file, else https://app.usespotlight.ai, and check it as spotlight login does. With more than one login and no --url or SPOTLIGHT_URL, they fail with there are logins for <address>, <address>. Say which one with --url, or set SPOTLIGHT_URL.

spotlight ssh setup

spotlight ssh setup [--url <address>] [--editor-timeout | --no-editor-timeout] [--print]

Configures ssh to reach Spotlight sandboxes at <task-or-chat>.<workspace>.spotlight.

FlagDescription
--urlThe Spotlight address.
--editor-timeoutSets remote.SSH.connectTimeout to 600 in the VS Code and Cursor settings. Does not ask.
--no-editor-timeoutDoes not change the VS Code and Cursor settings. Does not ask.
--printShows the configuration. Writes nothing.

--editor-timeout and --no-editor-timeout together fail with the usage line.

It writes ~/.ssh/spotlight/config with mode 0600, in its directory with mode 0700:

# Written by spotlight ssh setup. Run it again to change this file.
Host *.spotlight
  ProxyCommand <path of spotlight> ssh proxy --url <address> %h
  User spotlight
  StrictHostKeyChecking no
  UserKnownHostsFile /dev/null
  LogLevel ERROR
  ServerAliveInterval 30
  ServerAliveCountMax 6

It then adds Include ~/.ssh/spotlight/config to the top of ~/.ssh/config, creating the file with mode 0600 if there is none. An Include of the file below a Host or Match line is moved to the top. Other lines, and the file's mode, do not change, and a symbolic link is written through. Each file is written in one rename. When a file is current, it is not written again. Run the command again after you move the spotlight binary.

Editor settings

The command looks for the user settings of VS Code and Cursor:

SystemVS CodeCursor
macOS~/Library/Application Support/Code/User/settings.json~/Library/Application Support/Cursor/User/settings.json
Linux$XDG_CONFIG_HOME/Code/User/settings.json, else ~/.config/Code/User/settings.json$XDG_CONFIG_HOME/Cursor/User/settings.json, else ~/.config/Cursor/User/settings.json
Windows%APPDATA%\Code\User\settings.json%APPDATA%\Cursor\User\settings.json

An editor counts as found when its User folder exists. For each editor found whose remote.SSH.connectTimeout is missing, is not a number, or is less than 600, the command:

ConditionResult
--editor-timeoutSets it to 600.
--no-editor-timeoutChanges nothing, and shows the line to add.
No flag, and a terminalAsks <editor> … Set remote.SSH.connectTimeout to 600 in <path>? (y/N). Only y or yes sets it.
No flag, and no terminalChanges nothing, and shows the line to add.

The settings file can hold comments and trailing commas. The command changes only the value of remote.SSH.connectTimeout, or adds that one line before the closing }, with the indent of the first setting. Comments, other settings and the file's mode do not change, and a symbolic link is written through. If there is no settings file, it writes one with only this setting.

Output

The command prints the address, the binary and the hosts, then one line for each check, then the next step:

Spotlight SSH
  Address  https://app.usespotlight.ai
  Binary   /usr/local/bin/spotlight
  Hosts    *.spotlight

Checks
  ✓ ~/.ssh/spotlight/config is current.
  ✓ ~/.ssh/config includes ~/.ssh/spotlight/config.
  ✓ Logged in to https://app.usespotlight.ai as you@example.com.
  ✓ VS Code waits 600 seconds for a connection.
  ! Cursor uses its default connect timeout. A stopped sandbox can take minutes to start, so the first connection can fail.
      add "remote.SSH.connectTimeout": 600 to ~/Library/Application Support/Cursor/User/settings.json, or run: spotlight ssh setup --editor-timeout

Next
  Open a task in VS Code or Cursor from Spotlight, or run: ssh task-<id>.<workspace>.spotlight

✓ is a check that passed, ! one that needs an action, and ✗ one that failed. The line below a check is the action. On a terminal, the marks are in colour and the headings are bold, unless NO_COLOR is set.

CheckWhen
Wrote ~/.ssh/spotlight/config.The file was written.
~/.ssh/spotlight/config is current.The file had this content.
Added Include ~/.ssh/spotlight/config to the top of ~/.ssh/config.The line was added.
~/.ssh/config includes ~/.ssh/spotlight/config.The line was there.
Logged in to <address> as <email>.The credentials file has a login for the address.
There is no login for <address>.The credentials file has no login for the address. The action is spotlight login, with --url <address> for an address other than https://app.usespotlight.ai.
<editor> waits <seconds> seconds for a connection.The editor's remote.SSH.connectTimeout is 600 or more. With !, it is less.
<editor> uses its default connect timeout.The editor's settings do not set remote.SSH.connectTimeout.
Set remote.SSH.connectTimeout to 600 in <path>.The setting was written.
Sorry, <path> cannot be read: <error>.The settings file is not a JSON object, or cannot be read. Nothing is written.
Sorry, <path> cannot be changed: <error>.The settings file could not be written.

When there is no login for the address and there is a terminal, the command first prints The editor connects to sandboxes as you, so log in first. and logs in as spotlight login does: with --url or SPOTLIGHT_URL, at that address, else it asks for the address. It then writes the configuration for the address of the new login. When the login does not finish, it writes nothing. After Ctrl-C, it prints Stopped. Nothing was written. and exits 130. After another error, it fails with nothing was written, because the login failed: <error>.

With --print, it prints the file under # ~/.ssh/spotlight/config, then # Add to the top of ~/.ssh/config and the Include line, then # Add to the VS Code or Cursor settings and "remote.SSH.connectTimeout": 600.

ErrorCause
HOME is not set. Set it to the home folder that keeps ~/.sshNo home folder.
could not find the path of this spotlight binary: <error>The binary's path could not be read.
could not read ~/.ssh/config: <error>~/.ssh/config exists and cannot be read.
could not write <path>: <error>A file could not be written.

Each error is printed after spotlight ssh setup: on standard error.

CodeMeaning
0The configuration is in place, or was printed. A check can still show ! or ✗.
1An error.

spotlight ssh proxy

spotlight ssh proxy [--url <address>] <task-or-chat>.<workspace>.spotlight

Connects standard input and output to the SSH server of a sandbox. ssh runs it as the ProxyCommand that spotlight ssh setup writes.

FlagDescription
--urlThe Spotlight address.

It uses the login for the address in the credentials file, and opens a WebSocket to /api/sandboxes/connect at that address. If there is no login for the address, or Spotlight answers 401, the command logs in as spotlight login does, and then connects. It writes the login page and the code on standard error, opens the page in the browser, and waits for the approval. On Linux, it opens the browser only when DISPLAY or WAYLAND_DISPLAY is set. It logs in at most once for each connection. If the sandbox of the task or chat is not running, Spotlight starts it, and the command waits until it is ready, for at most 10 minutes. When the sandbox does not answer in 10 seconds, the command writes Starting the sandbox. This can take some minutes. on standard error. Standard output carries only the SSH connection. Who may connect is in Editor connections.

ErrorCause
Sorry, the login to <address> did not finish: <reason>. Run: spotlight loginThe command started a login, and the login failed, was denied, or expired.
Sorry, your login for <address> expired. Run: spotlight loginSpotlight answered 401 to the new login too.
Sorry, Spotlight at <address> cannot be reached: <error>The connection failed, or Spotlight did not answer within 1 minute.
Sorry, Spotlight at <address> did not find one task or chat in <alias>Spotlight answered 400.
Sorry, Spotlight at <address> refused the connection: <reason>Spotlight answered 403.
Sorry, there is no <task or chat> <id> in workspace <workspace> that you may openSpotlight answered 404: no such task or chat in the workspace, or you may not open it.
Sorry, the sandbox could not be opened. Please try againSpotlight answered 503.
Sorry, Spotlight at <address> answered <status>: <reason>Any other answer.
Sorry, the sandbox did not start in 10 minutes. Please try againNo host started the sandbox in time.
The sandbox stopped. Connect again to start itThe sandbox drained or was lost.
Sorry, the host of the sandbox is not connected to Spotlight. Please try againThe sandbox's host has no open connection for editors.
Spotlight at <address> restarted. Connect againSpotlight restarted.
Sorry, the connection to the sandbox failed. Please try againThe connection to the host failed.
Sorry, the connection to Spotlight at <address> broke: <error>The connection closed without a reason.
Sorry, Spotlight at <address> closed the connection: <error>Any other close.

With an address other than https://app.usespotlight.ai, the login commands read spotlight login --url <address>. Each error is printed as one line after spotlight ssh proxy: on standard error.

CodeMeaning
0The connection closed normally.
1Spotlight refused the connection, or it closed with an error.
130Stopped on SIGINT or SIGTERM.

Credentials file

spotlight login writes credentials.json in the first of these directories that applies, on every operating system:

DirectoryWhen
$SPOTLIGHT_CONFIG_DIRSPOTLIGHT_CONFIG_DIR is set.
$XDG_CONFIG_HOME/spotlightXDG_CONFIG_HOME is set.
~/.config/spotlightOtherwise.

The file has mode 0600, and its directory is created with mode 0700. It holds one entry for each address:

{
  "logins": {
    "https://app.usespotlight.ai": {
      "token": "<token>",
      "user": "you@example.com"
    }
  }
}

The file is written in one rename. Other fields in the file are kept.

Reads the loginWhen
spotlight replay checkNeither SPOTLIGHT_API_TOKEN nor SPOTLIGHT_OIDC_TRUST is set.
The Terraform providerNo token and no trust is set.
spotlight tokenNeither SPOTLIGHT_API_TOKEN nor SPOTLIGHT_OIDC_TRUST is set.
spotlight secretSPOTLIGHT_API_TOKEN is not set.
spotlight ssh proxyAlways.

Each takes the entry for the address of its SPOTLIGHT_URL or url.

spotlight replay

spotlight replay <subcommand>

Its one command, spotlight replay check, checks a saved Terraform plan's station changes, reading SPOTLIGHT_URL and SPOTLIGHT_API_TOKEN, or exchanging a CI job's OIDC token through SPOTLIGHT_OIDC_TRUST, else the login for SPOTLIGHT_URL. Its flags, output and exit codes are on spotlight replay.

On this page