@cc-claw/peri 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -0
- package/bin/peri +3 -0
- package/install.js +100 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Peri
|
|
2
|
+
|
|
3
|
+
**用开源模型跑 Agent Loop — Rust 写的终端编程助手,兼容 Claude Code 全家桶**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@cc-claw/peri)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
## 安装
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install -g @cc-claw/peri
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
安装时自动下载对应平台的预编译二进制(Linux x64/arm64/riscv64、macOS x64/arm64、Windows x64)。
|
|
15
|
+
|
|
16
|
+
## 快速开始
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# 启动交互式 TUI
|
|
20
|
+
peri
|
|
21
|
+
|
|
22
|
+
# 直接给任务
|
|
23
|
+
peri "解释这个项目的目录结构"
|
|
24
|
+
|
|
25
|
+
# 指定模型
|
|
26
|
+
peri --model deepseek/deepseek-chat "重构这个函数"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 支持的平台
|
|
30
|
+
|
|
31
|
+
| 平台 | 架构 |
|
|
32
|
+
|------|------|
|
|
33
|
+
| Linux | x86_64, aarch64, riscv64 |
|
|
34
|
+
| macOS | x86_64 (Intel), aarch64 (Apple Silicon) |
|
|
35
|
+
| Windows | x86_64 |
|
|
36
|
+
|
|
37
|
+
## 为什么选 Peri?
|
|
38
|
+
|
|
39
|
+
| 对比项 | 其他终端 Agent | Peri |
|
|
40
|
+
|--------|---------------|------|
|
|
41
|
+
| 运行时 | Node.js / Bun,动辄吃 1GB 内存 | Rust 原生,启动快,~50MB 内存 |
|
|
42
|
+
| 模型绑定 | 锁死一家 LLM | 随便换:Anthropic、OpenAI 兼容、DeepSeek、GLM |
|
|
43
|
+
| Prompt 缓存 | 每轮重算,token 白烧 | 冻结 system prompt,95-99% 缓存命中率 |
|
|
44
|
+
| Claude Code 生态 | 不兼容 | 直接用 `.claude/` 配置、agents、skills、hooks、MCP |
|
|
45
|
+
|
|
46
|
+
## 链接
|
|
47
|
+
|
|
48
|
+
- [GitHub](https://github.com/wismyzhizi2018/peri)
|
|
49
|
+
- [Issues](https://github.com/wismyzhizi2018/peri/issues)
|
|
50
|
+
- [English README](https://github.com/wismyzhizi2018/peri#readme)
|
package/bin/peri
ADDED
package/install.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { createWriteStream, mkdirSync, chmodSync, existsSync } = require("fs");
|
|
4
|
+
const { join } = require("path");
|
|
5
|
+
const { get } = require("https");
|
|
6
|
+
const { execSync } = require("child_process");
|
|
7
|
+
|
|
8
|
+
const VERSION = require("./package.json").version;
|
|
9
|
+
const REPO = "wismyzhizi2018/peri";
|
|
10
|
+
const BASE_URL = `https://github.com/${REPO}/releases/download/npm-v${VERSION}`;
|
|
11
|
+
|
|
12
|
+
const PLATFORMS = {
|
|
13
|
+
"linux-x64": { os: "linux", arch: "x64", suffix: "linux-x86_64", ext: "tar.gz" },
|
|
14
|
+
"linux-arm64": { os: "linux", arch: "arm64", suffix: "linux-aarch64", ext: "tar.gz" },
|
|
15
|
+
"darwin-x64": { os: "darwin", arch: "x64", suffix: "macos-x86_64", ext: "tar.gz" },
|
|
16
|
+
"darwin-arm64": { os: "darwin", arch: "arm64", suffix: "macos-aarch64", ext: "tar.gz" },
|
|
17
|
+
"win32-x64": { os: "win32", arch: "x64", suffix: "windows-x86_64", ext: "zip" },
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function getPlatformKey() {
|
|
21
|
+
const os = process.platform;
|
|
22
|
+
const arch = process.arch;
|
|
23
|
+
const key = `${os}-${arch}`;
|
|
24
|
+
if (!PLATFORMS[key]) {
|
|
25
|
+
throw new Error(`Unsupported platform: ${os}-${arch}. Supported: ${Object.keys(PLATFORMS).join(", ")}`);
|
|
26
|
+
}
|
|
27
|
+
return key;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function download(url) {
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
get(url, (res) => {
|
|
33
|
+
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
|
|
34
|
+
download(res.headers.location).then(resolve, reject);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (res.statusCode !== 200) {
|
|
38
|
+
reject(new Error(`Download failed: HTTP ${res.statusCode} for ${url}`));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const chunks = [];
|
|
42
|
+
res.on("data", (chunk) => chunks.push(chunk));
|
|
43
|
+
res.on("end", () => resolve(Buffer.concat(chunks)));
|
|
44
|
+
res.on("error", reject);
|
|
45
|
+
}).on("error", reject);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function extractTarGz(buffer, dest) {
|
|
50
|
+
const { writeFileSync, unlinkSync } = require("fs");
|
|
51
|
+
const tmpFile = join(dest, "peri.tar.gz");
|
|
52
|
+
writeFileSync(tmpFile, buffer);
|
|
53
|
+
execSync(`tar -xzf "${tmpFile}" -C "${dest}"`, { stdio: "ignore" });
|
|
54
|
+
unlinkSync(tmpFile);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function extractZip(buffer, dest) {
|
|
58
|
+
const { writeFileSync } = require("fs");
|
|
59
|
+
const AdmZip = require("adm-zip");
|
|
60
|
+
const zip = new AdmZip(buffer);
|
|
61
|
+
zip.extractAllTo(dest, true);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function main() {
|
|
65
|
+
const key = getPlatformKey();
|
|
66
|
+
const platform = PLATFORMS[key];
|
|
67
|
+
const fileName = `peri-${platform.suffix}.${platform.ext}`;
|
|
68
|
+
const url = `${BASE_URL}/${fileName}`;
|
|
69
|
+
const binDir = join(__dirname, "bin");
|
|
70
|
+
|
|
71
|
+
if (!existsSync(binDir)) {
|
|
72
|
+
mkdirSync(binDir, { recursive: true });
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
console.log(`Downloading peri ${VERSION} for ${platform.os}-${platform.arch}...`);
|
|
76
|
+
console.log(` URL: ${url}`);
|
|
77
|
+
|
|
78
|
+
const buffer = await download(url);
|
|
79
|
+
|
|
80
|
+
if (platform.ext === "tar.gz") {
|
|
81
|
+
extractTarGz(buffer, binDir);
|
|
82
|
+
} else {
|
|
83
|
+
extractZip(buffer, binDir);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Rename binary and set permissions
|
|
87
|
+
const binaryName = platform.os === "win32" ? "peri.exe" : "peri";
|
|
88
|
+
const binaryPath = join(binDir, binaryName);
|
|
89
|
+
|
|
90
|
+
if (platform.os !== "win32") {
|
|
91
|
+
chmodSync(binaryPath, 0o755);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
console.log(`peri ${VERSION} installed successfully.`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
main().catch((err) => {
|
|
98
|
+
console.error("Failed to install peri:", err.message);
|
|
99
|
+
process.exit(1);
|
|
100
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cc-claw/peri",
|
|
3
|
+
"version": "0.1.5",
|
|
4
|
+
"description": "Terminal coding agent powered by open-source models — Rust-built, Claude Code compatible",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"agent",
|
|
7
|
+
"coding",
|
|
8
|
+
"terminal",
|
|
9
|
+
"rust",
|
|
10
|
+
"llm",
|
|
11
|
+
"claude-code"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/wismyzhizi2018/peri.git"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/wismyzhizi2018/peri",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/wismyzhizi2018/peri/issues"
|
|
20
|
+
},
|
|
21
|
+
"license": "Apache-2.0",
|
|
22
|
+
"bin": {
|
|
23
|
+
"peri": "./bin/peri"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"postinstall": "node install.js"
|
|
27
|
+
},
|
|
28
|
+
"os": [
|
|
29
|
+
"linux",
|
|
30
|
+
"darwin",
|
|
31
|
+
"win32"
|
|
32
|
+
],
|
|
33
|
+
"cpu": [
|
|
34
|
+
"x64",
|
|
35
|
+
"arm64"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=16"
|
|
39
|
+
}
|
|
40
|
+
}
|