# Notte CLI - Browser automation in your terminal
Control browser sessions and web scraping through intuitive resource-based commands
→ Read more at: Landing • Console • Docs • X • LinkedIn
# Proxy with specific country (e.g. us, gb, fr)
--proxy-tailnet-exit-node # Route public traffic through a Tailscale exit node
# (stable node ID, hostname, MagicDNS name or IP).
# Uses the workspace's Tailscale connection unless
# --proxy-tailnet-client-id/-secret are given
--no-solve-captchas # Turn OFF captcha solving (on by default)
--no-file-storage # Detach FileStorage (attached by default).
# Disables page download and files --from session
--advanced-stealth # Highest-fidelity browser for sites with
# sophisticated bot detection (approved workspaces)
--cdp-url # CDP URL of remote session provider
--dialog-policy auto|client # Who answers JavaScript dialogs: Notte (auto,
# default) or your CDP client (client); one left
# unanswered for 10 seconds is dismissed
--profile-id # Profile ID to use for session
--profile-persist # Save browser state to profile on close
--vault-id # Vault used to resolve credential fields
--screenshot-type # Screenshot type (raw, full, last_action)
--chrome-args # Chrome instance arguments (repeatable)
```
### Page Actions
Interact with pages using simplified commands (requires an active session). Start
the session with `--vault-id ` before using `page fill --vault-field`:
```bash
notte page observe # Get page state and available actions
notte page scrape --instructions "..." # Scrape content from the page
notte page click "@B3" # Click an element by ID
notte page fill "@I1" "text" # Fill an input field
notte page fill "#email" --vault-field email # Fill from the session vault
notte page fill "#password" --vault-field password # Fill the stored password
notte page fill "#card-number" --vault-field card_number
notte page fill "#card-name" --vault-field card_holder_name
notte page fill "#card-expiry" --vault-field card_expiration
notte page fill "#card-cvc" --vault-field card_cvv
notte page goto "https://example.com" # Navigate to a URL
notte page back # Go back in history
notte page forward # Go forward in history
notte page scroll-down [amount] # Scroll down the page
notte page scroll-up [amount] # Scroll up
notte page press "Enter" # Press a key
notte page mouse-click # Click at viewport coordinates [--button] [--count]
notte page mouse-move # Hover at coordinates [--from-x --from-y] [--steps]
notte page drag # Press, drag, release (alias: swipe) [--steps] [--button] [--hold-ms]
notte page screenshot # Take a screenshot
notte page select "option" # Select dropdown option
notte page check # Check/uncheck checkbox
notte page upload --file # Fill a file input. is a file in your
# uploads store, not a local path - send it with
# `notte files upload` first
notte page download # Download by clicking. The file lands in the
# session store; retrieve it with
# `notte files download --from session`
notte page new-tab # Open URL in new tab
notte page switch-tab # Switch to tab by index
notte page close-tab # Close current tab
notte page reload # Reload page
notte page wait # Wait for duration
notte page captcha-solve # Solve captcha
notte page eval-js "document.title" # Evaluate JavaScript in the page
```
#### Evaluating JavaScript
`page eval-js` prints the evaluated value **alone on stdout** — objects and
arrays as JSON, a JS `null` as `null` — with the status line on stderr, so it
captures and pipes without post-processing:
```bash
title=$(notte page eval-js "document.title")
notte page eval-js "JSON.stringify([...document.querySelectorAll('a')].map(a => a.href))" | jq length
```
Return `JSON.stringify(...)` when the answer is structured. `console.log` output
is discarded — only the returned value comes back. A failing script exits
non-zero and reports the actual JavaScript error; use `-o json` to get the full
execution result instead of the bare value.
#### Pointer gestures
Canvas, WebGL and 3D content (and many sliders) expose no element ids in
`page observe`. Take a `page screenshot`, read coordinates off the image (CSS
pixels, origin top-left), then act on them:
```bash
notte page mouse-click 640 360 --count 2 # double-click a point
notte page mouse-move 900 360 --from-x 300 --from-y 360 # hover sweep
notte page drag 200 400 900 400 --steps 40 # swipe / rotate / drag
```
### Functions
```bash
notte functions list [--page N] [--page-size N] [--include-deleted] # List functions
notte functions create --file function.py # Create a new function
notte functions show # View current function details
notte functions show --function-id # View specific function details (different from current function)
notte functions download function.py [--version ] # Download current function code to disk
notte functions create --file function.py --response-format @schema.json # ... with its response documented
notte functions update --file function.py # Update current function code
notte functions update --file function.py --response-format @schema.json # ... and re-document its response
notte functions configure --run-instructions "..." --self-healing # Set usage notes and self-healing
notte functions configure --shared # Enable the public code/fork link
notte functions configure --shared=false # Disable new forks
notte functions configure --deletion-protected # Refuse deletes until it is turned off
notte functions configure --deletion-protected=false # Allow deletes again (workspace admin or owner)
notte functions configure --response-format @schema.json # Document run()'s return schema without re-upload
notte functions rollback --version # Restore an earlier version (see `versions` in show)
notte functions health # Runtime health: Python version, installed packages, reachability
notte functions delete # Delete current function
notte functions fork # Fork current function to new version
notte functions run # Execute current function
notte functions run --no-stream # Poll until complete, returning final run metadata without log output
notte functions run --no-wait # Return the run ID after startup
notte functions run-metadata --wait --run-id [--wait-timeout 30m] # Wait for an existing run
notte functions runs [--page N] [--page-size N] [--running] # List runs for current function (--running = in-flight only)
notte functions run-stop --run-id # Stop a running function execution
notte functions run-metadata --run-id # Get run logs and results
notte functions schedule --cron "0 12 ? * * *" # Schedule current function (six-field cron: daily at noon UTC)
notte functions unschedule # Remove schedule from current function
notte functions git # Show whether the function is linked to a GitHub repository
notte functions pull-request --file workflow.py [--title "..."] [--body "..."] # Propose new code for a linked function
```
A function can be a file of a linked GitHub repository. `functions git` shows the
repository, the file, the production branch, whether the live version came from
a deployment of the repository, and the previews of its open pull requests. For a linked function,
use `functions pull-request` instead of `functions update`: the change is
proposed as a pull request rather than deployed, and a pull request already open
for the function is updated rather than duplicated. The pull request gets a
preview version of the function, listed by `functions git`, so the change can be
run before it is merged with `notte functions run --version `.
Function runs print their ID and a tracking command to stderr as soon as the
server creates the run. After the runner accepts the request, the CLI closes the
response stream and polls metadata. `--timeout` applies to each API request;
`--wait-timeout` limits the total wait (unlimited by default). `--no-wait` returns
after startup so another command can wait separately.
In JSON mode, stdout contains one object: the run ID and status with `--no-wait`,
or final run metadata (including `status`, `logs`, and the stored `result` string)
when waiting. Logs are printed to stderr as they become available in metadata;
some runners persist logs only at completion. `--no-stream` suppresses those
log messages. An interrupted or timed-out CLI does not cancel the server run:
resume with `run-metadata --wait`, or explicitly stop it with `run-stop`.
### Personas, Profiles and Usage
```bash
notte personas update --persona-id --name "checkout tester" # Rename a persona
notte profiles cookies --profile-id # Read a profile's cookies
notte profiles cookies-set --profile-id --file cookies.json # Import cookies into a profile
notte usage logs [--endpoint /sessions/start] [--page N] # List API requests made with your key
```
`profiles cookies-set` takes either a bare array of cookies — what Playwright's
`storageState` and the browser extensions export — or an object with a `cookies`
key. Add `--source-format chrome` if they came from Chrome, and `--mode append`
to add to the profile's cookies rather than replace them.
`--response-format` takes a JSON Schema describing what `run()` returns, as
inline JSON, `@file.json`, or `-` for stdin. The API never derives it, so a
function created without it has no documented response — which is what the
console reads to show callers the shape they will get back. From a pydantic
return model:
```bash
python -c 'import json, typing, client; print(json.dumps(typing.get_type_hints(client.run)["return"].model_json_schema()))' > schema.json
notte functions create --file client.py --response-format @schema.json
# Or document it later without re-uploading the code:
notte functions configure --response-format @schema.json
```
`--run-instructions` is documentation for whoever *calls* the function — how long a
run takes, what each variable is for, which sites it trips over:
```bash
notte functions configure --run-instructions "Takes ~3 min, so call it with --no-wait. \
Hits a captcha on the login page every few runs. \
\`query\` is the search term; \`max_items\` caps the results."
```
It is not input to the self-healing agent, which is the separate
`--self-healing` flag.
`configure` sends only the flags you pass, so setting `--run-instructions` leaves
self-healing untouched. Disable self-healing with `--self-healing=false`: the
API treats an absent field as "leave it alone" rather than "off". Note that it
can only be enabled on functions an agent built — a CLI-created function has no
thread for the healer to resume, and the API rejects it.
**Note:** When you create a function, it automatically becomes the "current" function. All subsequent commands use this function by default. Use `--function-id ` only when you need to manage multiple functions simultaneously or reference a specific function.
### Vaults
```bash
notte vaults list [--page N] [--page-size N] [--include-deleted] # List all vaults
notte vaults create # Create a new vault
notte vaults update --vault-id # Update vault metadata
notte vaults delete --vault-id # Delete a vault
notte vaults credentials list --vault-id # List all credentials
notte vaults credentials add --vault-id # Add credentials
notte vaults credentials get --vault-id # Get credentials for URL
notte vaults credentials delete --vault-id # Delete credentials
```
### Personas
```bash
notte personas list [--page N] [--page-size N] [--include-deleted] # List all personas
notte personas create # Create a new persona
notte personas show --persona-id # View persona details
notte personas delete --persona-id # Delete a persona
notte personas emails --persona-id # List emails
notte personas sms --persona-id # List SMS messages
```
### Profiles
```bash
notte profiles list [--page N] [--page-size N] [--name "..."] [--include-deleted] # List all profiles
notte profiles create # Create a new profile
notte profiles show --profile-id # View profile details
notte profiles delete --profile-id # Delete a profile
notte profiles sync # Copy your local browser login into a profile
```
`profiles sync` copies cookies and localStorage from a local Firefox, Chrome,
Brave, Edge, Chromium, Arc or Helium profile into a Notte profile. This includes
logins stored only in localStorage, even when the site has no cookies. Browser
files are read through private temporary copies; encrypted cookies are decrypted
locally. Nothing is uploaded until you confirm (or pass `--yes`). `--domain`
restricts cookies and storage to the named hosts and their subdomains.
```bash
notte profiles sync # choose a local browser profile
notte profiles sync --domain bsky.app # include storage-only logins
notte profiles sync --browser brave --local-profile Work # choose the source explicitly
notte profiles sync --profile-id --domain bsky.app # refresh an existing profile
notte profiles sync --cdp-url http://127.0.0.1:9222 --domain bsky.app
```
Start a remote session with `notte sessions start --profile-id `. Re-run sync
when a local login changes. Disk reading is supported on macOS and Linux (Arc
and Helium on macOS only). Chromium cookie decryption may ask for OS keychain
access. Close the source browser and retry if its files change during a copy.
For live **sessionStorage**, use `--cdp-url` with a Chromium browser already
running with remote debugging enabled in a dedicated profile. Sign into the
site there and keep its tab open. Accepts a debugger HTTP origin or a **page**
WebSocket URL; it reads matching top-level tabs without navigating them. Tabs
with conflicting state for the same origin are rejected rather than combining
different accounts. Disk sync cannot capture in-memory sessionStorage and leaves
previously stored sessionStorage unchanged.
Storage imports require an API deployment supporting `POST /profiles/{id}/state`.
Older deployments return an explicit unsupported-server error; the CLI never
silently drops localStorage to fall back to cookies. Scoped cookie-only syncs
also use the state API to preserve other sites. Unscoped cookie-only disk syncs
remain compatible with the existing cookies API. `--mode replace` replaces
captured state classes within `--domain` (or all sites without a scope).
Live sync replaces web storage only for captured origins, preserving saved
state for closed tabs. `--mode append` merges cookie identities and storage keys.
Avoid importing into a profile while a remote browser is saving
its state into that same profile.
The snapshot limit is 8 MiB. Values are never printed in summaries or JSON
output. Unreadable or undecryptable selected state fails before upload. IndexedDB,
partitioned/container storage, browser extensions, passkeys and device-bound
credentials are not transferred. Some sites also bind sessions to an IP or
require a new sign-in; copying browser state cannot guarantee every site's login.
### Files
```bash
notte files upload # Upload a persistent input file
notte files list --from uploads # List persistent input files
notte files download --from uploads # Download a persistent input file
notte files list --from session [--session-id ] # List files produced by a session
notte files download [--session-id ] # Download a file produced by a session
```
### Utilities
```bash
notte usage # View API usage statistics
notte health # Check API health status
notte version # Show CLI version
```
## Output Formats
### Text
The default, written for people: tables for lists, a short labelled block for
one item, relative times, and a hint at what to run next. IDs are always shown
whole.
```bash
$ notte functions list
FUNCTION (2) NAME STATUS VERSION UPDATED CONSOLE
demo-function-001 Product price tracker active v3 2 h ago open in console ↗
demo-function-002 Newsletter signup active v1 Jan 14 open in console ↗
Run one with: notte functions run --function-id
```
Text output may change between releases. Do not parse it.
### JSON
`--output json` (or `-o json`) prints the API's own data on stdout: an object
for one item, an array for a list.
```bash
$ notte functions list -o json
[{"function_id":"demo-function-001","name":"Product price tracker","status":"active","latest_version":"3", ...}]
```
Fields are added over time and are not renamed or removed.
### For scripts and agents
- Set `NOTTE_OUTPUT=json` once instead of passing `-o json` to every command.
- Data goes to stdout; errors, progress and notes go to stderr.
- An error is one JSON object on stderr with a stable `code`:
`{"code":"not_found","error":"...","status_code":404}`.
- The exit code says what kind of failure it was:
| Exit | `code` | Meaning |
| --- | --- | --- |
| 0 | | Success |
| 1 | `error`, `api_error`, `plan_limit` | Any other failure; `plan_limit` means the plan allows no more of a resource, so close some or upgrade instead of retrying |
| 2 | `usage` | Wrong flags or arguments; nothing was sent |
| 3 | `unauthorized` | Not signed in, or the API rejected the key |
| 4 | `not_found` | The API has no such resource |
| 5 | `confirmation_required` | A command that deletes needs `--yes` |
| 6 | `rate_limited` | Too many requests; retry later |
| 7 | `run_failed` | The function run that was waited for failed or was rejected; its data is still on stdout |
- Commands that delete ask for confirmation in a terminal. Without one they
do not wait for input: pass `--yes` (or `-y`), or they exit with code 5.
- When a list has more rows, stderr says `More results: add --page 2`.
- `notte functions run` and `run-metadata --wait` print the run and then exit
with code 7 when it failed or was rejected (it raised one of the function's
`--expected-errors`), so such a run is never mistaken for success.
- In text mode a command that changes something prints one line saying what
it did, and every view ends with a `Next:` line. Neither is in the JSON.
## Examples
### Automated Web Scraping Pipeline
```bash
# Start session (automatically becomes the current session)
notte sessions start
# Navigate to page
notte page goto "https://news.ycombinator.com"
# Extract structured data
notte page scrape --instructions "Extract top 10 stories with title and URL"
# Cleanup
notte sessions stop
```
### Running a Function
```bash
# List functions to find ID
notte functions list
# Run function
notte functions run --function-id func_abc123
```
### Managing Credentials Securely
```bash
# Create a vault for production credentials
VAULT_ID=$(notte vaults create --name "Production Sites" -o json | jq -r '.vault_id')
# Add website credentials
notte vaults credentials add --vault-id $VAULT_ID \
--username "admin@example.com" \
--password "$SECURE_PASSWORD" \
--url "https://app.example.com"
# List stored credentials
notte vaults credentials list --vault-id $VAULT_ID
```
### Multi-Step Browser Automation
```bash
# Start browser with specific configuration
notte sessions start \
--browser-type chrome \
--viewport-width 1920 \
--viewport-height 1080
# Navigate and interact
notte page goto "https://example.com"
notte page click "#login-button"
notte page fill "#username" "user@example.com"
# Get current page state with available actions
notte page observe
# Stop when done
notte sessions stop
```
### JQ Filtering
```bash
# Get only active sessions (using built-in filter)
notte sessions list --all
# Paginate through results
notte sessions list --page 2 --page-size 5
# Extract session IDs with jq
notte sessions list --output json | jq -r '.[].session_id'
```
## Usage with AI Agents
### Just Ask the Agent
The simplest approach - just tell your agent to use it:
> Use notte to test the login flow. Run `notte --help` to see available commands.
The `--help` output is comprehensive and most agents can figure it out from there.
### AI Coding Assistants
Add the skill to your AI coding assistant for richer context:
```bash
npx skills add nottelabs/notte-skills
```
This works with Claude Code, Cursor, Windsurf, and other MCP-compatible assistants.
### AGENTS.md / CLAUDE.md
For more consistent results, add to your project or global instructions file:
```markdown
## Browser Automation
Use `notte` for web automation. Run `notte --help` for all commands.
Core workflow:
1. `notte sessions start` - Start a browser session
2. `notte page goto ` - Navigate to a URL
3. `notte page observe` - Get interactive elements with IDs (@B1, @B2)
4. `notte page click "@B1"` / `notte page fill "@I1" "text"` - Interact using element IDs
5. `notte page scrape --instructions "..."` - Extract structured data
6. `notte sessions stop` - Clean up when done
```
### Tips
- **Viewing sessions**: When you start a session, the output includes a `ViewerUrl` - open it to watch the browser live
- **Session lifetime**: sessions close after **3 minutes idle** or **15 minutes total** by default. Raise `--idle-timeout-minutes`/`--max-duration-minutes` for anything slow, or the next command fails with `Session closed`
- **Element selectors**: If element IDs from `observe` (like `@B1`) don't work, use Playwright selectors: `#id`, `.class`, `button:has-text('Submit')`
- **Multiple matches**: Use `>> nth=0` suffix to select the first match: `button:has-text('OK') >> nth=0`
- **Closing modals**: `notte page press "Escape"` reliably dismisses most dialogs
### Skills Documentation
For comprehensive documentation including templates and reference guides, see the [notte-skills/plugins/notte-cli/skills/notte-browser](notte-skills/plugins/notte-cli/skills/notte-browser/SKILL.md) folder (vendored as a submodule from [nottelabs/notte-skills](https://github.com/nottelabs/notte-skills)).
## Security
### Credential Storage
`notte login` stores the API key (and `notte tunnel up` stores a Tailscale OAuth client secret) in your system's credential store:
- **macOS**: the login Keychain, service `notte-cli`. After upgrading `notte`, macOS may ask once to let the new binary read the item: choose **Always Allow**.
- **Windows**: Credential Manager, generic credentials named `keyring:notte-cli:...`.
- **Linux**: a Secret Service (such as GNOME Keyring), KWallet or `pass`, whichever is available.
When no system store is usable (headless Linux, containers, a locked Keychain over SSH), the key is written to an encrypted file in `~/.notte/cli` (or `$NOTTE_CONFIG_DIR/.notte/cli`), readable only by your user. Its encryption password is fixed and public, so this file is protected no better than a plain text file with `0600` permissions: anything running as your user can read the key. The same holds for a key put in `~/.notte/cli/config.json`. On shared or untrusted machines, prefer a system store or `NOTTE_API_KEY` from a secret manager.
Earlier versions used that file on macOS and Windows too. A key found there is copied into the system store the next time it is used, and the file copy is removed at the next `notte auth login` or `notte auth logout`. While a file copy exists, it is the one used.
A saved key (from the credential store or the config file) or a key read from `NOTTE_API_KEY_FILE` is only sent to an `https://` API URL, or over plain HTTP to `localhost`, `127.0.0.1` or `::1`. `NOTTE_API_KEY` is not restricted.
### Best Practices
- Never pass API keys on the command line
- Use vaults for website passwords and payment cards
- Rotate API keys regularly from notte.cc dashboard
- Use `notte auth logout` to remove stored keys
## Shell Completions
Generate shell completions for your preferred shell:
### Bash
```bash
# macOS (Homebrew):
notte completion bash > $(brew --prefix)/etc/bash_completion.d/notte
# Linux:
notte completion bash > /etc/bash_completion.d/notte
# Or source directly:
source <(notte completion bash)
```
### Zsh
```zsh
notte completion zsh > "${fpath[1]}/_notte"
```
### Fish
```fish
notte completion fish > ~/.config/fish/completions/notte.fish
```
### PowerShell
```powershell
notte completion powershell | Out-String | Invoke-Expression
```
## Development
After cloning, install git hooks:
```bash
make setup
```
This installs [lefthook](https://github.com/evilmartians/lefthook) pre-commit and pre-push hooks for linting and testing.
### Playground
Run `make playground` and open for a terminal in the browser that runs the CLI built from your checkout and rebuilds it on every save. `make playground-export` builds a static site that runs the CLI in the visitor's browser, compiled to WebAssembly. See [playground/README.md](playground/README.md).
### Releasing
Releases follow the Notte API's production deployments in two steps:
1. **Prepare release** (`prepare-release.yml`) opens a draft at a `main` commit (default: current `main`) with generated notes. The version defaults to the next patch. A draft of the same version and commit is kept, and any other draft is replaced, so one release waits at a time. It drafts nothing when the commit has no changes since the last tag besides `Formula/`.
2. **Publish release** (`publish-release.yml`) regenerates the API client, property names and flags from production's OpenAPI and, only if they match, tags the draft's commit. The tag runs `release.yml`: GoReleaser uploads the files into the draft, publishes it, and updates the Homebrew formula.
`release.yml` shares their concurrency group, so Prepare release waits until GoReleaser finishes. If the upload fails, the tagged release stays a draft and Prepare release refuses to run until Release is rerun for it.
A production deployment of the Notte API triggers both steps automatically. You can also run either step by hand. Do not publish the draft from the Releases page: the release would go public before its files exist, and GoReleaser would then find no draft to upload into.
GoReleaser signs the macOS binaries with the Notte Labs Developer ID Application certificate and notarizes them. Without that signature, macOS asks for Keychain access again after every upgrade. It needs these repository secrets:
- `MACOS_SIGN_P12`: the certificate, its private key, and Apple's Developer ID G2 CA and Apple Root CA, as a base64 `.p12`. Without the root, the binaries are notarized but do not satisfy their own designated requirement (`codesign --verify --strict`), and macOS keeps asking for Keychain access.
- `MACOS_SIGN_PASSWORD`: the `.p12` password
- `MACOS_NOTARY_ISSUER_ID`, `MACOS_NOTARY_KEY_ID`: an App Store Connect API key of the same team
- `MACOS_NOTARY_KEY`: that key's `.p8`, base64
Apple rejects signing-certificate and notarization requests while the team's Account Holder has not accepted the latest Program License Agreement (developer.apple.com > Account).
## License
This project is licensed under the MIT License.
## Links
- [Landing](https://notte.cc?ref=github)
- [Console](https://console.notte.cc/?ref=github)
- [Documentation](https://docs.notte.cc?ref=github)
- [Main repository (nottelabs/notte)](https://github.com/nottelabs/notte)
Copyright © 2025 Notte Labs, Inc.
## Coverage guards
Two checks keep the CLI in step with what surrounds it. Both read a live source
of truth, so both need the network; `make` runs them with `-strict`, where an
unreachable source is a failure. The pre-commit hooks run them without it, so an
offline commit warns and proceeds.
```bash
make check-endpoints # every API endpoint is reachable or recorded as skipped
make check-skills # every command is documented in nottelabs/notte-skills
make check-coverage # both
```
`check-endpoints` compares the API's OpenAPI spec against the commands. An
endpoint is covered when a command calls its generated client method; anything
else has to be listed in [`scripts/endpoint-coverage.txt`](scripts/endpoint-coverage.txt)
with a reason, as `manual` (a command builds the request itself) or `skip` (not
exposed on purpose). A line whose endpoint the API no longer serves fails too,
so the file cannot rot the way the flag generator's endpoint map did.
`check-skills` walks the cobra tree and requires every non-hidden command to be
mentioned somewhere under `plugins/notte/skills/` in the skills repository. Pass
`-skills-dir ` to check against a working copy before pushing it:
```bash
go run ./scripts/checkcoverage -check skills -skills-dir ../notte-skills -strict
```
### Session payments
Connect your wallet first. This returns a URL and phrase; authorize in your browser.
Completion is recorded in the background. Re-run the same command to confirm
`connected` or retrieve the pending link:
```bash
notte payment connect --mode test -o json
```
Then request spending for an existing session (amounts use currency units):
```bash
notte payment request --session-id "$SESSION_ID" --mode test --amount 1.00 --currency usd \
--merchant-url https://example.com --merchant-name Example \
--description "Buy one sandbox item for this browser session, with a maximum total of one US dollar including all applicable fees." \
--idempotency-key "$REQUEST_KEY" -o json
notte payment status "$PAYMENT_ID" -o json
notte payment wait "$PAYMENT_ID" --wait-timeout 10m -o json
```
When `--mode` is omitted, both commands use the API default. Use `--mode test` on both commands for a development/test payment. Wallet
connections are scoped to your authenticated account and mode. Requests fail with
`wallet_not_connected` until connection completes; they do not start connection
or reserve a card slot. Once connected, a request provides a spending approval
URL. Send that URL to the user before waiting for the card.
To switch wallets, run `notte payment disconnect --mode live`, then
`notte payment connect --mode live`. Disconnect affects only the selected mode
and refuses while payments or card cleanup are still active. Use `--mode test`
for the test wallet. Omitting the mode uses the API default.
If Link requires additional wallet verification, `payment wait` prints the action
URL. Resumable verification keeps waiting on the same request. When Link requires
a new spend request, the command exits with instructions to complete verification
and request payment again with a new idempotency key. `payment status -o json`
includes the structured `next_action` instructions.
`wait` displays approval and verification instructions on stderr as they become
available and prints one final result on stdout when ready. It exits nonzero on
failure, expiration, decline, session closure, or timeout. Stopping the CLI does
not cancel provisioning; resume with the same payment ID. Requests print their
idempotency key on stderr; reuse it with the same inputs to recover an uncertain
request without creating another one.
`ready` means the temporary card is available for existing vault placeholders.
It does not confirm a merchant purchase. Payment commands never return card
numbers, security codes, or wallet tokens. Descriptions must contain 100 to 4000
characters. `--amount 100.91 --currency usd` requests USD 100.91. The backend
validates currency precision without rounding and enforces a 50,000-minor-unit
limit (USD 500.00).
The deployed sandbox lifecycle test runs real CLI subprocesses and creates a
short-lived browser session and unapproved test spend request. It checks request
replay, status, wait timeout, and session-close cleanup without approving a wallet
request or submitting a merchant payment:
```bash
NOTTE_API_URL=https://YOUR_ENABLED_TEST_DEPLOYMENT \
NOTTE_PAYMENT_E2E_REQUIRED=1 \
go test -tags=integration ./tests/integration \
-run '^TestPaymentSandboxLifecycle$' -count=1 -v
```
Supply `NOTTE_API_KEY` through the environment. The normal integration suite
skips this case only when the API explicitly returns `payments_disabled`.
`NOTTE_PAYMENT_E2E_REQUIRED=1` makes that condition fail instead, so a release
validation cannot count a disabled feature as a passed payment test. Auth and
configuration errors always fail. Use a dedicated test principal without someone
concurrently approving its payment requests.