# LaunchPod

Local run pod for [LaunchSecure](https://launchsecure.dev) pipelines. Starts a local server with a browser UI to manage pipeline runs, workspaces, and an integrated Claude Code terminal.

## Quick Start

```bash
npx launchpod
```

This starts the LaunchPod server and opens the UI in your browser.

## Options

```
--port <number>   Server port (default: 52718, or set PORT env var)
--token <string>  Auth token (or log in via the UI)
```

## Configuration

LaunchPod looks for optional config in the current directory:

- `launchpod.config.json` — port and project settings
- `.env.local` — environment variables (e.g. `LAUNCHSECURE_URL`)

Credentials are stored in `.launchpod/` within your project directory.

## Requirements

- Node.js >= 18
- Git (for workspace features)
- [Claude CLI](https://docs.anthropic.com/en/docs/claude-code) (optional — enables the integrated terminal)

## launch-recall — file-watcher backup

`launch-recall` watches your working tree and commits every change to a separate, gitignored shadow repo (`.recall/repo.git`). It bypasses your project's `.gitignore` so files like `.env` are captured. Recovery uses standard git commands.

```bash
npx launch-recall init                          # create .recall/repo.git + gitignore entry + default config
npx launch-recall watch                         # foreground watcher (defaults from .launch-recall.json)
npx launch-recall watch --debounce 1500         # CLI override
npx launch-recall log                           # show snapshots
npx launch-recall restore .env                  # restore .env from latest snapshot
npx launch-recall restore .env --at <commit>    # restore from a specific snapshot
npx launch-recall forget                        # prune history per retention config
npx launch-recall forget --dry-run              # show what would be dropped
npx launch-recall forget --keep-last 1000       # CLI override
npx launch-recall forget --max-age 14d          # CLI override
npx launch-recall stop                          # terminate the running watcher
npx launch-recall push <remote-url-or-path>     # mirror to an external bare repo
npx launch-recall gc                            # pack and prune
npx launch-recall uninstall                     # full cleanup (prompts unless --force)
npx launch-recall uninstall --keep-history      # remove config + gitignore line, keep snapshots
npx launch-recall uninstall --force             # skip confirmation
```

The shadow repo lives at `<project>/.recall/repo.git`. `launch-recall init` adds `/.recall/` to your `.gitignore` so it never enters your main repo, and writes a default `.launch-recall.json` config at the project root. Run `launch-recall watch` in a terminal tab (or wire it into a launchd / systemd / Task Scheduler entry) and every change to your tree is captured within `debounce` milliseconds.

### Config (`.launch-recall.json`)

```json
{
  "debounce": 3000,
  "ignore": [
    "node_modules", ".next", "dist", "build",
    ".turbo", ".git", ".recall", "coverage"
  ],
  "retention": {
    "keepLast": 5000,
    "maxAgeDays": 30
  }
}
```

- `debounce` — ms to wait after the last filesystem event before committing a snapshot
- `ignore` — directory/path segments to keep out of snapshots (also used to skip events from the watcher)
- `retention.keepLast` — keep at most N most-recent snapshots (set to `null` to disable)
- `retention.maxAgeDays` — drop snapshots older than N days (set to `null` to disable)

`launch-recall forget` reads this config. If both retention rules are set, a snapshot is kept only if it satisfies both (i.e., it's within the last N **and** newer than max age). CLI flags override file values.

Same-disk caveat: the shadow lives inside the project folder by design, so `rm -rf <project>` removes it too. For durability, pair with `launch-recall push <path-to-external-bare-repo>` on a daily cron.

## License

MIT
