# Environment Source: https://docs.wrapper.sh/configuration/environment CLI environment variables, defaults, and on-disk paths. Released binaries treat an unset `NODE_ENV` as production. Development from source should set `NODE_ENV=development` and explicit endpoints. ## End-user variables | Variable | Role | Production default | | - | - | - | | `WRAPPER_RELAY_URL` | Relay WebSocket base | `wss://wrapper-relay-prod.fly.dev` | | `WRAPPER_AUTH_ORIGIN` | Device-login web origin | `https://wrapper.sh` | | `WRAPPER_CONVEX_URL` | Convex `.cloud` URL | production Convex deployment | | `WRAPPER_CONVEX_SITE_URL` | Auth HTTP (`.site`) override | derived from `.cloud` | | `WRAPPER_P2P` | WebRTC fast path | on (`0`, `false`, or `off` disables) | | `WRAPPER_HUD` | Terminal-title HUD | on (`0`, `false`, or `off` disables) | | `WRAPPER_NOTIFY` | Ping when the terminal bell rings | on (`0`, `false`, or `off` disables) | | `WRAPPER_PREFIX` | Keybinding prefix (`ctrl+\`, `ctrl+g`, `0x1c`) | `Ctrl+\` | | `WRAPPER_DISABLE` | Skip shell wrap for one process | unset | | `WRAPPER_WRAPPED` | Set by `shell-host` (do not set) | unset | | `WRAPPER_LOG` | Log level | `warn` in production | | `WRAPPER_LOG_FILE` | Log path override | platform default | | `WRAPPER_TELEMETRY` | Telemetry override | disabled until opted in | | `WRAPPER_POSTHOG_KEY` | Telemetry key | empty | | `WRAPPER_TELEMETRY_URL` | Telemetry endpoint | `https://telemetry.wrapper.sh` | | `NODE_ENV` | Isolates dev paths and defaults | unset = production | | `CI` | Quiet CI mode, no telemetry | unset | Installer-only: | Variable | Role | Default | | - | - | - | | `WRAPPER_INSTALL_DIR` | Install prefix | `$HOME/.wrapper` | | `WRAPPER_VERSION` | Release tag or `latest` | `latest` | | `WRAPPER_RELEASE_REPO` | GitHub repo for assets | `heycupola/wrapper` | ## On-disk paths | Kind | Production | Development | | - | - | - | | Config | `~/.config/wrapper/` | `~/.config/wrapper-dev/` | | State | `~/.local/state/wrapper/` | `~/.local/state/wrapper-dev/` | Important files: * `auth.json` in the config directory * `config.json` in the config directory (optional prefix override) * `sessions.json` in the state directory * log files under the state directory (or `WRAPPER_LOG_FILE`) ## Keybinding prefix The in-session prefix defaults to `Ctrl+\`. Override it with `WRAPPER_PREFIX` or `~/.config/wrapper/config.json`. Environment wins over the file. ```json theme={null} { "prefix": "ctrl+g" } ``` ```bash theme={null} WRAPPER_PREFIX=ctrl+g ``` Accepted forms: `ctrl+g`, `ctrl+\`, `^G`, `0x1c`. Interrupt keys (`Ctrl+C`, `Ctrl+D`, `Ctrl+Z`, Enter, Tab, Esc) are rejected so the shell stays usable. Command letters (`s`, `u`, `w`, `d`, `?`) stay fixed. ## Development defaults With `NODE_ENV=development`: * Relay defaults toward `ws://localhost:8080` * Auth origin defaults toward `http://localhost:3000` * Convex must be set explicitly (`WRAPPER_CONVEX_URL` or `CONVEX_URL`) See [Setup](/development/setup) and the repository [`ENVIRONMENTS.md`](https://github.com/heycupola/wrapper/blob/main/ENVIRONMENTS.md) for the full deploy matrix. # Security and privacy Source: https://docs.wrapper.sh/configuration/security Authorization model, terminal-data paths, and trust boundaries. Wrapper treats terminal content as sensitive. A session is local and owner-only until its host explicitly shares it. ## Access requirements ### Local attach * The WebSocket listens only on `127.0.0.1`. * Every host generates a random 256-bit local token. * The token is stored in the owner's protected session registry. * A local connection without the token is rejected before reaching the PTY. * Released binaries authorize local attach with the loopback token. Convex is not contacted until the host shares. Processes running as the same operating-system account, and root or administrator, remain inside the local trust boundary. ### Relay attach * Every user authenticates with Better Auth. * The owner can join their own active shared session without a share code. * A non-owner needs both the session id and share code. * Share codes are stored only as hashes. * Failed attempts are limited per account, per hashed target bucket, and globally without revealing whether the target exists. * Relay tickets are random, hashed at rest, short-lived, and single-use. * Ticket consumption rechecks session state, so unsharing invalidates unused viewer tickets. Unknown, unshared, missing-code, and wrong-code sessions return the same denial shape so session ids cannot be enumerated from error messages. ## Terminal-data paths ### Unshared Input, output, and session metadata stay on the host machine. Convex is not contacted until you share. ### Direct WebRTC The viewer and host negotiate a DTLS-encrypted data channel through authenticated relay signaling. Viewer input prefers the direct channel. WebRTC exposes each peer's IP address to the other peer and uses public STUN servers for discovery: * `stun.l.google.com:19302` * `global.stun.twilio.com:3478` The host currently keeps relay output available for fallback and mixed viewers. Wrapper therefore does not claim that the hosted relay is zero knowledge. ### Relay fallback When P2P is unavailable or disabled, terminal traffic travels through the Fly.io relay over WSS. TLS protects traffic in transit, but relay infrastructure processes plaintext after TLS termination to route it. The application does not intentionally persist terminal payloads. Use `WRAPPER_P2P=0` to force relay-only behavior. Do not share a session whose content you are not willing to send through the configured relay. ## Shared sessions People you invite see the screen. They cannot type unless you allow it with `Ctrl+\` then `w`, or by starting with `wrapper share --writable`. You always type, including from your phone. Share codes are capabilities: give them only to people you trust, and press `Ctrl+\` then `u` when you are done. Interactive CLI attach asks for the share code in a hidden prompt. `--code` is reserved for automation because command-line arguments can be visible in shell history and process listings. Attention alerts to the owner's phone name the session only. They never include terminal output, commands, paths, or credentials. Disable them with `WRAPPER_NOTIFY=0`. ## Payload and abuse protection * Raw wire frames are capped before JSON parsing. * Terminal input, output, and signaling payloads have explicit size limits. * The relay caps messages buffered before authorization. * Peer ids are assigned by the relay and cannot be spoofed by clients. * Messages with a different session id are rejected. ## Local credentials The CLI stores its Better Auth session token, local attach token, and logs in user-protected files. Run `wrapper auth logout` on a device whose credentials may be exposed. Malware running as your operating-system user can access files that you can access; Wrapper cannot remove that operating-system trust boundary. ## Telemetry Anonymous CLI telemetry is disabled by default. Enable it explicitly with: ```bash theme={null} wrapper telemetry enable ``` The website uses Vercel Web Analytics for anonymized page views. It does not use cookies. PostHog is not used on the website while `NEXT_PUBLIC_POSTHOG_KEY` is empty. Telemetry must never include terminal input or output, share codes, relay tickets, or authentication tokens. ## Report a vulnerability Do not publish suspected vulnerabilities. Follow the [hosted security-reporting instructions](https://wrapper.sh/support#security) or the repository's [branch-independent security policy](https://github.com/heycupola/wrapper/security/policy). Reports can be sent to [can@wrapper.sh](mailto:can@wrapper.sh) or submitted as a private GitHub security advisory. # Setup Source: https://docs.wrapper.sh/development/setup Run Wrapper from source and verify the local stack. ## Prerequisites * Bun 1.3.5 or newer * macOS or Linux * A Convex development deployment Clone the repository and initialize its mobile submodule: ```bash theme={null} git clone --recurse-submodules https://github.com/heycupola/wrapper.git cd wrapper # For an existing clone: git submodule update --init --recursive ``` The parent repository tracks only the mobile commit pointer. Mobile commits belong in the nested repository first. Mobile bootstrap is optional for CLI, backend, relay, and web work. On macOS, after installing the Xcode and XcodeGen versions listed in `apps/mobile/README.md`, generate the ignored Xcode project: ```bash theme={null} make -C apps/mobile bootstrap ``` Then install the Bun workspace from the repository root: ```bash theme={null} bun install ``` ## Start the services Run each command in a separate terminal. Backend: ```bash theme={null} cd packages/backend && bunx convex dev ``` Relay (point at your Convex `.cloud` URL): ```bash theme={null} cd apps/relay CONVEX_URL="https://.convex.cloud" bun run dev ``` Web: ```bash theme={null} cd apps/web && bun run dev ``` CLI host: ```bash theme={null} NODE_ENV=development \ WRAPPER_CONVEX_URL="https://.convex.cloud" \ WRAPPER_RELAY_URL="ws://localhost:8080" \ WRAPPER_AUTH_ORIGIN="http://localhost:3000" \ bun run --cwd apps/cli dev:host ``` For an offline host-only CLI check without the backend or relay: ```bash theme={null} NODE_ENV=development bun run apps/cli/index.ts shell-host ``` Released CLI binaries use production endpoints when `NODE_ENV` is unset. Connected source development must set explicit Convex, relay, and auth URLs. The complete environment and deployment matrix lives in [`ENVIRONMENTS.md`](https://github.com/heycupola/wrapper/blob/main/ENVIRONMENTS.md). ## Local quality checks ```bash theme={null} bun run lint bun run format:check bun run check-types bun run audit bunx turbo run test ``` Docs: ```bash theme={null} bun run --cwd apps/docs build bun run --cwd apps/docs dev ``` ## Relay smoke check ```bash theme={null} RELAY_URL="https://relay.example.com" bun run --cwd apps/relay smoke ``` This checks relay health and rejects an unauthenticated WebSocket request. ## Manual end-to-end check 1. `NODE_ENV=development wrapper auth login` (or the source CLI equivalent) 2. Start a host and share with `Ctrl+\` then `s` 3. Attach from another terminal with `--relay --id ` 4. Detach with `Ctrl+\` then `d` 5. Unshare with `Ctrl+\` then `u` 6. Watch the title for `relay` then optionally `p2p` 7. Repeat with `WRAPPER_P2P=0` and confirm it stays on `relay` NAT-restricted networks and CI sandboxes often cannot form WebRTC. Relay-only success is still a valid result. # Authentication Source: https://docs.wrapper.sh/guides/auth Sign in with device authorization, inspect the session, and log out safely. Wrapper uses Better Auth device authorization. The CLI prints a verification URL, you press Enter to open it, approve a short code, and the CLI stores a session token locally. The iOS viewer uses the same approval page with the code already in the URL. ## Sign in ```bash theme={null} wrapper auth login ``` 1. The CLI prints a verification URL and user code. 2. Press Enter to open the URL in your browser, or copy it if you are on a headless session. 3. Sign in with your Wrapper account and approve the device. 4. The CLI stores credentials and can mint short-lived Convex JWTs for backend calls. While waiting for approval, the CLI may report `authorization_pending`. Leave the command running until you approve or deny the request. Optional flags for advanced setups: ```bash theme={null} wrapper auth login --client-id --scope ``` ## Inspect and log out ```bash theme={null} wrapper auth whoami wrapper auth logout ``` Run `wrapper auth logout` on any device whose credentials may be exposed. ## Where credentials live | Environment | Config directory | Auth file | | - | - | - | | Production (`NODE_ENV` unset) | `~/.config/wrapper/` | `auth.json` | | Development (`NODE_ENV=development`) | `~/.config/wrapper-dev/` | `auth.json` | Related state: | Path | Contents | | - | - | | `~/.config/wrapper/config.json` | Optional prefix and other settings | | `~/.local/state/wrapper/sessions.json` | Live local session registry (prod) | | `~/.local/state/wrapper-dev/sessions.json` | Live local session registry (dev) | Directories use restrictive permissions. Session tokens are redacted from logs. ## Why auth matters for attach Local attach uses the loopback token in the session registry. It does not require Convex or a Wrapper account. Remote share always requires auth, plus Pro for the relay entitlement. See [Pricing](/reference/pricing). Development builds with `NODE_ENV=development` and no Convex URL can exercise host wrapping without a backend, but that is not the shipped binary path. ## Auth origin Device approval runs on the web origin from `WRAPPER_AUTH_ORIGIN`: | Mode | Default | | - | - | | Production | `https://wrapper.sh` | | Development | `http://localhost:3000` | See [Environment](/configuration/environment) for overrides. # Quickstart Source: https://docs.wrapper.sh/guides/installation Install Wrapper, share a session, and attach. Does not patch your shell config. Wrapper supports macOS and Linux. On Windows, use WSL. ## Install the CLI ### Homebrew ```bash theme={null} brew install heycupola/tap/wrapper ``` If Homebrew reports that Xcode is outdated, update Command Line Tools or use the curl installer below. The formula only unpacks a release binary; it does not build Wrapper with Xcode. See [Troubleshooting](/troubleshooting). ### Checksum-verified installer ```bash theme={null} curl -fsSL https://wrapper.sh/install | bash ``` The installer downloads a release tarball from GitHub Releases, verifies `checksums.txt`, and installs under `$HOME/.wrapper` (override with `WRAPPER_INSTALL_DIR`). Optional pins: ```bash theme={null} WRAPPER_VERSION=v0.2.3 curl -fsSL https://wrapper.sh/install | bash ``` Confirm: ```bash theme={null} wrapper --version ``` ## Update the CLI Update with the same method you used to install. Homebrew: ```bash theme={null} brew update brew upgrade heycupola/tap/wrapper ``` Curl installer: ```bash theme={null} curl -fsSL https://wrapper.sh/install | bash ``` Do not mix the two. The curl installer prepends `$HOME/.wrapper/bin` to `PATH`, so that copy wins over Homebrew. After `brew upgrade`, `wrapper --version` can still show the older curl binary. Check with `which -a wrapper`. See [Troubleshooting](/troubleshooting). ## Get iOS viewer beta The iPhone and iPad app is a TestFlight viewer, not a host. The shell, files, and credentials stay on the Mac or Linux machine. After the CLI is installed and a session is shared, attach from iOS. See [Mobile viewer](/guides/mobile-viewer). ![Terminal output of the curl installer on macOS: download and checksum verification, the Wrapper banner, Installed Wrapper v0.2.4 into \~/.wrapper, and the Get started commands](https://mintcdn.com/wrapper/JLMnFS4G4wmSxZil/images/cli-install-success.webp?fit=max\&auto=format\&n=JLMnFS4G4wmSxZil\&q=85\&s=ce051a6338dd97a0d3493e71326e1c11) ## Share a session `wrapper share` does not patch your shell config: ```bash theme={null} wrapper auth login wrapper share ``` Wrap a command without sharing yet: ```bash theme={null} wrapper run -- claude ``` Prefer a remote Linux box? See [Remote Linux box](/guides/linux-remote). ## Optional: wrap every new terminal `wrapper install` is optional. It adds a line to your shell config so every new interactive shell is wrapped. Sharing does not need this. ```bash theme={null} wrapper install --dry-run wrapper install ``` ## Sign in Remote share needs a Wrapper account. Local attach uses the loopback token only: ```bash theme={null} wrapper auth login ``` Approve the device code at the printed URL. Check status with `wrapper auth whoami`. See [Authentication](/guides/auth) for token storage and logout. ## Attach locally From another terminal on the same machine: ```bash theme={null} wrapper status wrapper attach ``` Local attach uses loopback plus a per-session token from your session registry. It does **not** use the Fly relay, Convex, or Pro. See [Local attach](/guides/local-attach). ## Share remotely (Pro) `wrapper share` shares immediately. In a running host, press `Ctrl+\` then `s`. Wrapper prints a share code and join command when the shell is idle. Owner join from any device: ```bash theme={null} wrapper attach --relay --id ``` Guest join uses the same command and a hidden share-code prompt. Press `Ctrl+\` then `u` to revoke access. > [!WARNING] > > People you invite see the screen. They cannot type unless you allow it. See [Remote share](/guides/remote-share), [Pricing](/reference/pricing), and [Security and privacy](/configuration/security). # Remote Linux box Source: https://docs.wrapper.sh/guides/linux-remote Run Wrapper on an always-on Linux host without installing it on your laptop. A dedicated Linux machine, VPS, or devbox is the recommended host if you do not want Wrapper on your laptop. The phone is a viewer. The shell, files, and credentials stay on the box. This path does **not** patch your shell config. You share one session at a time. ## Install the CLI On the Linux host: ```bash theme={null} curl -fsSL https://wrapper.sh/install | bash ``` Supported installer targets: `linux-arm64` and `linux-x86_64`. Confirm with `wrapper --version`. ## Sign in ```bash theme={null} wrapper auth login ``` Approve the device code in a browser. Headless boxes can print the URL and code; complete approval from any other device. See [Authentication](/guides/auth). ## Share a session ```bash theme={null} wrapper share ``` Or wrap a specific command: ```bash theme={null} wrapper run -- claude # later, in that session: Ctrl+\ then s wrapper share -- claude ``` Press `Ctrl+\` then `s` if you started with `wrapper run` and want to share later. Unshare with `Ctrl+\` then `u`. `wrapper status` lists live sessions on this machine. Unshared sessions listen on `127.0.0.1` and do not contact Convex. ## Attach from your phone Share the session (Pro), then open the iOS viewer. See [Mobile viewer](/guides/mobile-viewer) and [Pricing](/reference/pricing). You do not need to put SSH keys on the phone. Wrapper shares **this** session only, not the whole machine. ## Optional: systemd user unit A one-shot session (not a daemon wrapping every login): ```ini theme={null} # ~/.config/systemd/user/wrapper-share.service [Unit] Description=Wrapper shared shell [Service] ExecStart=%h/.wrapper/bin/wrapper share Restart=on-failure [Install] WantedBy=default.target ``` Enable with `systemctl --user enable --now wrapper-share.service`. This still starts one shared session, not every interactive shell. ## Optional: wrap every terminal If you want every new shell on the box wrapped: ```bash theme={null} wrapper install --dry-run wrapper install ``` Remove later with `wrapper uninstall`. Skip one shell with `WRAPPER_DISABLE=1`. ## Related * [Installation](/guides/installation) * [Remote share](/guides/remote-share) * [Pricing](/reference/pricing) * [CLI reference](/reference/cli) # Local attach Source: https://docs.wrapper.sh/guides/local-attach Join a live host shell on the same machine over loopback. Local attach connects a second terminal to the host PTY on `127.0.0.1`. Traffic never leaves the machine and never uses the Fly relay. ## Before you attach 1. Install the CLI. 2. Run `wrapper share` or `wrapper run -- ` (does not patch your shell config). 3. Confirm a live session: ```bash theme={null} wrapper status ``` You should see `sessionId`, `pid`, and `port`. ## Attach Default picker / latest session: ```bash theme={null} wrapper attach ``` Target a specific session: ```bash theme={null} wrapper attach --id wrapper attach --port ``` Defaults: | Flag | Default | | - | - | | `--host` / `-H` | `127.0.0.1` | ## How local security works * The host WebSocket listens only on loopback. * Each session generates a random 256-bit token. * The token is stored in the owner's session registry under restrictive file modes and required as `?token=` on every local connection. * `wrapper attach` reads that registry, so only your OS user (or root) can join. Processes running as the same OS account remain inside the local trust boundary. See [Security and privacy](/configuration/security). ## Detach without ending the host In the viewer, press `Ctrl+\` then `d`. The host shell keeps running until the inner shell exits. ## Common failures | Symptom | Likely cause | Fix | | - | - | - | | No sessions listed | No host running | Run `wrapper share` | | Access denied | Missing local token | Use `wrapper attach --id` from `wrapper status` | | Attach connects then dies | Nested / duplicate wrap | `wrapper uninstall` then use `wrapper share` | | Need an unwrapped shell | Optional wrap always on | `WRAPPER_DISABLE=1 zsh` | Debug with: ```bash theme={null} wrapper logs --follow ``` # Mobile viewer Source: https://docs.wrapper.sh/guides/mobile-viewer Connect to a shared Wrapper terminal from iPhone or iPad. Wrapper Mobile is a viewer and controller for sessions hosted by the Wrapper CLI. The shell, files, processes, and credentials remain on the Mac or Linux host. Commands entered on mobile execute on that host. ## Get the app The iOS viewer is a **TestFlight beta**. It is a viewer, not a host: the shell, files, processes, and credentials stay on the Mac or Linux machine. Join with the [TestFlight public link](https://testflight.apple.com/join/EcExtPqx) or from [wrapper.sh](https://www.wrapper.sh/#intro). The public App Store listing is not available yet. The app requires iOS or iPadOS 18 or later and a shared host session. > [!WARNING] > > People you invite see the screen. They cannot type unless the host allows it. Use a dedicated host > for demonstrations and never share a session containing production credentials. ## Requirements * iOS or iPadOS 18 or later * a Wrapper account * the Wrapper CLI installed on a Mac or Linux host * an active wrapped shell * Pro ($99/year or $15/month), to attach from another device See [Installation](/guides/installation), [Authentication](/guides/auth), and [Pricing](/reference/pricing) before continuing. ## Prepare the desktop host Sign in and share a session (does not patch your shell config): ```bash theme={null} wrapper auth login wrapper share wrapper status ``` Press `Ctrl+\` and then `s` to share the current session. Wrapper prints the session ID and share code. Unshare at any time with `Ctrl+\` and then `u`. ## Sign in on mobile 1. Open Wrapper and choose **Continue securely**. 2. Confirm the code on the wait screen, then open the approval page. 3. Sign in if needed, approve the device, and return to Wrapper. 4. Pull to refresh if the session list was already open. Authentication credentials are stored in Keychain on physical devices. The app returns to the signed-out state if the backend reports that authentication has expired. ## Open your own session A shared session owned by the signed-in account appears in the session list. Select it to request a fresh, single-use viewer ticket and open the terminal. Sessions that are offline or not shared cannot be opened. Share them from the host first. ## Join a guest session Choose **Join**, then enter the session ID and share code supplied by the host. Share codes are case-insensitive. The mobile app does not retain the share code for reconnect. If the guest connection closes, return to Join and enter the code again. ## Terminal controls The bottom control bar stays inside the device safe area and provides common terminal keys: * show or hide the software keyboard * Control modifier * Escape * Tab * arrow keys * explicit paste * detach Remote terminal escape sequences cannot read from or write to the device clipboard implicitly. Native text selection and explicit copy remain available. ## P2P and relay status Wrapper keeps an authenticated WebSocket relay for signaling and fallback, then attempts an encrypted WebRTC data channel. | Status | Meaning | | - | - | | `connecting` | Secure ticket, relay, or host setup is in progress | | `p2p` | Terminal traffic prefers the direct WebRTC data channel | | `relay` | Terminal traffic uses the authenticated relay | | `offline` | No usable transport remains | If relay or P2P connectivity drops, owner sessions request fresh one-time tickets with bounded retries. A failed P2P negotiation does not prevent relay fallback. Direct P2P exposes peer IP addresses. Relay fallback is encrypted in transit, but the relay processes terminal frames after TLS termination. See [Security and privacy](/configuration/security) and [Transports](/reference/transports). ## Privacy lock Terminal content is covered when the app is inactive or captured. Returning after a longer background interruption requires Face ID, Touch ID, or the device passcode. Canceling authentication keeps the terminal locked. Locking or backgrounding the app must not crash the process. The relay or P2P link may drop; returning reconnects or asks you to open the session again. If device-owner authentication is unavailable, Wrapper keeps content covered and offers safe sign-out rather than revealing the terminal. ## Account controls Settings includes: * Privacy Policy, Terms, and Support * Sign out * permanent account deletion Account deletion removes Wrapper-owned session metadata and authentication records, and queues billing cleanup. It cannot be undone. ## Troubleshooting If the app remains on **Connecting securely**: 1. Confirm the host still reports the session as shared. 2. Refresh the mobile session list. 3. Check whether the host or mobile network changed. 4. Close the terminal and open it again to request a fresh ticket. 5. For a guest session, re-enter the original share code. For additional diagnostics, see [Troubleshooting](/troubleshooting). # Remote share Source: https://docs.wrapper.sh/guides/remote-share Share a live host shell with an authorized device over relay and optional P2P. Remote share publishes a host session through the authenticated Fly.io relay so another device can attach. Wrapper negotiates a DTLS WebRTC data channel by default and keeps the relay for signaling and fallback. > [!NOTE] > > Remote sharing requires Pro (`can_share_relay`). ## Share from the host 1. Sign in on the host: `wrapper auth login`. 2. Run `wrapper share` (or share from a running host with `Ctrl+\` then `s`). 3. Confirm you have a shared session (`wrapper status`). Unshare and revoke access with `Ctrl+\` then `u`, or by ending the host shell. ## Join as the owner Owners can attach from any signed-in device without the share code: ```bash theme={null} wrapper attach --relay --id ``` ## Join as a guest Guests need the session id and share code: ```bash theme={null} wrapper attach --relay --id ``` Enter the code in the hidden prompt. Codes are case-insensitive. Knowing the session id alone is not enough. > [!WARNING] > > `--code` exists only for non-interactive automation. Command-line arguments can appear in process > listings and shell history. Prefer the hidden prompt. ## What guests can do Watching is the default. * Read all terminal output. * Cannot type unless the host allows it (`Ctrl+\` then `w`, or `wrapper share --writable`). * Resize; the terminal fits the smallest display among the host's own terminal and every connected viewer. A viewer can shrink the shared terminal but never grow it past the host's window, and it grows back when that viewer leaves. The person who owns the session can always type, including from their phone. Treat share codes as capabilities. When the terminal rings (BEL, or `wrapper notify` from inside the wrapped shell), Wrapper can ping the owner's phone. The alert names the session. It does not include what is on screen. Opt out with `WRAPPER_NOTIFY=0`. ## Transport behavior | State | Meaning | | - | - | | `connecting` | Relay or P2P setup in progress | | `relay` | Terminal frames on the authenticated WebSocket | | `p2p` | Viewer input prefers the direct WebRTC channel | | `offline` | Paths closed; attach ends | If ICE cannot form a direct channel, the session stays on relay. If an open P2P channel drops, Wrapper waits briefly for recovery, then falls back to relay. Force relay-only: ```bash theme={null} WRAPPER_P2P=0 wrapper attach --relay --id ``` See [Transports](/reference/transports). ## Access model (summary) * Backend stores only the SHA-256 of the share code. * Relay tickets are random, hashed at rest, short-lived, and single-use. * Unsharing clears the hash and invalidates unused viewer tickets. * Failed guesses are rate limited without revealing whether a session exists. Details: [Security and privacy](/configuration/security). ## Upgrade to Pro Pro is $99 per year ($8.25 / month) or \$15 per month. Yearly is the featured price. Pick the interval on [dashboard billing](https://www.wrapper.sh/dashboard/billing) after sign-in. See [Pricing](/reference/pricing). # Introduction Source: https://docs.wrapper.sh/introduction Keep your real shell on your machine and reach it from an authorized device. Wrapper wraps the interactive shell you already use on macOS or Linux. Your prompt, plugins, history, files, and credentials stay on the host. Attach from another local terminal, or share one session with an authorized device when you choose. ![A macOS terminal running wrapper share, showing the controls hint, a redacted share code, and the join command, next to an iPhone viewing the same session over P2P](https://mintcdn.com/wrapper/JLMnFS4G4wmSxZil/images/wrapper-session-overview.webp?fit=max\&auto=format\&n=JLMnFS4G4wmSxZil\&q=85\&s=62bec6f8705a9ce4c9900e160d923039) ## What you get * Your real shell (`zsh`, `bash`, or `fish`) runs on the host machine. * Local attach joins that live PTY over loopback with a per-session token. * Remote share (Pro) routes through an authenticated Fly.io relay, with a default WebRTC P2P fast path for lower latency. * People you invite watch unless you allow typing. You always type. * Free: attach from the same computer. Pro: attach from another device. ## Prerequisites * macOS or Linux (Windows via WSL) * `zsh`, `bash`, or `fish` * A Wrapper account for backend auth and remote sharing ## Install Homebrew: ```bash theme={null} brew install heycupola/tap/wrapper ``` Checksum-verified installer: ```bash theme={null} curl -fsSL https://wrapper.sh/install | bash ``` Supported installer targets today: `darwin-arm64`, `darwin-x86_64`, `linux-arm64`, and `linux-x86_64`. ## First session **1. Sign in** ```bash theme={null} wrapper auth login ``` Approve the device code in the browser. Local attach does not require login. Remote share does. **2. Share a session** ```bash theme={null} wrapper share ``` Does not patch your shell config. Wrap a command without sharing yet with `wrapper run -- claude`. Optional: `wrapper install` wraps every new terminal. **3. Attach locally** From another terminal on the same machine: ```bash theme={null} wrapper attach ``` **4. Share remotely (Pro)** `wrapper share` already shares. In a running host, press `Ctrl+\` then `s`. Join with: ```bash theme={null} wrapper attach --relay --id ``` Owners skip the share code. Guests enter it in a hidden prompt. > [!NOTE] > > Remote sharing requires Pro. Local attach does not use the relay and does not require Pro. ## Controls and HUD Wrapper prints controls once, then keeps status in the terminal title so full-screen tools like Vim stay intact. | Keys | Host | Viewer | | - | - | - | | `Ctrl+\` `s` | Share | | | `Ctrl+\` `u` | Unshare | | | `Ctrl+\` `w` | Typing | | | `Ctrl+\` `d` | | Detach | | `Ctrl+\` `?` | Status | Status | HUD transport labels: `local`, `connecting`, `relay`, `p2p`, `offline`. ## Next steps * [Quickstart](/guides/installation) * [Authentication](/guides/auth) * [Local attach](/guides/local-attach) * [Remote Linux box](/guides/linux-remote) * [Remote share](/guides/remote-share) * [Pricing](/reference/pricing) * [Security and privacy](/configuration/security) # Architecture Source: https://docs.wrapper.sh/reference/architecture How CLI, Convex, relay, web, and protocol fit together. ## System components | Component | Role | | - | - | | `apps/cli` | Host shell, local attach, auth, relay bridge, WebRTC transport | | `packages/backend` | Convex auth, session lifecycle, tickets, onboarding, billing | | `apps/relay` | Authenticated WebSocket router and WebRTC signaling passthrough | | `apps/web` | Landing, device-login approval, onboarding, Pro checkout (yearly default), install proxy | | `packages/protocol` | Shared JSON message schema and codec (`protocolVersion: 1`) | | `packages/terminal` | Bun-native PTY layer via `wrapper-pty-helper` | | `packages/logger` | Logging and opt-in telemetry | | `apps/mobile` | Native iPhone/iPad viewer; TestFlight public beta | ## High-level flow ```mermaid theme={null} flowchart LR hostCli[HostCLI] -->|session open heartbeat close| backend[ConvexBackend] viewerCli[ViewerCLI] -->|authorize attach and ticket request| backend hostCli -->|ws with host ticket| relay[RelayService] viewerCli -->|ws with viewer ticket| relay relay -->|input resize| hostCli hostCli -->|output session events| relay relay -->|broadcast output and close| viewerCli hostCli -.->|optional DTLS data channel| viewerCli ``` ![Architecture diagram with trust boundaries: your machine runs wrapper shell-host with the PTY and a loopback WebSocket plus registry token for local viewers; Convex handles auth, the share-code gate, session records, and relay tickets; the Fly relay carries signaling and fallback terminal data; remote CLI and iOS viewers connect to the host over an encrypted DTLS P2P data channel by default](https://mintcdn.com/wrapper/JLMnFS4G4wmSxZil/images/wrapper-architecture.webp?fit=max\&auto=format\&n=JLMnFS4G4wmSxZil\&q=85\&s=245854966b7f84dbe51dc086a8ae3e35) ## Session lifecycle 1. `wrapper share` or `wrapper run` starts `wrapper shell-host` (`wrapper install` is optional). 2. Host creates a PTY, binds loopback WebSocket + token, and registers locally. 3. Unshared hosts send nothing to Convex. 4. Local viewers attach with the registry token. No Convex row is required. 5. Share opens a Convex session, issues a hashed share code plus host relay ticket, and starts heartbeats. 6. Viewers request viewer tickets, connect to the relay, and optionally open P2P. 7. Unshare or host exit revokes tickets, closes the Convex row, and closes remote viewers. The backend expires stale sessions that miss heartbeats. ## Relay auth and routing Backend-issued relay tickets are short-lived and single-use. Each session has one host and can have multiple viewers. The relay routes terminal frames and WebRTC signaling only within that session. Host disconnect closes every viewer. Peer ids are assigned by the relay. ## Protocol Wire messages are JSON validated with Zod in `@repo/protocol`. Common types: * `session.opened` / `session.closed` * `input` / `output` / `resize` * `attach` / `detach` * `error` * `signal` (WebRTC SDP and ICE) * `viewer.caps` (whether that viewer may type) The relay stamps `from` on `input` and drops guest typing unless `canInput` is true. The host enforces the same rule on P2P input. Frames have explicit size caps (wire and terminal payload limits) before parse and fan-out. ## Session access * A session that is not shared is owner only. * The owner joins a shared session without a share code. * A non-owner needs the session id, share code, and a valid ticket. * Access failures use a uniform denial shape. * People you invite see output. They cannot type unless the host allows it. See [Security and privacy](/configuration/security), [Transports](/reference/transports), and [Pricing](/reference/pricing). # CLI reference Source: https://docs.wrapper.sh/reference/cli Commands, flags, keybindings, and common workflows. ## Commands ### Install (optional) ```bash theme={null} wrapper install wrapper install --dry-run wrapper install --all wrapper install --shell=zsh,bash wrapper install --interactive wrapper install --yes wrapper uninstall wrapper uninstall --all wrapper init # zsh | bash | fish ``` ### Auth ```bash theme={null} wrapper auth login wrapper auth login --client-id --scope wrapper auth whoami wrapper auth logout ``` ### Sessions ```bash theme={null} wrapper share wrapper share --writable wrapper share -- claude wrapper run -- claude wrapper run --share -- claude wrapper run --share --writable -- claude wrapper status wrapper notify wrapper attach wrapper attach --id wrapper attach --port wrapper attach --host 127.0.0.1 wrapper attach --relay --id # Automation only: wrapper attach --relay --id --code "$WRAPPER_SHARE_CODE" wrapper logs wrapper logs --follow wrapper logs --tail 200 ``` ### Telemetry ```bash theme={null} wrapper telemetry status wrapper telemetry enable wrapper telemetry disable ``` ### Internal / development ```bash theme={null} wrapper shell-host wrapper shell-host --shell /bin/zsh wrapper shell-host --port wrapper shell-host --share bun run --cwd apps/cli dev:host ``` ### Meta ```bash theme={null} wrapper --help wrapper --version ``` ## Keybindings Prefix defaults to `Ctrl+\` (armed for about 1.5 seconds). Override with `WRAPPER_PREFIX` or `prefix` in `~/.config/wrapper/config.json`. See [Environment](/configuration/environment). ### Host | Keys | Action | | - | - | | `Ctrl+\` `s` | Share and print share code | | `Ctrl+\` `u` | Unshare and revoke access | | `Ctrl+\` `?` | Status overlay | | `Ctrl+\` `Ctrl+\` | Send literal control byte | | `Ctrl+\` `Esc` | Cancel prefix mode | ### Viewer | Keys | Action | | - | - | | `Ctrl+\` `d` | Detach viewer | | `Ctrl+\` `?` | Viewer status | ## HUD The terminal title shows role, short session id, and transport: `local` · `connecting` · `relay` · `p2p` · `offline` Disable with `WRAPPER_HUD=off`. Wrapper does not draw a permanent bottom bar because that conflicts with alternate-screen tools. ## Typical flows Local: ```bash theme={null} wrapper auth login wrapper share wrapper status wrapper attach ``` Remote (Pro): ```bash theme={null} wrapper share wrapper attach --relay --id wrapper notify ``` `wrapper notify` rings the wrapped session so your phone can ping you. Run it inside that terminal. Alerts name the session and do not include the screen. Remote share requires Pro. See [Pricing](/reference/pricing). # Pricing Source: https://docs.wrapper.sh/reference/pricing Local is free. Remote is Pro. ## Plans | Plan | Price | Includes | | - | - | - | | Free | \$0 | Wrap a session on demand. Attach from the same computer. Nothing leaves until you share. | | Pro | $99 / year (or $15 / month) | Everything in Free. Attach from another device. Share and revoke. Linux host. iOS viewer. | Yearly is the featured price ($8.25 / month). Monthly is $15 and does not require a yearly commitment. The landing [pricing](https://www.wrapper.sh/#pricing) scene and signed-in [dashboard billing](https://www.wrapper.sh/dashboard/billing) put a Yearly / Monthly switch on the Pro card. Checkout follows that choice and defaults to yearly. Profile shows Free or Pro. Stripe's customer portal is available after the first Pro checkout; free accounts only see upgrade. ## Free * Does not patch your shell config (`wrapper share` or `wrapper run -- `) * Attach from another terminal on the same computer * Unshared sessions stay on your machine (loopback, no Convex, no relay) Local attach does not require Pro or a Wrapper account. ## Pro * Everything in Free * Attach from another device * Share a session from the host (`wrapper share` or `Ctrl+\` then `s`), revoke anytime (`Ctrl+\` then `u`) * Host on a remote Linux box. Your laptop does not have to run Wrapper * iOS viewer for iPhone and iPad Autumn product ids: `pro` (monthly) and `pro_yearly` (yearly). Both grant `can_share_relay`. How a remote session connects is in [Remote share](/guides/remote-share). ## Entitlement id Billing checks the Autumn feature id `can_share_relay`. Operators can override the feature id with `WRAPPER_AUTUMN_RELAY_SHARE_FEATURE_ID` on the Convex deployment. Plan ids default to `pro` and `pro_yearly` (`WRAPPER_AUTUMN_PRO_PLAN_ID`, `WRAPPER_AUTUMN_PRO_YEARLY_PLAN_ID`). ## Related * [Remote share](/guides/remote-share) * [Mobile viewer](/guides/mobile-viewer) * [Security and privacy](/configuration/security) # Transports Source: https://docs.wrapper.sh/reference/transports Relay WebSocket and default WebRTC P2P paths for remote sessions. Remote sessions use two transports behind one `Transport` interface: * **WebRTC data channel**: default direct path for lower latency * **Relay WebSocket**: always connected for shared sessions; carries signaling and becomes the data path when direct connection is unavailable Local `127.0.0.1` attach is already direct and does not use these remote paths. ## Why a direct path WebRTC removes the relay hop for interactive latency. STUN and ICE attempt the peer connection. Failure leaves the working relay path in place. Public STUN servers used today: * `stun.l.google.com:19302` * `global.stun.twilio.com:3478` ## Negotiation flow ```mermaid theme={null} sequenceDiagram participant V as Viewer participant R as RelaySignaling participant H as Host V->>R: signal offer to host R->>H: signal offer from peerId H->>R: signal answer to peerId R->>V: signal answer V-->>H: ICE candidates trickled both ways Note over V,H: data channel opens, viewer input prefers P2P Note over H,R: host keeps relay output for fallback Note over V,H: on ICE failure, stay on relay ``` The viewer creates the offer and the host answers. SDP and ICE travel on the authenticated relay connection, so there is no separate signaling service. ![Two transport paths side by side. Direct P2P: terminal data flows host to viewer over a DTLS data channel while SDP and ICE signaling travel over the authenticated relay WebSocket, and the HUD shows p2p. Relay fallback: terminal data flows host to Fly relay to viewer over TLS on the same socket as signaling, and the HUD shows relay](https://mintcdn.com/wrapper/JLMnFS4G4wmSxZil/images/p2p-versus-relay.webp?fit=max\&auto=format\&n=JLMnFS4G4wmSxZil\&q=85\&s=c535e5a87815e0bbefd48d79ed08cfb8) ## Data path once P2P is up * The host fans output to relay and to each direct viewer. * The viewer prefers the data channel for input and resize. * Once its channel is open, the viewer ignores duplicate relay output frames. * A failed or disconnected data channel resumes through the relay after a short recovery window. * If the signaling WebSocket dies after P2P is up, the data channel can continue until it also fails. * If both paths close, attach ends. ## Security properties * WebRTC data channels are DTLS-encrypted between peers. * Relay fallback is TLS-encrypted in transit but processed after TLS termination. * Signaling requires relay ticket authorization. A session id alone is not enough. * A direct connection exposes each peer's IP to the other, and STUN discloses your public IP to the STUN provider. ## Defaults and opt-out `WRAPPER_P2P` is on by default. Opt out on either end: ```bash theme={null} WRAPPER_P2P=0 wrapper shell-host WRAPPER_P2P=0 wrapper attach --relay --id ``` Production relay default: `wss://wrapper-relay-prod.fly.dev`\ Development default: `ws://localhost:8080` HUD labels: `local`, `connecting`, `relay`, `p2p`, `offline`. See [Troubleshooting](/troubleshooting) when a remote session remains on relay. # Troubleshooting Source: https://docs.wrapper.sh/troubleshooting Fix auth, attach, install, HUD, and relay issues. ## Install or PATH problems Symptoms: `wrapper: command not found`, wrong binary. 1. Confirm install completed and `wrapper --version` works in a new shell. 2. For the curl installer, ensure `$HOME/.wrapper/bin` (or `WRAPPER_INSTALL_DIR`) is on your `PATH`. 3. Re-run the installer or `brew reinstall heycupola/tap/wrapper`. ## `brew upgrade` succeeded but `wrapper --version` is old Homebrew and the curl installer can both be present. The curl copy at `$HOME/.wrapper/bin/wrapper` is prepended to `PATH`, so it shadows Homebrew. 1. Run `which -a wrapper`. The first path is the binary `--version` reports. 2. To stay on curl, re-run `curl -fsSL https://wrapper.sh/install | bash`. 3. To stay on Homebrew, remove `$HOME/.wrapper` and the `PATH` line the installer added to your shell profile, then open a new terminal. ## Homebrew says Xcode is outdated Wrapper's Homebrew formula installs a prebuilt binary. It does not compile Swift or require Xcode. Homebrew itself still refuses to run when the Xcode Command Line Tools on the Mac are older than Homebrew expects. 1. Update Command Line Tools: `xcode-select --install` or Software Update. 2. Or skip Homebrew and use the curl installer above. The curl installer does not go through Homebrew, so it is unaffected. ## Every-terminal wrap not running Symptoms: `wrapper status` is empty after install. 1. Run `wrapper share` (or `wrapper install` once if you want every terminal wrapped). 2. Confirm `wrapper status` shows a live session. 3. Check that `WRAPPER_DISABLE` is unset if you expected the optional install snippet. ## Sign-in fails Run `wrapper auth login` again. If the browser still cannot complete sign-in, contact [support](https://wrapper.sh/support) without including tokens or terminal content. ## `authorization_pending` during `wrapper auth login` Expected while waiting for browser approval. Keep the command running until you approve or deny the request. ## Local attach denied 1. Confirm `wrapper status` shows a live session. 2. Prefer `wrapper attach` / `--id` over guessing ports. 3. Check `wrapper logs --follow`. Local attach uses the loopback token. Convex is not required. Remote share still needs `wrapper auth login` and Pro. ## Relay share says Pro is required Upgrade to Pro ($99/year or $15/month) from [dashboard billing](https://www.wrapper.sh/dashboard/billing). Yearly is the featured price. Attach from the same computer remains available without Pro. See [Pricing](/reference/pricing). ## P2P does not come up The terminal title starts at `relay` and changes to `p2p` when the direct data channel opens. If it stays on `relay`, the session is still working through the authenticated Fly relay. 1. Run `wrapper logs --follow` on host and viewer. 2. Confirm both sides use the same session and current CLI version. 3. Test from two real networks. CI and local sandboxes often cannot reproduce NAT traversal. 4. Set `WRAPPER_P2P=0` to force relay-only mode while diagnosing. If an open P2P channel drops, Wrapper waits briefly for a transient disconnect to recover, then switches input and output back to the relay. Look for `p2p data channel failed; using relay fallback` in the viewer log. ## Session access is denied (relay) Confirm the session id and enter the current share code when prompted. Codes are case-insensitive and expire when the host unshares. Knowing the session id alone is not enough. Owners skip the code; guests do not. ## Controls or HUD missing Wrapper prints controls once and uses the terminal title as its HUD. Press `Ctrl+\` to reveal role-specific controls. If your terminal hides titles, use `Ctrl+\` then `?` for an inline status line. Check that `WRAPPER_HUD` is not `off`. ## Still stuck Gather non-sensitive details only: ```bash theme={null} wrapper --version wrapper auth whoami wrapper status wrapper logs --tail 200 ``` Redact tokens, share codes, paths, and terminal contents before sending anything to [support](https://wrapper.sh/support).