replit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseReplit toolkit — one skill, four lanes
Replit 工具包——一个 skill,四条路径
Everything here is specific to running on a Replit/Nix workspace. The
platform breaks normal Linux assumptions ($HOME wiped, /nix/store GC, npm
firewall), and each lane below is a verified playbook for one job.
Read first if you are new to the box — every
other lane assumes its persistence rules.
references/platform.md| You want to… | Read | Scripts |
|---|---|---|
| persist data/env/rc/git, understand what survives a restart, fix env-var plumbing | | |
get a system lib that isn't installed (GTK, libatomic, any .so), debug | | |
| drive Playwright without downloading a browser (the box ships Chromium) | | |
open bot-hardened sites (Cloudflare/Turnstile/WAF), keep logged-in Firefox sessions alive, agent browsing on Hermes (camofox MCP — | | |
Hermes-on-Replit recovery specifically (uv trailing-slash failures,
official Node ≥22 tarballs needing libatomic): .
--lockedreferences/hermes-on-replit.md以下内容均专用于在 Replit/Nix 工作区上运行。该平台会打破常规 Linux 假设($HOME 会被清空、/nix/store 会被 GC、npm 存在包防火墙),而下面的每条路径都是针对单一任务验证过的操作手册。
如果刚接触该环境,请先阅读 ——其他所有路径都以此处的持久化规则为前提。
references/platform.md| 你想要…… | 阅读 | 脚本 |
|---|---|---|
| 持久化数据、环境变量、rc 和 git,了解重启后哪些内容仍会保留,修复环境变量传递 | | |
获取尚未安装的系统库(GTK、libatomic、任意 .so),调试 | | |
| 无需下载浏览器即可驱动 Playwright(环境中已附带 Chromium) | | |
访问针对机器人强化防护的站点(Cloudflare/Turnstile/WAF),保持已登录的 Firefox 会话,并在 Hermes 上进行 Agent 浏览(camofox MCP——此处的 | | |
Hermes 在 Replit 上的专项恢复方案(uv 尾随斜杠错误、官方 Node ≥22 tarball 需要 libatomic):。
--lockedreferences/hermes-on-replit.mdThe platform in five facts (detail in platform.md)
平台的五个关键事实(详见 platform.md)
- (
$HOME) is wiped on recreate;/home/runner($REPL_HOME) is persistent. Anything you want to survive lives under the workspace. The XDG vars are pre-set into the workspace, but do not trust that implicitly — check with/home/runner/workspace.printenv | grep XDG_ - Everything system-level comes from , and store paths get GC'd. A path that worked yesterday may not exist today; long-lived things need a durable copy outside the store (see nix.md, hermes-on-replit.md).
/nix/store - is never enough for GUI browsers — you need the full transitive closure (nix.md §3;
$REPLIT_LD_LIBRARY_PATH).generate-closure.sh - npm is behind a package firewall; pin .
--registry=https://registry.npmjs.org/ - Replit ships a Playwright-managed Chromium — ; never
$REPLIT_PLAYWRIGHT_CHROMIUM_EXECUTABLE.playwright install
- (
$HOME)会在重新创建时被清空;/home/runner($REPL_HOME)则会持久保留。 所有需要保留的内容都应放在 workspace 中。XDG 环境变量已预设到 workspace 中,但不要想当然地依赖这一行为——请通过/home/runner/workspace检查。printenv | grep XDG_ - 所有系统级内容均来自 ,且 store 路径会被 GC。 昨天可用的路径今天可能已不存在;需要长期保留的组件必须在 store 之外保存一份持久副本(参见 nix.md、hermes-on-replit.md)。
/nix/store - 对于 GUI 浏览器,仅设置 远远不够——还需要完整的传递闭包(nix.md §3;
$REPLIT_LD_LIBRARY_PATH)。generate-closure.sh - npm 位于包防火墙之后;请固定使用 。
--registry=https://registry.npmjs.org/ - Replit 自带由 Playwright 管理的 Chromium——路径为 ;切勿执行
$REPLIT_PLAYWRIGHT_CHROMIUM_EXECUTABLE。playwright install
Scripts (flat, all in scripts/
)
scripts/脚本(全部位于 scripts/
)
scripts/- — idempotent toolchain/env provisioning (node/uv/python pins, LD paths, rc chain); run it after any recreate.
setup.shverifies installs + wiring read-only (exit 2 = wiring gaps);--doctorrewrites ALL wiring (rc block, userenv, shim, ~/.profile, hermes shell_init_files, libatomic) with zero downloads/reinstalls — safe after a $HOME wipe or a partial recreate.--fix= report then repair. Re-running--doctor --fixis a byte-identical fixed point. Pitfall encoded in the script:--fixnever execs the--fixlauncher — any subcommand can boot the full source-update cycle (venv sync, npm build, GB-scale runtime clone). config.yaml is edited textually + verified instead.hermes - — structural
replit_userenv.pyedits (tomlkit, no regex)..replit [userenv] - — one-command provision + launch of the Camoufox server.
start-camofox.sh - — the scraping CLI (open/nav/eval/screenshot, cookie import, keep-alive loop). See camofox.md for its env-file contract.
camofox.py - /
generate-closure.sh— transitive lib closure (per-process) + pool healing (additive-only).libpool.sh - — one-shot MCP health probe (waits for REST, runs a real stdio handshake, asserts the 11
camofox_mcp_check.shtools; exit 0 = live). Used by thecamofox_*"camofox mcp" workflow — the adapter itself is stdio-only, running it standalone just idles forever..replit - — idempotent CDP launcher for the bundled Chromium.
ensure_browser.sh - /
monitor.sh— opt-in :5000 screenshot relay.browser_monitor.py
- — 幂等的工具链/环境预配置脚本(固定 node/uv/python 版本、LD 路径、rc 链);每次重新创建后都应运行。
setup.sh以只读方式验证安装与配置(退出码 2 = 配置存在缺口);--doctor在不下载任何内容、不重新安装任何组件的情况下重写全部配置(rc 块、userenv、shim、--fix、hermes shell_init_files、libatomic)——在 $HOME 被清空或工作区仅完成部分重新创建后仍可安全使用。~/.profile= 先报告再修复。重复运行--doctor --fix会得到字节完全一致的固定结果。 脚本中已编码这一注意事项:--fix绝不会执行--fix启动器——其任意子命令都可能启动完整的源码更新流程(venv 同步、npm 构建、GB 级运行时克隆)。因此改为以文本方式编辑 config.yaml 并进行验证。hermes - — 以结构化方式编辑
replit_userenv.py(使用 tomlkit,不使用正则表达式)。.replit [userenv] - — 通过一条命令完成 Camoufox 服务的配置与启动。
start-camofox.sh - — 抓取 CLI(open/nav/eval/screenshot、Cookie 导入、会话保活循环)。有关其环境文件约定,请参阅 camofox.md。
camofox.py - /
generate-closure.sh— 传递式库闭包(按进程)+ 库池修复(仅执行增量添加)。libpool.sh - — 一次性 MCP 健康探测(等待 REST、执行真实的 stdio 握手、断言 11 个
camofox_mcp_check.sh工具;退出码 0 = 服务在线)。供camofox_*的 "camofox mcp" 工作流使用——适配器本身仅支持 stdio,单独运行它只会一直空转。.replit - — 用于内置 Chromium 的幂等 CDP 启动器。
ensure_browser.sh - /
monitor.sh— 可选启用的 :5000 截图中继服务。browser_monitor.py
camofox.env.example
camofox.env.example
Every Camoufox-server tunable with its default; copy to
(see camofox.md).
$CAMOFOX_ROOT/.env其中列出了 Camoufox 服务端的所有可调项及其默认值;请将其复制到 (参见 camofox.md)。
$CAMOFOX_ROOT/.envInstalling this skill pack
安装此 skill 包
One skill, one command:
bash
npx -y skills add skynight137/skills -s replit一个 skill,一条命令:
bash
npx -y skills add skynight137/skills -s replit