安裝
快速安裝 (Linux / macOS)
curl -fsSL https://peria.ai/install.sh | bash
這會下載適用於您平臺的最新版本二進制文件,驗證SHA256校驗和,並將其放置在 ~/.local/bin/ 中。
安裝後,初始化PRECC:
precc init
precc init 在Claude Code中註冊PreToolUse鉤子,創建數據目錄,並初始化技能數據庫。
安裝選項
SHA256驗證
默認情況下,安裝程序會根據已發佈的SHA256校驗和驗證二進制文件。要跳過驗證(不推薦):
curl -fsSL https://peria.ai/install.sh | bash -s -- --no-verify
自定義安裝前綴
安裝到自定義位置:
curl -fsSL https://peria.ai/install.sh | bash -s -- --prefix /opt/precc
OpenCLI (–opencli) — WebFetch token savings
PRECC can also install OpenCLI, a third-party Node.js tool that turns ~148 websites (HackerNews, Reddit, arxiv, bilibili, zhihu, x.com, …) into structured-output commands. When installed, PRECC’s two built-in webfetch-opencli-* skills auto-rewrite raw curl/wget calls into the corresponding opencli <site> command for 5–50× smaller output.
precc init --opencli
This runs npm install -g @jackwener/opencli (requires Node.js 20+) and prints the URL for OpenCLI’s optional Chrome extension. The extension is only needed to reuse logged-in cookies on private pages; public sources work without it.
Skipping --opencli keeps PRECC fully self-contained — the auto-rewrite skill inlines a command -v opencli check that falls back to the original command when OpenCLI isn’t installed, so the skill is safe to ship default-on.
The Chrome extension requests broad permissions (debugger, <all_urls>, cookies). Operators should review them before installing it; --opencli only handles the npm package, not the extension.
附加工具 (–extras)
PRECC附帶可選的附加工具。使用 --extras 安裝它們:
curl -fsSL https://peria.ai/install.sh | bash -s -- --extras
這將安裝:
| 工具 | 用途 |
|---|---|
| RTK | 命令重寫工具包 |
| lean-ctx | CLAUDE.md和提示文件的上下文壓縮 |
| nushell | 用於高級管道的結構化Shell |
| cocoindex-code | 代碼索引以加快上下文解析 |
Windows (PowerShell)
irm https://peria.ai/install.ps1 | iex
然後初始化:
precc init
手動安裝
- 從 GitHub Releases 下載適用於您平臺的發佈二進制文件。
- 根據版本中的
.sha256文件驗證SHA256校驗和。 - 將二進制文件放置在
PATH中的目錄中(例如~/.local/bin/)。 - 運行
precc init。
更新
precc update
強制更新到特定版本:
precc update --force --version 0.3.0
啓用自動更新:
precc update --auto
在 OpenClaw / ClawHub 下安裝
PRECC 在 plugins/openclaw/openclaw.plugin.json 提供外掛清單(id 為 precc-token-saver)。每當發布公開版本時,GitHub Actions 工作流程 clawhub-publish.yml 會將技能套件推送到 ClawHub 註冊表,因此終端使用者可以透過 ClawHub CLI 而非 curl 安裝程式來安裝 PRECC:
# ClawHub CLI
clawhub install precc
# Or pin the plugin manifest (id: precc-token-saver) via OpenClaw's
# plugin marketplace UI or its CLI equivalent.
節省如何在 OpenClaw 下呈現
在 Claude Code 下可用的每一個 PRECC 報告介面在 OpenClaw 下同樣可用——precc savings、precc savings --all、本地化的狀態列(設定 PRECC_LANG=zh,狀態列會以你的語言顯示)以及本地改寫稽核日誌,都從你機器上同一組 SQLCipher 資料庫讀取資料。docs/symposium-plan/openclaw-savings-reporting.md 中的另一份規範描述了未來在每個 hook 回應中加入結構化的 preccSavings 欄位,以及在預設閾值 $0.05 時送出一行會話結束通知;這一部分尚未發布。
驗證安裝
$ precc --version
precc 0.3.0
$ precc savings
Session savings: 0 tokens (no commands intercepted yet)
如果找不到 precc,請確保 ~/.local/bin 在您的 PATH 中。