LaneshotDocs

Search the docs

Find a page or a section

Open Laneshot

AI and developers

CLI

Read captures, cards, and automations from a terminal or CI job, upload screenshots and videos, and connect AI agents.

The laneshot command reads captures, cards, and automations, uploads screenshots and videos, and prints the setup for AI agents. It's built on the REST API, is MIT-licensed, and needs Node.js 22 or later.

npx @laneshot/cli trace https://laneshot.acme.test/traces/7c1e4f2a-93b8-4d55-a0e1-2f6b9d3c8a17 --markdown

Install

Run it without installing, which always uses the latest version:

npx @laneshot/cli <command>

Or install it globally to get the laneshot command:

npm install -g @laneshot/cli
laneshot --version

The examples on this page use laneshot. Replace it with npx @laneshot/cli if you didn't install it.

Sign in

laneshot login
Laneshot address: https://laneshot.acme.test
API token (create one at https://laneshot.acme.test/account): lsh_4Qm…
Signed in to https://laneshot.acme.test as Léo Martin (leo.martin@acme.test) in Acme.
Saved to /Users/leo/.config/laneshot/config.json.

Create the token in Laneshot: open the account menu, choose Account settings, enter a name under Browsers and API tokens, choose the organization if you belong to several, then select Create token. The CLI then works inside that organization only. See Create a token. The CLI checks the token before saving it, and only accepts tokens starting with lsh_.

To sign in without prompts, pass both values:

laneshot login --url https://laneshot.acme.test --token "$LANESHOT_TOKEN"

Where credentials are kept

The address and token are saved to $XDG_CONFIG_HOME/laneshot/config.json, or ~/.config/laneshot/config.json when XDG_CONFIG_HOME isn't set. The file is readable by your user only (mode 0600). laneshot logout deletes it.

Environment variables override the file, which is how CI jobs should pass credentials:

Variable Description
LANESHOT_URL Your Laneshot address, such as https://laneshot.acme.test.
LANESHOT_TOKEN An API token starting with lsh_.
XDG_CONFIG_HOME Where to keep laneshot/config.json.

Public share links work without signing in, as long as LANESHOT_URL points to the server.

Commands

Command Description
login Sign in and save the token
logout Delete the saved token
whoami Show who you're signed in as
traces List recent captures
trace Read a capture: summary, Markdown report, console, network, actions, or transcript
upload Upload a screenshot or video
projects List your projects
cards search Find cards by title or number
card Read a card
card create Create a card
automations List a project's automations
run Run an automation
mcp Print the MCP setup for Claude Code, Cursor, VS Code, or Codex
skill Print the command that installs the agent skills

Global options

Option Description
--json Print the API's JSON instead of tables. Every command supports it.
-h, --help Print the list of commands.
-v, --version Print the CLI's version.

Wherever a command takes a project, you can pass its key, such as SHOP, in any case, or its ID. Wherever it takes a capture, you can pass an ID, a private link, or a public link.

logout and whoami

laneshot whoami
Name          Léo Martin
Email         leo.martin@acme.test
Organization  Acme (acme, member)
Server        https://laneshot.acme.test

The organization is the one the token belongs to. Every other command works inside it: projects lists its projects, and card SHOP-3 looks for SHOP there.

laneshot logout deletes the saved file and prints Signed out. Tokens set through LANESHOT_TOKEN aren't affected. To revoke a token, remove it from Account settings in Laneshot.

traces

laneshot traces --project SHOP --limit 3
CREATED           KIND        TITLE                                         CARD     ERRORS  FAILED  ID
2026-11-09 14:32  video       Card payment fails with 3-D Secure on Safari  SHOP-3   2       1       7c1e4f2a-93b8-4d55-a0e1-2f6b9d3c8a17
2026-11-08 09:12  replay      Promo code field rejects lowercase codes      SHOP-9   0       1       b2d4f6a8-1c3e-4a5b-8d7f-9e0a1b2c3d4e
2026-11-07 17:05  screenshot  Order summary overlaps the footer on iPad     SHOP-11  0       0       c3e5a7b9-2d4f-4b6c-9e8a-0f1a2b3c4d5e
Option Description
-p, --project Only captures attached to this project.
-n, --limit How many to list, up to 100. Defaults to 20.

Times are in UTC.

trace

laneshot trace https://laneshot.acme.test/traces/7c1e4f2a-93b8-4d55-a0e1-2f6b9d3c8a17
Card payment fails with 3-D Secure on Safari

Kind      video
Page      https://shop.acme.test/checkout/payment
Browser   Safari 18.1
System    macOS 15.1
Duration  47.2s
Errors    2
Failed    1 of 38 requests
Card      SHOP-3
Link      https://laneshot.acme.test/traces/7c1e4f2a-93b8-4d55-a0e1-2f6b9d3c8a17

I approve the payment in my bank app, then checkout says "Payment failed".

Next: --markdown for the full report, --console --errors, --network --errors, --transcript.

Choose one view with an option:

Option Prints
-m, --markdown The whole capture as Markdown: description, environment, app metadata, errors, failed requests with bodies, actions, transcript, and backend telemetry. The format AI agents read best.
--console Console output. Add -e, --errors for errors only.
--network Requests, without assets. Add -e, --errors for failed requests only.
--actions Clicks, typing, navigation, and page events.
--transcript What the person said while recording.
-n, --limit With --console, --network, or --actions: how many events, up to 5,000. Defaults to 500.
laneshot trace 7c1e4f2a-93b8-4d55-a0e1-2f6b9d3c8a17 --network --errors
 +38.6s  502   POST https://shop.acme.test/api/payments/confirm (1843 ms)  trace=4bf92f3577b34da6a3ce929d0e0e4736

Each line starts with the time from the start of the recording. Negative times, such as -4.2s, are the moments before recording started. Requests show the backend trace ID Laneshot added to them, which you can look up in your tracing tool. See Backend telemetry.

laneshot trace 7c1e4f2a-93b8-4d55-a0e1-2f6b9d3c8a17 --console --errors
 +38.6s  ERROR Payment failed: upstream_timeout
 +38.7s  ERROR Unhandled rejection: PaymentError: upstream_timeout [iframe https://js.stripe.com]
laneshot trace 7c1e4f2a-93b8-4d55-a0e1-2f6b9d3c8a17 --transcript
 0:01  I'm paying with the Visa that always asks for 3-D Secure.
 0:21  The bank app says approved, but back here it says payment failed.

upload

Uploads a screenshot or video as a capture.

laneshot upload test-results/checkout-failed.png \
  --title "e2e: checkout › pays with a saved card" \
  --description "Failed on main, run 4812." \
  --project SHOP
creating…
events…
media…
completing…
Uploaded: https://laneshot.acme.test/traces/f1e2d3c4-b5a6-4978-8a6b-5c4d3e2f1a0b
Option Description
-t, --title Required. The capture's title.
-d, --description What went wrong.
-p, --project Create a new bug card for the capture in this project.
-c, --card Attach the capture to an existing card instead, such as SHOP-3.

Without --project or --card, the capture stays in your own library.

The file type sets the kind of capture: .png, .jpg, and .jpeg become screenshots, .webm and .mp4 become videos. The capture has no console or network events, and its environment describes the CLI rather than a browser: the page is file://<file name> and the browser is Laneshot CLI. Progress goes to standard error, and the link to standard output.

projects

laneshot projects
KEY   NAME              ID
SHOP  Acme Storefront   3f2c9a1e-7b4d-4c1a-9e2f-5a6b7c8d9e01
OPS   Acme Operations   8b7a6c5d-4e3f-4a2b-9c1d-0e9f8a7b6c5d
laneshot cards search SHOP safari
CARD     TITLE
SHOP-3   Card payment fails with 3-D Secure on Safari
SHOP-11  Order summary overlaps the footer on iPad Safari

Matches titles containing the words, ignoring case, or a card number. Returns up to 20 cards, most recently updated first.

card

laneshot card SHOP-3
SHOP-3  Card payment fails with 3-D Secure on Safari

Type      bug
Priority  urgent
Assignee  Léo Martin
Labels    checkout, safari
Link      https://laneshot.acme.test/projects/3f2c9a1e-7b4d-4c1a-9e2f-5a6b7c8d9e01?card=3

After the 3-D Secure challenge, Safari returns to checkout with "Payment failed".

Issues
  ○ acme/storefront#482  Card payment fails with 3-D Secure on Safari  https://github.com/acme/storefront/issues/482

Traces
  Card payment fails with 3-D Secure on Safari  https://laneshot.acme.test/traces/7c1e4f2a-93b8-4d55-a0e1-2f6b9d3c8a17

Comments
  Maya Chen: The 502 starts right after the redirect back from the bank.

○ marks open issues and ● closed ones.

card create

laneshot card create SHOP --title "Apple Pay sheet closes immediately on iOS 18" --type bug --priority high
Created SHOP-14: https://laneshot.acme.test/projects/3f2c9a1e-7b4d-4c1a-9e2f-5a6b7c8d9e01?card=14
Option Description
-t, --title Required.
-d, --description Markdown.
--type task (default), story, or bug.
--priority low, medium (default), high, or urgent.

The card goes to the bottom of the project's first column. Requires the Editor, Technical, or Project admin role in the project.

automations and run

laneshot automations SHOP
NAME                                 TRIGGER        ON   ID
Escalate checkout bugs to #payments  manual         yes  a7b8c9d0-e1f2-4a3b-9c4d-5e6f7a8b9c0d
File Safari bugs in Linear           trace.created  yes  d0c9b8a7-f6e5-4d4c-8b3a-2f1e0d9c8b7a
laneshot run a7b8c9d0-e1f2-4a3b-9c4d-5e6f7a8b9c0d --card SHOP-3
Run succeeded.
  ✓ Send a webhook: Delivered to hooks.slack.com (HTTP 200, attempt 1)
  ✓ Set the priority: Priority set to urgent

run works whatever the automation's trigger, checks its conditions, and records the run in its history. -c, --card passes the card the actions apply to. See Automations.

mcp

Prints how to connect an AI client to Laneshot's MCP server with your saved token:

laneshot mcp --client claude
# claude
claude mcp add --transport http laneshot https://laneshot.acme.test/api/mcp --header "Authorization: Bearer lsh_4Qm…"

Public share links also work without a token: https://laneshot.acme.test/api/mcp/public
--client Output
claude A claude mcp add command for Claude Code.
cursor A block for ~/.cursor/mcp.json.
vscode A block for .vscode/mcp.json.
codex A block for ~/.codex/config.toml, reading the token from LANESHOT_TOKEN.

Without --client, it prints all four.

skill

laneshot skill
Teach your coding agent to debug Laneshot captures:
  npx skills add laneshot/laneshot

Or one skill at a time:
  npx skills add laneshot/laneshot --skill laneshot-debug
  npx skills add laneshot/laneshot --skill laneshot-file-bug

See Agent skills.

Recipes

Upload Playwright failures from CI

Upload the screenshot of every failed test as a capture on a new card, so failures land on the board with the run's link. This GitHub Actions step runs after the tests, only when they fail:

- name: Upload failures to Laneshot
  if: failure()
  env:
    LANESHOT_URL: https://laneshot.acme.test
    LANESHOT_TOKEN: ${{ secrets.LANESHOT_TOKEN }}
    RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  run: |
    find test-results -name "*.png" -print0 | while IFS= read -r -d '' file; do
      test_name=$(basename "$(dirname "$file")")
      npx @laneshot/cli upload "$file" \
        --title "e2e: $test_name" \
        --description "Failed on ${GITHUB_REF_NAME}: $RUN_URL" \
        --project SHOP
    done

Playwright saves a screenshot per failed test when screenshot: "only-on-failure" is set in its config. Videos work the same way with video: "retain-on-failure": upload the .webm files instead.

Create the token for a dedicated CI account that is a member of the project, so cards show who filed them and the token doesn't depend on someone's personal account.

Give an agent a capture in one line

Agents without MCP can read the full report through the CLI:

laneshot trace https://laneshot.acme.test/traces/7c1e4f2a-93b8-4d55-a0e1-2f6b9d3c8a17 --markdown > capture.md

Or pipe it straight into a prompt:

claude -p "Find the root cause of this bug in this repository: $(laneshot trace "$LINK" --markdown)"

The agent skills teach agents to do this on their own when they see a Laneshot link.

Script with JSON

Every command takes --json, so you can combine it with jq:

# The card references of today's captures with failed requests
laneshot traces --project SHOP --limit 100 --json \
  | jq -r --arg today "$(date -u +%F)" \
      '.[] | select(.createdAt | startswith($today)) | select(.summary.failedRequests > 0) | .card.reference'

Exit codes

Code Meaning
0 Success.
1 Any failure: a usage mistake, an unknown option, an API error, or an unreachable server. The message is printed to standard error, prefixed with laneshot:.

Troubleshooting

laneshot: Run laneshot login first, or set LANESHOT_URL. No address is saved and LANESHOT_URL isn't set.

laneshot: Invalid API token. followed by Your token was rejected. The token was revoked or its owner was deactivated. Create a new one and run laneshot login again.

laneshot: No project "STORE". Your projects: SHOP, OPS. The key is wrong, or the account isn't a member of that project.

laneshot: Couldn't reach https://laneshot.acme.test: fetch failed Check the address, your VPN, and that the server is running. In CI, the runner must be able to reach your Laneshot server.

laneshot: Unknown option '--errrors'. … Options are checked strictly, so typos fail instead of being ignored. Run laneshot --help for the list.

laneshot: Upload a .png, .jpg, .webm, or .mp4 file. Other formats aren't accepted. Convert GIFs to MP4 first.

laneshot: You don't have permission to do that. The account is a viewer in the project, which can't create cards or attach captures.