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
| Invocation | Output | Exit code |
|---|---|---|
spotlight help, -h or --help | The 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 |
spotlight | In 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 --all | Every 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 replay | The help for spotlight replay. | 0 |
spotlight version or --version | The 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
spotlightIn a terminal outside a run, opens the dashboard for this computer. It refreshes every 5 seconds. It shows:
| Line | Shows |
|---|---|
host | The 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. |
account | The login of the command line, by user and address, or ○ not logged in. |
editors | What 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:
| Choice | What it does |
|---|---|
| Open tasks in VS Code or Cursor | Logs in, then runs spotlight ssh setup, as e does |
| Run agents on this computer | Opens the host set-up, as i does |
| Manage Spotlight with Terraform or replays | Logs 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 --allspotlight 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 line | When |
|---|---|
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:
| Field | Value |
|---|---|
logins | Each login, as address and user. null when run as root. |
editors | configured, and editors: each editor found, as name, ready and message. null when run as root. |
host | The object that spotlight host status --json prints, or null when the computer has no host. |
host_as_root | true 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.
| Message | When |
|---|---|
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. |
| Error | Cause |
|---|---|
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 hostPrints 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 serveServes 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.
| Signal | Action |
|---|---|
SIGHUP | Reloads 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. |
SIGUSR1 | Stops claiming, lets the running sandboxes finish, then starts again in the same process. See restart. |
SIGINT, SIGTERM | Stops the running sandboxes and exits 0. |
| Reads | Reference |
|---|---|
| The host configuration file and environment | Host settings |
| The container engine | Host settings |
| The state directory | Host 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.
| Message | When |
|---|---|
serving | The host started. |
the container runtime is not answering yet | The engine did not respond. The host retries. |
could not report to the control plane, still trying | Spotlight did not respond. The host retries. |
took over a running sandbox | At 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 destroyed | A 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 behind | A container of an earlier host process that no running sandbox uses was removed at start. |
removed a sandbox network left behind | A sandbox network that no sandbox uses was removed. The host looks for these at start and every 5 minutes. |
started a sandbox | A run or check began in a new sandbox. |
started a sandbox with no run; it restores its workspace and waits for runs | An editor asked for the sandbox of a task or chat that had none. |
delivered the next run into the sandbox | A run of the sandbox's task or chat began in the live sandbox. |
the control plane drains the sandbox | Spotlight drained the sandbox. It is stopped with a 30-second grace, then destroyed. |
the sandbox stops, because a run could not be delivered into it | The host could not deliver a run into the live sandbox. The sandbox is stopped. |
the sandbox finished | The sandbox exited. |
the sandbox ran past its time | A check's sandbox ran past SPOTLIGHT_RUN_TIMEOUT. It is stopped with a 30-second grace. |
opened the tunnel for editors | The host's connection for editors is open. |
the tunnel to the control plane closed; editors cannot reach sandboxes until it opens again | The connection for editors closed. The host opens it again. |
an editor connected to the sandbox, an editor left the sandbox | An editor connection began or ended. |
could not start a sandbox; claiming from this image pauses | Claims for that image pause, longer after each failure in a row, up to about 30 seconds. |
failed the work: its egress sidecar did not start | Egress did not start. The run fails, or the check is skipped. |
the host is stopping, so the work is left to be claimed again | The host stopped before the sandbox started. |
the host binary was replaced; it restarts now, and the restarted host takes over its running sandboxes | spotlight update replaced the binary. See Updates. |
updated to release <release>; it restarts now, and the restarted host takes over its running sandboxes | auto-update replaced the binary with Spotlight's release. See Updates. |
the host restarts, and leaves the sandbox running for the restarted host | The 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 finish | Spotlight 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:
- Stops claiming. A sandbox that it already claimed starts.
- Lets each run that it delivers into a live sandbox take its assignment.
- Starts the new binary in the same process. Its sandboxes, their egress containers and their networks keep going.
- 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.jsonin the egress container. It takes the values of those harness keys from its ownsandbox-env. - 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
| Code | Meaning |
|---|---|
0 | Stopped on SIGINT or SIGTERM. |
1 | A configuration or runtime error. |
3 | Spotlight 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.
| Flag | Setting | Without the flag |
|---|---|---|
--url | url | Asks Spotlight URL. Default: the saved value, else the address of the login as spotlight ssh setup chooses it, else https://app.usespotlight.ai. |
--token | token | Asks Pool token, without showing what you type. Enter keeps a saved token. Not asked when a trust is given or saved. |
--token-stdin | token | Reads the token from standard input, at most 4,096 bytes, without leading and trailing white space. Not together with --token. |
--trust, --oidc-token-file | trust, oidc-token-file | The saved values. Either flag removes a saved token, and --token removes a saved trust. |
--capacity | capacity | Asks Sandboxes at once. Default: the saved value, else 5. |
--sandbox-memory | sandbox-memory | Asks 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>. |
--image | image | Asks 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. |
--name | name | The saved value. Not asked. |
--no-service | Saves and pulls, but installs no service. Prints Start the host with: spotlight host serve. | |
--yes | Asks 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.
| Step | Action |
|---|---|
| 1 | Checks 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. |
| 2 | Settles each value from its flag, the answer, the saved value or the default. |
| 3 | Checks the settings as the host does. On a problem it saves nothing. |
| 4 | Asks 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. |
| 5 | Saves the settings file in one rename, with mode 0600. Comments and settings it does not set stay. |
| 6 | Pulls 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. |
| 7 | When a host already runs from these settings, restarts it when its sandboxes finish. Otherwise, without --no-service, installs and starts the service. |
| 8 | When the default image is Spotlight's runner image, prints that it holds no harness. |
| Message | When |
|---|---|
Spotlight at <url> accepts the credential | Step 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 machine | Step 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>| Error | Cause |
|---|---|
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 credential | Step 4. |
--token is required: a pull pool's token, from Settings → Runners → Add a host | No token, no trust and no terminal to ask on. |
give the token with --token or --token-stdin, not both | Both 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 required | Three 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 supervisor | Step 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.
| Step | Asks | Default |
|---|---|---|
| Login | When 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. |
| Workspace | Which workspace does this host serve?, only when the login belongs to more than one workspace. | |
| Harnesses | Which agents run on this host? Space picks, Enter goes on.: Claude Code, Codex, Cursor CLI and OpenCode. | None picked. |
| Key | For 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. |
| Pool | The 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. |
| Sandboxes | How many sandboxes run at once, at least 1. | 5 |
| Confirm | Enter saves the keys, makes the pool, builds the image and installs the host service. |
The key choices:
| Harness | Choices |
|---|---|
| Claude Code | Claude subscription token, from claude setup-token (CLAUDE_CODE_OAUTH_TOKEN), Anthropic API key (ANTHROPIC_API_KEY) |
| Codex | OpenAI API key (OPENAI_API_KEY), OpenAI API key for Codex (CODEX_API_KEY) |
| Cursor CLI | Cursor API key (CURSOR_API_KEY) |
| OpenCode | Anthropic 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:
| Step | Shows | Action |
|---|---|---|
| 1 | Saving <NAME> as a workspace secret | Saves each pasted key as the workspace secret <NAME>, with one binding to the provider's host. |
| 2 | Making 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. |
| 3 | Building the image with <harnesses>, and the last line of the build | Builds 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. |
| 4 | The command | Runs 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.
| Message | Cause |
|---|---|
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 keysReads 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.
| Subcommand | Action |
|---|---|
config, config list | Prints the path and each setting the file sets, by key. The token shows as •••• and its last four characters. |
config --json | Prints {"path": …, "settings": [{"key": …, "variable": …, "value": …}]}, the token masked. |
config get KEY | Prints 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 --stdin | Sets 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 keys | Prints 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 1They 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:
| Host | Changed settings | Action | Message |
|---|---|---|---|
| none runs, service installed | any | none | The host is stopped. The change applies when it starts: spotlight host start |
| none runs, no service | any | none | No host runs from these settings. The change applies when it starts. |
| runs | all live | reload | The running host applied the change |
| runs | any applies at a restart | restart when the running sandboxes finish | The host restarts with the change when its <n> running sandboxes finish. … |
| runs | any, with --now | restart at once, stopping the running sandboxes | Restarted 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:
| Check | Name | Fails when |
|---|---|---|
| The settings are valid | settings | A setting does not pass the host's checks. |
| The host runs | service | No process holds the state directory's lock. |
| Spotlight accepts the credential | spotlight | Spotlight refuses the credential or does not answer. |
| The container runtime answers | runtime | No engine answers. |
| The default image holds a harness | image | A 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.
| Code | Meaning |
|---|---|
0 | No check failed. |
1 | A check failed. |
spotlight host reload
spotlight host reloadSends 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.
| Message | When |
|---|---|
The running host reloaded its settings, sandbox.env and egress.env | The 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]| Command | Linux | macOS |
|---|---|---|
start | systemctl start spotlight-host | launchctl bootstrap, or launchctl kickstart when loaded |
stop | systemctl stop spotlight-host | launchctl bootout |
restart --now | systemctl restart spotlight-host | launchctl 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.
| Platform | Reads |
|---|---|
| Linux | journalctl --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 root | As another user | |
|---|---|---|
| Unit file | /etc/systemd/system/spotlight-host.service | ~/.config/systemd/user/spotlight-host.service |
systemctl scope | system | --user |
WantedBy | multi-user.target | default.target |
After writing the unit, init runs systemctl daemon-reload,
systemctl enable spotlight-host and systemctl restart spotlight-host.
| Setting | Value |
|---|---|
Description | Spotlight host: a fresh runner for every run |
After | network-online.target docker.service podman.socket |
Wants | network-online.target |
ExecStart | "<binary>" host serve |
Environment | "SPOTLIGHT_HOST_CONFIG=<config path>" |
ExecReload | /bin/kill -HUP $MAINPID |
Restart | always |
RestartSec | 5 |
RestartPreventExitStatus | 3 |
TimeoutStopSec | 90 |
OOMScoreAdjust | -500, as root only. A user unit cannot lower its score. |
launchd agent
| Key | Value |
|---|---|
| File | ~/Library/LaunchAgents/ai.usespotlight.host.plist |
Label | ai.usespotlight.host |
ProgramArguments | <binary>, host, serve |
EnvironmentVariables | SPOTLIGHT_HOST_CONFIG=<config path>, PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin |
RunAtLoad | true |
KeepAlive | true |
ThrottleInterval | 60 |
ExitTimeOut | 90 |
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 runnerThe 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.
| Variable | Default | Description |
|---|---|---|
SPOTLIGHT_URL | required | The Spotlight address. |
SPOTLIGHT_ASSIGNMENT_FILE | none | The file with the work a host assigned to the sandbox. The host sets it. |
SPOTLIGHT_RUN_TOKEN | none | The one-run credential a push pool's provider passes. |
SPOTLIGHT_RUN_TIMEOUT | none | A 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 | /workspace | The directory of the working copy. |
SPOTLIGHT_AGENT_USER | none | The user the harness runs as. Spotlight's runner image sets agent. When set, the runner must run as root. |
SPOTLIGHT_GIT_AUTHOR_NAME | Spotlight | user.name in each checkout. |
SPOTLIGHT_GIT_AUTHOR_EMAIL | noreply@usespotlight.ai | user.email in each checkout. |
SPOTLIGHT_EGRESS_URL | none | With 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_CREDENTIAL | none | With SPOTLIGHT_EGRESS_URL. The run proxy credential: runner.egress.credential of the provision call. |
SPOTLIGHT_EGRESS_TRAFFIC | all | With 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
| Message | Cause |
|---|---|
SPOTLIGHT_URL is required | No address. |
SPOTLIGHT_RUN_TOKEN and SPOTLIGHT_ASSIGNMENT_FILE are different ways to get work; set one | Both 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 with | Neither set. |
its assignment has no one-run credential | The assignment file contains no credential. |
could not trust the egress authority, so TLS through egress may fail | A warning. The egress authority could not be added to the image's bundles. |
nothing was reserved for it in time | With 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 neither | Only one of the two is set. |
SPOTLIGHT_EGRESS_TRAFFIC: "<value>" is not all or bound | A value that is not all or bound. |
SPOTLIGHT_EGRESS_URL "<value>" is not an address such as https://egress.example.com | Not an http or https URL with a host. |
could not open the local proxy, so the work fails | The 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 limit | A run timeout that is not a duration, or is negative. |
could not check, because the local proxy did not open | The 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 fail | A 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
| Code | Meaning |
|---|---|
0 | The run or check ended, whatever its outcome, the sandbox drained, or nothing was reserved in time. |
1 | The 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
| Code | Meaning |
|---|---|
0 | Printed. |
1 | The argument is not a JSON array: spotlight runner: read the harnesses to look for: <error>. |
spotlight egress
spotlight egressThe 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 serveThe 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
| Code | Meaning |
|---|---|
0 | Stopped on SIGINT or SIGTERM. |
1 | Egress 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.
| Flag | Description |
|---|---|
--url | The 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-browser | Does 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.
| Step | Action |
|---|---|
| 1 | Asks Spotlight for a device code, as the client spotlight-cli. |
| 2 | Prints the page to open, <address>/device?user_code=<code>, and the code as XXXX-XXXX. |
| 3 | When 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. |
| 4 | Asks 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. |
| 5 | Reads the person's email from the new session. |
| 6 | Writes 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.
| Message | When |
|---|---|
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 setup | Step 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>. |
| Error | Cause |
|---|---|
the code expired before the login was approved. Run spotlight login again | 15 minutes passed. |
the login was denied in the browser | The 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.ai | The address is not an http or https URL with a host. |
<value> does not use https. Only a local address may use http | An http address that is not local. |
HOME is not set. Set SPOTLIGHT_CONFIG_DIR to keep logins | No place for the credentials file. |
stopped. No login was kept | Ctrl-C or SIGTERM. |
Each error is printed after spotlight login: on standard error.
| Code | Meaning |
|---|---|
0 | Logged in. |
1 | An error. |
130 | Stopped 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.
| Message | When |
|---|---|
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:
| Source | Prints |
|---|---|
SPOTLIGHT_API_TOKEN | The token, as it is. |
SPOTLIGHT_OIDC_TRUST | A 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 file | The login's token. |
| Error | Cause |
|---|---|
no token for <address>. Run spotlight login --url <address>, or set SPOTLIGHT_API_TOKEN, or SPOTLIGHT_OIDC_TRUST in CI | None 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_URL | More 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: write | A 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:
| Flag | Description |
|---|---|
--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. |
| Variable | Description |
|---|---|
SPOTLIGHT_URL | The address, when --url is not given. |
SPOTLIGHT_WORKSPACE | The workspace slug, when --workspace is not given. |
SPOTLIGHT_API_TOKEN | A workspace token with the secrets scope. Without it, the login for the address. |
The address is checked as spotlight login checks it.
| Error | Cause |
|---|---|
no login for <address>. Run spotlight login, or set SPOTLIGHT_API_TOKEN | No 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_URL | More than one login, and no address. |
you are in no workspace | No --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_WORKSPACE | No --workspace or SPOTLIGHT_WORKSPACE, and the caller is in more than one workspace. |
<doing>: your login ended. Run spotlight login | Spotlight answered 401. |
<doing>: you do not manage the workspace's secrets | Spotlight answered 403: the caller does not have the secrets permission. |
<doing>: no such secret or workspace | Spotlight 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.
| Code | Meaning |
|---|---|
0 | Done. |
1 | An 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.
| Column | Contents |
|---|---|
NAME | The secret's name. |
VALUE | Awaiting a value, Stored in Spotlight or Set by Terraform. |
SET AT | When Spotlight last stored a value, in local time as 2006-01-02 15:04, or - while the secret awaits a value. |
HOSTS | The 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| Message | When |
|---|---|
Spotlight stores the new value of <NAME>. | Spotlight stored the value. |
| Error | Cause |
|---|---|
the value is empty. Type it, or send it to stdin | The 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.
| Flag | Description |
|---|---|
--url | The Spotlight address. |
--editor-timeout | Sets remote.SSH.connectTimeout to 600 in the VS Code and Cursor settings. Does not ask. |
--no-editor-timeout | Does not change the VS Code and Cursor settings. Does not ask. |
--print | Shows 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 6It 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:
| System | VS Code | Cursor |
|---|---|---|
| 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:
| Condition | Result |
|---|---|
--editor-timeout | Sets it to 600. |
--no-editor-timeout | Changes nothing, and shows the line to add. |
| No flag, and a terminal | Asks <editor> … Set remote.SSH.connectTimeout to 600 in <path>? (y/N). Only y or yes sets it. |
| No flag, and no terminal | Changes 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.
| Check | When |
|---|---|
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.
| Error | Cause |
|---|---|
HOME is not set. Set it to the home folder that keeps ~/.ssh | No 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.
| Code | Meaning |
|---|---|
0 | The configuration is in place, or was printed. A check can still show ! or ✗. |
1 | An error. |
spotlight ssh proxy
spotlight ssh proxy [--url <address>] <task-or-chat>.<workspace>.spotlightConnects standard input and output to the SSH server of a sandbox. ssh runs
it as the ProxyCommand that spotlight ssh setup writes.
| Flag | Description |
|---|---|
--url | The 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.
| Error | Cause |
|---|---|
Sorry, the login to <address> did not finish: <reason>. Run: spotlight login | The command started a login, and the login failed, was denied, or expired. |
Sorry, your login for <address> expired. Run: spotlight login | Spotlight 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 open | Spotlight 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 again | Spotlight answered 503. |
Sorry, Spotlight at <address> answered <status>: <reason> | Any other answer. |
Sorry, the sandbox did not start in 10 minutes. Please try again | No host started the sandbox in time. |
The sandbox stopped. Connect again to start it | The sandbox drained or was lost. |
Sorry, the host of the sandbox is not connected to Spotlight. Please try again | The sandbox's host has no open connection for editors. |
Spotlight at <address> restarted. Connect again | Spotlight restarted. |
Sorry, the connection to the sandbox failed. Please try again | The 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.
| Code | Meaning |
|---|---|
0 | The connection closed normally. |
1 | Spotlight refused the connection, or it closed with an error. |
130 | Stopped on SIGINT or SIGTERM. |
Credentials file
spotlight login writes credentials.json in the first of these directories
that applies, on every operating system:
| Directory | When |
|---|---|
$SPOTLIGHT_CONFIG_DIR | SPOTLIGHT_CONFIG_DIR is set. |
$XDG_CONFIG_HOME/spotlight | XDG_CONFIG_HOME is set. |
~/.config/spotlight | Otherwise. |
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 login | When |
|---|---|
spotlight replay check | Neither SPOTLIGHT_API_TOKEN nor SPOTLIGHT_OIDC_TRUST is set. |
| The Terraform provider | No token and no trust is set. |
spotlight token | Neither SPOTLIGHT_API_TOKEN nor SPOTLIGHT_OIDC_TRUST is set. |
spotlight secret | SPOTLIGHT_API_TOKEN is not set. |
spotlight ssh proxy | Always. |
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.