Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,22 @@ Pick by your client:

## Install

Linux / macOS — one-time setup with a user-level npm prefix (no `sudo`, and `bili`'s
self-update never hits permission errors):

```bash
npm config set prefix "$HOME/.local"
export PATH="$HOME/.local/bin:$PATH" # add this line to ~/.bashrc or ~/.zshrc too
npm install -g billion-context
```

This installs the `bili` command (`bili-proxy` is kept as an alias).
On nvm or Homebrew Node the default prefix is already user-owned — a plain
`npm install -g billion-context` works as-is. On Windows the default prefix
(`%APPDATA%\npm`) is also user-writable — plain `npm install -g billion-context`.

This installs the `bili` command (`bili-proxy` is kept as an alias). Hitting
`EACCES` with an old root-owned prefix? Run the two prefix lines above, then
reinstall — that is the permanent fix; avoid `sudo`.

## Quickstart

Expand Down
8 changes: 7 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,17 @@ QQ群:

## 安装

Linux / macOS —— 一次性配置用户级 npm prefix(全程不需要 `sudo`,`bili` 自更新也不会再遇到权限问题):

```bash
npm config set prefix "$HOME/.local"
export PATH="$HOME/.local/bin:$PATH" # 这行也请写进 ~/.bashrc 或 ~/.zshrc
npm install -g billion-context
```

这会安装 `bili` 命令(`bili-proxy` 保留为别名)。
用 nvm 或 Homebrew Node 的,默认 prefix 本来就属于当前用户,直接 `npm install -g billion-context` 即可;Windows 的默认 prefix(`%APPDATA%\npm`)同样用户可写,直接 `npm install -g billion-context`。

这会安装 `bili` 命令(`bili-proxy` 保留为别名)。旧装的是 root 属主的 prefix、现在报 `EACCES`?执行上面两行 prefix 命令后重装即可根治——不要用 `sudo`。

## 快速上手

Expand Down
5 changes: 4 additions & 1 deletion src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,10 @@ export function backoffMs(count: number): number {

function remediationHint(error: string): string {
if (/not writable/i.test(error)) {
return "the install dir is not writable by this user. Fix its ownership/permissions, point npm at a user-writable prefix and reinstall (npm install -g billion-context), or disable auto-update (config autoUpdate:false / env ACP_AUTO_UPDATE=0)";
if (process.platform === "win32") {
return "the install dir is not writable by this user. On Windows the default npm prefix (%APPDATA%\\npm) is user-writable \u2014 repair that dir's ownership/permissions and reinstall (npm install -g billion-context), or disable auto-update (config autoUpdate:false / env ACP_AUTO_UPDATE=0)";
}
return "the install dir is not writable by this user. Fix its ownership/permissions, or move to a user-level prefix \u2014 npm config set prefix \"$HOME/.local\" (then put \"$HOME/.local/bin\" on PATH) and npm install -g billion-context \u2014 or disable auto-update (config autoUpdate:false / env ACP_AUTO_UPDATE=0)";
}
if (/git working tree/i.test(error)) {
return "this copy runs from a source checkout. Install globally instead (npm install -g billion-context) so auto-update has a writable target";
Expand Down
2 changes: 1 addition & 1 deletion website/blog/posts/2026-10-08_meet-bili.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ The numbers on the front page are production data: 174,327 model calls, 18.8B cu

## Where it runs

One npm package, Node 22+, MIT license. Install with `npm install -g billion-context`, start the proxy with `bili`, and open <http://127.0.0.1:8787/__bili/>. Full configuration lives at `~/.config/billion-context/billion-context.json` — `{ }` is a valid configuration. Read the [docs](../docs/) for everything else.
One npm package, Node 22+, MIT license. Install with `npm install -g billion-context` (Linux/macOS without nvm/Homebrew Node: `npm config set prefix "$HOME/.local"` first so it updates itself without `sudo`), start the proxy with `bili`, and open <http://127.0.0.1:8787/__bili/>. Full configuration lives at `~/.config/billion-context/billion-context.json` — `{ }` is a valid configuration. Read the [docs](../docs/) for everything else.

> Note: this is a sample post demonstrating the blog format (a markdown subset rendered to static pages by `tools/build-blog.mjs`). The first real story will replace it.
2 changes: 1 addition & 1 deletion website/blog/posts/2026-10-08_meet-bili.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ billion-context 在本地以「仅回环」的代理方式运行在你的编码

## 它跑在哪里

一个 npm 包,Node 22+,MIT 协议。`npm install -g billion-context` 安装,`bili` 启动代理,浏览器打开 <http://127.0.0.1:8787/__bili/>。完整配置在 `~/.config/billion-context/billion-context.json`——`{ }` 就是合法配置。其余一切见[文档](../docs/)。
一个 npm 包,Node 22+,MIT 协议。`npm install -g billion-context` 安装(非 nvm/Homebrew Node 的 Linux/macOS 先 `npm config set prefix "$HOME/.local"`,自更新就不需要 `sudo`),`bili` 启动代理,浏览器打开 <http://127.0.0.1:8787/__bili/>。完整配置在 `~/.config/billion-context/billion-context.json`——`{ }` 就是合法配置。其余一切见[文档](../docs/)。

> 说明:这是一篇示例文章,用来演示博客格式(markdown 子集,由 `tools/build-blog.mjs` 渲染成静态页)。首篇正式文章会替换它。
Loading