# Vibelet

`@vibelet/cli` is a cross-platform CLI that installs and manages the Vibelet daemon for remote coding sessions. The same package is also published as `vibelet`.

Official website: https://vibelet.icu

## Requirements

- macOS / Linux / Windows
- Node.js 18 or newer

## Install

```bash
npx @vibelet/cli
npx vibelet
```

Or install it globally:

```bash
npm install -g @vibelet/cli
npm install -g vibelet
vibelet
```

The CLI prints the official website on each run so users can always jump back to the main docs and download page.

## Commands

```bash
vibelet              # Install/start daemon, auto-enable remote access, and print pairing QR code
vibelet start        # Same as above
vibelet stop         # Stop the daemon
vibelet restart      # Restart the daemon
vibelet status       # Show service and daemon status
vibelet logs         # Print recent daemon logs
vibelet reset        # Reset pairings and print a fresh QR code
vibelet --help       # Show help
vibelet --version    # Show CLI version
```

## Options

```bash
vibelet --access=local                       # Skip the default Cloudflare Tunnel for this run
vibelet --access=remote --force              # Force a fresh tunnel URL
vibelet --access=https://<your-tunnel-url>   # Use your own tunnel URL
vibelet --access=<tailscale-or-lan-host>     # Use a direct private-network host
vibelet --access=<host>,<fallback1>          # Add fallback private-network hosts
vibelet --access=                            # Clear saved relay URL
```

Remote access is enabled by default for `vibelet`, `vibelet start`, `vibelet restart`, and `vibelet reset`. Use `--access=local` when you want a LAN-only QR code for that run. Legacy aliases still work: `--local`, `--relay`, `--host`, `--fallback-hosts`, `--remote`, and `--tunnel`.

## Release

```bash
pnpm publish:dual:dry-run
pnpm publish:dual
```

The dual publish script builds once, then publishes the same CLI bundle to both `@vibelet/cli` and `vibelet`. The dry-run path stages both packages and validates them with `npm pack --dry-run` without touching the registry.

## Notes

- The npm package publishes the CLI plus a minified daemon runtime bundle.
- The package is intended for end users of the Vibelet host daemon, not for importing as a library.
- The daemon keeps `~/.vibelet/data/audit.jsonl` and `~/.vibelet/logs/daemon.*.log` size-bounded by trimming the oldest content in place.
- Environment variables:
  | Variable | Default | Description |
  |----------|---------|-------------|
  | `VIBE_PORT` | `9876` | Daemon listen port |
  | `VIBE_IDLE_TIMEOUT_MS` | `1800000` (30 min) | Idle timeout before a driver is released (0 = disabled) |
  | `VIBE_TURN_STALL_TIMEOUT_MS` | `300000` (5 min) | Soft inactivity threshold for suspecting an in-flight turn has stalled (0 = disabled) |
  | `VIBE_TURN_STALL_HARD_TIMEOUT_MS` | `900000` (15 min) | Hard inactivity threshold for force-stopping a stalled turn after warning (0 = warn only) |
  | `VIBE_AUDIT_MAX_BYTES` | `8388608` (8 MB) | Max audit.jsonl size before trimming |
  | `VIBE_DAEMON_LOG_MAX_BYTES` | `16777216` (16 MB) | Max daemon log file size before trimming |
  | `VIBE_STORAGE_HOUSEKEEPING_INTERVAL_MS` | `300000` (5 min) | Log trimming check interval |
  | `CLAUDE_PATH` | auto-detect | Path to Claude binary |
  | `CODEX_PATH` | auto-detect | Path to Codex binary |
