# Operating an archive Recipes for running an archive from a shell or an agent. Every command named here is in [COMMANDS.md](COMMANDS.md), generated from the commands' own help. ## The three surfaces | surface | what it is | needs | |---|---|---| | `pnpm ops ` | the running editor's actions over HTTP (`/api/ops/*`): the same code a click runs, as jobs on the editor's queues | a running editor; `ARCHILYZER_EDITOR_URL` (default `http://localhost:3001`) and `WORKER_TOKEN` (the editor's own, from `editor/.env`) | | `pnpm archilyzer ` | the core's CLI: index, compose, publish stages, reports, offline refreshes, doctor | the checkout and its `transcripts/`; in the container, `docker compose exec editor pnpm archilyzer …` | | the MCP server | reads a published archive (search, transcripts, reports); `fetch_clip` asks the editor for clip media | registered as `archilyzer` ([AGENTS.md](AGENTS.md), [mcp/README.md](mcp/README.md)) | - A job-starting `pnpm ops` action answers with a `jobId` once the job is queued. `--wait` follows its log to the end and exits with its status; a platform queue may hold a job for hours. - What is there: `pnpm ops get channels`, `pnpm ops get channel --counts`, `pnpm ops get publish`, `pnpm archilyzer doctor`. - Every fetch goes through the editor (paced per platform, cookie-aware, provenanced). Never run yt-dlp, whisper or parakeet by hand, and never edit `transcripts/**` by hand: each file has one writer, named below. ## Add a channel ```sh pnpm ops create-channel --json '{"fields":{"name":"Example","handling":"youtube","url":"https://www.youtube.com/@example"}}' pnpm ops channel-config --json '{"slug":"example","patch":{"downloadFilterExclude":"#shorts"}}' pnpm ops channel-config --json '{"slug":"example","sites":[{"siteId":"jeralyzer"}]}' pnpm ops get channel example ``` - `handling`: `"youtube"` fetches the platform's captions; `"transcribe"` downloads audio and transcribes it here. `fields` takes the New channel form's field names, the same as `channel-config`'s `patch` ([RUNNING_IN_DOCKER.md](RUNNING_IN_DOCKER.md), "Driving the editor without a browser"). Every `config.json` key: [CHANNEL.md](CHANNEL.md). - `sites` is the whole membership set; absent or `[]` keeps the channel on no site. - `"fetchPlaylist": true` on `create-channel` stores the playlist at once (the form's "Fetch playlist now"); a social channel's is `"fetchPostsNow": true`. - Rename or delete: `pnpm ops rename-channel --json '{"slug":"old","newSlug":"new"}'`, `pnpm ops delete-channel --json '{"slug":"x","confirm":"x"}'` — both refused while the channel is busy. ## Sync and download ```sh pnpm ops sync --json '{"slug":"example"}' --wait pnpm ops metadata-scan --json '{"slug":"example"}' --wait pnpm ops download-missing --json '{"slug":"example"}' --wait pnpm ops retry-bucket --json '{"slug":"example","bucket":""}' --wait pnpm ops refresh-metadata --json '{"slug":"example","id":""}' --wait pnpm ops persist-videos --json '{"items":[{"slug":"example","id":""}],"dryRun":true}' ``` - The lanes do this unattended: `pnpm ops lane --json '{"lane":"download","enabled":true,"action":"start"}'`; `"held": true` pauses dispatch and keeps the runner's place. Lanes: `transcription`, `download`, `digest`, `backfill`. - A channel's priority: `pnpm ops channel-priority --json '{"slugs":["example"],"tier":"low"}'` (`"operation"` pins one operation's tier). - Bucket names and sizes: `pnpm ops get channel example`. - Keep videos out of cleanup by title or description: `pnpm ops keep-videos --json '{"slug":"example","match":"interview","dryRun":true}'`. ## Import from archive.org, Odysee, BitChute and the Wayback Machine ```sh pnpm ops import-archive-org --json '{"slug":"example-archive","item":"","match":"\\.mp4$","dryRun":true}' --wait pnpm ops import-archive-org --json '{"slug":"example-archive","item":"","match":"\\.mp4$"}' --wait pnpm ops import-archive-org --json '{"slug":"example-archive","items":["",""],"dryRun":true}' --wait pnpm ops import-archive-org --json '{"slug":"example-archive","query":"collection:","limit":50,"dryRun":true}' --wait pnpm ops get remote-listing example-odysee pnpm ops import-video --json '{"slug":"example","url":"https://www.bitchute.com/video//"}' --wait pnpm ops import-video --json '{"slug":"example","url":"https://odysee.com/@example:0/