[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1638":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":28,"discoverSource":29},1638,"coderaft","pithings\u002Fcoderaft","pithings","🛶 Run VS Code on any machine anywhere and access it in the browser (25MB npm pkg)","",null,"JavaScript",199,7,184,2,0,1,10,15,3,2.71,false,"main",[],"2026-06-12 02:00:30","# 🛶 coderaft\n\n[![npm version](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fcoderaft?color=blue)](https:\u002F\u002Fnpmx.dev\u002Fpackage\u002Fcoderaft)\n[![install size](https:\u002F\u002Fpackagephobia.com\u002Fbadge?p=coderaft)](https:\u002F\u002Fpackagephobia.com\u002Fresult?p=coderaft)\n\nRun VS Code on any machine anywhere and access it in the browser.\n\nA redistribution of [coder\u002Fcode-server](https:\u002F\u002Fgithub.com\u002Fcoder\u002Fcode-server) bundled into a single zero-dependency package (**~25 MB**). Native modules are shimmed with better alternatives ([zigpty](https:\u002F\u002Fgithub.com\u002Fpithings\u002Fzigpty), [ripgrep-node](https:\u002F\u002Fgithub.com\u002Fpithings\u002Fripgrep-node), [...more](.\u002Fshims\u002FREADME.md)).\n\n- **Installs in under a second** — no build tools, post-install scripts, or C\u002FC++ toolchain needed\n- **Fully portable** across platforms and architectures, unlike `code-server` (platform-specific binaries) and `openvscode-server` (Linux only)\n- **Works everywhere** Node.js runs, including minimal images like `node:slim` and `node:alpine`\n\n\u003Cdetails>\n\u003Csummary>Detailed comparison\u003C\u002Fsummary>\n\nCompared to [`code-server`](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fcode-server) and [`openvscode-server`](https:\u002F\u002Fgithub.com\u002Fgitpod-io\u002Fopenvscode-server):\n\n|                             | **coderaft** | **code-server**                           | **openvscode-server**            | **VS Code (DMG)**                |\n| --------------------------- | ------------ | ----------------------------------------- | -------------------------------- | -------------------------------- |\n| Distribution                | **npm**      | npm                                       | GitHub tarball (not on npm)      | Platform installer (DMG\u002FEXE\u002Fdeb) |\n| Network download            | **31 MB**    | 273 MB                                    | ~73 MB                           | 155 MB                           |\n| Install size on disk\\*      | **32 MB**    | 776 MB                                    | 224 MB                           | 529 MB                           |\n| Install time                | **~0.5s**    | ~15s                                      | ~1.2s                            | N\u002FA                              |\n| Dependencies                | **0**        | 462                                       | Bundled                          | Bundled                          |\n| Build tools required        | **No**       | Yes (`node-gyp`, `gcc`, `make`, `python`) | No (pre-built)                   | No (pre-built)                   |\n| Post-install scripts        | **None**     | Yes (`--unsafe-perm` required as root)    | N\u002FA                              | N\u002FA                              |\n| Works on `node:slim` images | **Yes**      | No                                        | N\u002FA (bundles own Node.js)        | N\u002FA (desktop app)                |\n| Fully portable              | **Yes**      | No (platform-specific compiled binaries)  | No (Linux only, x64\u002Farm64\u002Farmhf) | No (platform-specific)           |\n\n> Measured with `npm i` inside a fresh `node:22` Docker container.\n>\n> \\*Before temporary decompression on first server start (~200 MB decompressed in a temp directory \u003C 2s).\n\n\u003C\u002Fdetails>\n\n## CLI\n\nStart an instance:\n\n```sh\nnpx coderaft -o .\n```\n\n### Docker\n\n```sh\ndocker run -it --rm -p 6063:6063 -v coderaft:\u002Fdata ghcr.io\u002Fpithings\u002Fcoderaft\n```\n\nBased on Alpine with Node.js LTS, bash, corepack (npm\u002Fpnpm\u002Fyarn) (~65 MB download, ~89 MB final). Data persists in `\u002Fdata` volume (`\u002Fdata\u002Fworkspace` for project files, `\u002Fdata\u002Fhome` symlinked to `\u002Froot` for configs).\n\n## Programmatic\n\n```ts\nimport { startCodeServer } from \"coderaft\";\n\nconst instance = await startCodeServer({\n  port: 6063,\n  host: \"127.0.0.1\",\n  defaultFolder: \"\u002Fpath\u002Fto\u002Fworkspace\",\n  \u002F\u002F connectionToken: \"my-secret\", \u002F\u002F disabled for localhost, auto-generated otherwise\n});\n\nconsole.log(`Ready at ${instance.url}`);\n\n\u002F\u002F Later:\nawait instance.close();\n```\n\n### Middleware\n\nUse `createCodeServer` to get a request handler without starting a listener. This lets you integrate code-server into any existing Node.js HTTP server or framework:\n\n```ts\nimport { createServer } from \"node:http\";\nimport { createCodeServer } from \"coderaft\";\n\nconst handler = await createCodeServer({\n  defaultFolder: \"\u002Fpath\u002Fto\u002Fworkspace\",\n});\n\nconst server = createServer((req, res) => {\n  handler.handleRequest(req, res);\n});\n\nserver.on(\"upgrade\", (req, socket) => {\n  handler.handleUpgrade(req, socket);\n});\n\nserver.listen(3000);\n```\n\n### `createCodeServer(options)`\n\nCreates a code-server handler without binding to a port.\n\n| Option            | Type                  | Description                                                                  |\n| ----------------- | --------------------- | ---------------------------------------------------------------------------- |\n| `defaultFolder`   | `string`              | Workspace folder opened when no input is given in the URL.                   |\n| `connectionToken` | `string`              | Shared auth secret. Disabled for localhost, auto-generated for remote hosts. |\n| `host`            | `string`              | Host\u002Finterface to bind. Used to infer whether to require a token.            |\n| `baseURL`         | `string`              | Base URL the server is mounted under (e.g. `\u002Fcode`). Defaults to `\u002F`.        |\n| `proxyURI`        | `string`              | Proxy URI template for forwarded ports (see [Port Proxy](#port-proxy)).      |\n| `vscode`          | `VSCodeServerOptions` | Extra options forwarded to VS Code's internal `createServer()`.              |\n\nReturns a `CodeServerHandler`:\n\n```ts\ninterface CodeServerHandler {\n  handleRequest(req: IncomingMessage, res: ServerResponse): void;\n  handleUpgrade(req: IncomingMessage, socket: Duplex): void;\n  connectionToken: string;\n  dispose(): Promise\u003Cvoid>;\n}\n```\n\n### `startCodeServer(options)`\n\nConvenience wrapper around `createCodeServer` that creates an HTTP server and starts listening.\n\nAccepts all `createCodeServer` options plus:\n\n| Option | Type     | Description                                           |\n| ------ | -------- | ----------------------------------------------------- |\n| `port` | `number` | TCP port to listen on. Defaults to `$PORT` or `6063`. |\n\nReturns a `CodeServerHandle`:\n\n```ts\ninterface CodeServerHandle {\n  server: http.Server;\n  port: number;\n  url: string;\n  connectionToken: string;\n  close(): Promise\u003Cvoid>;\n}\n```\n\n### `spawnCodeServer(options)`\n\nRuns the code-server in a forked Node.js child process — useful for isolating VS Code's singletons from the host or restarting the server without taking the host down. Accepts the same options as `startCodeServer`, plus a `spawn` sub-object (`env`, `execArgv`, `stdio`, `startupTimeout`).\n\n```ts\nimport { spawnCodeServer } from \"coderaft\";\n\nconst instance = await spawnCodeServer({\n  port: 6063,\n  defaultFolder: \"\u002Fpath\u002Fto\u002Fworkspace\",\n});\n\nconsole.log(`Ready at ${instance.url}`);\n\n\u002F\u002F Notify on unexpected worker exits (not fired during close\u002Freload):\ninstance.on(\"exit\", (code, signal) => {\n  console.warn(`worker died code=${code} signal=${signal}`);\n});\n\n\u002F\u002F Restart the worker in place (reads fresh url\u002Fport\u002FconnectionToken after):\nawait instance.reload();\n\n\u002F\u002F Graceful shutdown — SIGTERM to the worker, then SIGKILL after 5s:\nawait instance.close();\n```\n\nOptions cross an IPC boundary, so nested values (`vscode`, etc.) must be JSON-compatible.\n\n## CLI Options\n\n### Server\n\n| Option                        | Description                                         |\n| ----------------------------- | --------------------------------------------------- |\n| `-p, --port \u003Cport>`           | Port to listen on (default: `$PORT` or `6063`)                          |\n| `-H, --host \u003Chost>`           | Host\u002Finterface to bind                                                  |\n| `--base-url \u003Cpath>`           | Base URL the server is mounted under (default: `\u002F`)                     |\n| `--proxy-uri \u003Ctemplate>`      | Proxy URI template for forwarded ports (see [Port Proxy](#port-proxy)) |\n| `--socket-path \u003Cpath>`        | Path to a socket file to listen on                                      |\n| `--print-startup-performance` | Print startup timing to stdout                                          |\n\n### Auth\n\n> [!NOTE]\n> When binding to `localhost` \u002F `127.0.0.1` (or no `--host`), the connection token is **disabled by default** for convenience. When binding to any other host, a token is auto-generated unless `--without-connection-token` is explicitly passed. You can always override by providing `--token` or `--connection-token`.\n\n| Option                           | Description                                           |\n| -------------------------------- | ----------------------------------------------------- |\n| `-t, --token \u003Ctoken>`            | Connection token for auth (shorthand)                 |\n| `--connection-token \u003Ctoken>`     | Connection token for auth (auto-generated if omitted) |\n| `--connection-token-file \u003Cpath>` | Path to file containing the connection token          |\n| `--without-connection-token`     | Disable connection token auth                         |\n| `--auth \u003Ctype>`                  | Auth type                                             |\n| `--github-auth \u003Ctoken>`          | GitHub auth token                                     |\n\n### Defaults\n\n| Option                       | Description                      |\n| ---------------------------- | -------------------------------- |\n| `--default-folder \u003Cpath>`    | Default workspace folder         |\n| `--default-workspace \u003Cpath>` | Default workspace file           |\n| `--locale \u003Clocale>`          | The locale to use (e.g. `en-US`) |\n\n### Data Directories\n\n| Option                             | Description                   |\n| ---------------------------------- | ----------------------------- |\n| `--server-data-dir \u003Cpath>`         | Server data directory         |\n| `--user-data-dir \u003Cpath>`           | User data directory           |\n| `--extensions-dir \u003Cpath>`          | Extensions directory          |\n| `--extensions-download-dir \u003Cpath>` | Extensions download directory |\n| `--builtin-extensions-dir \u003Cpath>`  | Built-in extensions directory |\n| `--agent-plugins-dir \u003Cpath>`       | Agent plugins directory       |\n\n### Logging\n\n| Option               | Description                                                              |\n| -------------------- | ------------------------------------------------------------------------ |\n| `--log \u003Clevel>`      | Log level (`off`, `critical`, `error`, `warn`, `info`, `debug`, `trace`) |\n| `--logs-path \u003Cpath>` | Logs output directory                                                    |\n\n### Network\n\n| Option                            | Description                   |\n| --------------------------------- | ----------------------------- |\n| `--disable-websocket-compression` | Disable WebSocket compression |\n| `--use-host-proxy`                | Enable host proxy             |\n\n### Files\n\n| Option                        | Description                   |\n| ----------------------------- | ----------------------------- |\n| `--disable-file-downloads`    | Disable file downloads        |\n| `--disable-file-uploads`      | Disable file uploads          |\n| `--file-watcher-polling \u003Cms>` | File watcher polling interval |\n\n### Telemetry\n\n| Option                      | Description                                      |\n| --------------------------- | ------------------------------------------------ |\n| `--telemetry-level \u003Clevel>` | Telemetry level (`off`, `crash`, `error`, `all`) |\n| `--disable-telemetry`       | Disable telemetry                                |\n| `--disable-update-check`    | Disable update check                             |\n| `--disable-experiments`     | Disable experiments                              |\n\n### Features\n\n| Option                               | Description                                       |\n| ------------------------------------ | ------------------------------------------------- |\n| `--enable-sync`                      | Enable settings sync                              |\n| `--enable-proposed-api \u003Cext-id>`     | Enable proposed API for an extension (repeatable) |\n| `--disable-workspace-trust`          | Disable workspace trust                           |\n| `--disable-getting-started-override` | Disable getting started override                  |\n\n### Remote\n\n| Option                                 | Description                                           |\n| -------------------------------------- | ----------------------------------------------------- |\n| `--enable-remote-auto-shutdown`        | Enable remote auto shutdown                           |\n| `--remote-auto-shutdown-without-delay` | Auto shutdown without delay                           |\n| `--without-browser-env-var`            | Disable browser env var                               |\n| `--reconnection-grace-time \u003Csec>`      | Reconnection grace time in seconds (default: `10800`) |\n\n### Agent Host\n\n| Option                     | Description                      |\n| -------------------------- | -------------------------------- |\n| `--agent-host-path \u003Cpath>` | Agent host WebSocket socket path |\n| `--agent-host-port \u003Cport>` | Agent host WebSocket port        |\n\n### Shell\n\n| Option                     | Description                             |\n| -------------------------- | --------------------------------------- |\n| `--force-disable-user-env` | Force disable user shell env resolution |\n| `--force-user-env`         | Force user shell env resolution         |\n\n### Other\n\n| Option       | Description                                            |\n| ------------ | ------------------------------------------------------ |\n| `--no-fork`  | Run server in the main process (no subprocess)         |\n| `--no-tui`   | Disable interactive terminal UI (alt screen with logs) |\n| `-o, --open` | Open in browser on startup                             |\n\n### Debugging\n\n| Option                             | Description                         |\n| ---------------------------------- | ----------------------------------- |\n| `--inspect-ptyhost \u003Cport>`         | Inspect pty host                    |\n| `--inspect-brk-ptyhost \u003Cport>`     | Inspect pty host (break on start)   |\n| `--inspect-agenthost \u003Cport>`       | Inspect agent host                  |\n| `--inspect-brk-agenthost \u003Cport>`   | Inspect agent host (break on start) |\n| `--enable-smoke-test-driver`       | Enable smoke test driver            |\n| `--crash-reporter-directory \u003Cdir>` | Crash reporter directory            |\n| `--crash-reporter-id \u003Cid>`         | Crash reporter ID                   |\n\n## Port Proxy\n\nWhen a VS Code extension or the terminal opens a local URL (e.g. `http:\u002F\u002Flocalhost:3000`), coderaft proxies it through the browser. By default, ports are proxied via a path-based scheme:\n\n```\nhttps:\u002F\u002Fexample.com\u002Fproxy\u002F3000\u002F\n```\n\nWhen using `--base-url`, the base path is automatically prepended:\n\n```sh\ncoderaft --base-url \u002Fcode\n# → https:\u002F\u002Fexample.com\u002Fcode\u002Fproxy\u002F3000\u002F\n```\n\nFor subdomain-based proxying, use `--proxy-uri` with a `{{port}}` placeholder:\n\n```sh\ncoderaft --proxy-uri \"https:\u002F\u002F{{port}}.proxy.example.com\u002F\"\n# → https:\u002F\u002F3000.proxy.example.com\u002F\n```\n\nSubdomain proxying requires external infrastructure (wildcard DNS + reverse proxy) — coderaft's built-in proxy handler only supports path-based routing.\n\nThe `VSCODE_PROXY_URI` environment variable can also be used and takes the same template format.\n\n## Sponsors\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fsponsors.pi0.io\u002F\">\n    \u003Cimg src=\"https:\u002F\u002Fsponsors.pi0.io\u002Fsponsors.svg?xyz\">\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\n## License\n\nMIT, with bundled third-party packages. See [lib\u002FLICENSE.md](.\u002Flib\u002FLICENSE.md).\n","coderaft 项目允许用户在任何机器上运行 VS Code 并通过浏览器访问。该项目基于 coder\u002Fcode-server 进行了重新打包，形成了一个大小约为 25MB 的零依赖 npm 包，使用 zigpty 和 ripgrep-node 等替代方案对原生模块进行了优化。它具有秒级安装、无需构建工具或 C\u002FC++ 工具链的特点，并且完全可移植，能够在 Node.js 支持的所有平台上运行，包括像 node:slim 和 node:alpine 这样的最小化镜像。适合需要轻量级开发环境部署、跨平台开发支持以及快速启动编码环境的场景。","2026-06-11 02:45:10","CREATED_QUERY"]