@teneo-protocol/cli 1.0.0
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/install.mjs +123 -0
- package/package.json +33 -0
package/install.mjs
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { execSync } from "child_process";
|
|
4
|
+
import { existsSync, mkdirSync, writeFileSync, chmodSync } from "fs";
|
|
5
|
+
import { join } from "path";
|
|
6
|
+
import { homedir, tmpdir } from "os";
|
|
7
|
+
|
|
8
|
+
const INSTALL_DIR = join(homedir(), "teneo-skill");
|
|
9
|
+
const REPO = "https://github.com/TeneoProtocolAI/teneo-skills.git";
|
|
10
|
+
const SKILLS_REPO = "TeneoProtocolAI/teneo-skills";
|
|
11
|
+
|
|
12
|
+
const DEPS = [
|
|
13
|
+
"@teneo-protocol/sdk@latest",
|
|
14
|
+
"commander@^12.1.0",
|
|
15
|
+
"dotenv@^16.0.0",
|
|
16
|
+
"viem@^2.21.0",
|
|
17
|
+
"tsx@^4.0.0",
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
function log(msg) {
|
|
21
|
+
console.log(` ${msg}`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function run(cmd, opts = {}) {
|
|
25
|
+
return execSync(cmd, { stdio: "pipe", encoding: "utf-8", ...opts });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// ── Preflight ─────────────────────────────────────────────────
|
|
29
|
+
|
|
30
|
+
const nodeMajor = parseInt(process.versions.node.split(".")[0], 10);
|
|
31
|
+
if (nodeMajor < 18) {
|
|
32
|
+
console.error(`Error: Node.js 18+ required, found v${process.version}`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
console.log("\n Teneo Protocol CLI Installer\n");
|
|
37
|
+
|
|
38
|
+
// ── Step 1: Install CLI ───────────────────────────────────────
|
|
39
|
+
|
|
40
|
+
const alreadyInstalled = existsSync(join(INSTALL_DIR, "teneo"));
|
|
41
|
+
|
|
42
|
+
if (alreadyInstalled) {
|
|
43
|
+
log("CLI already installed at ~/teneo-skill/ — updating...");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const tmpDir = join(tmpdir(), `teneo-install-${Date.now()}`);
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
log("Cloning teneo-skills repo...");
|
|
50
|
+
run(`git clone --depth 1 ${REPO} ${tmpDir}`);
|
|
51
|
+
|
|
52
|
+
const cliDir = join(tmpDir, "cli");
|
|
53
|
+
if (!existsSync(join(cliDir, "index.ts")) || !existsSync(join(cliDir, "daemon.ts"))) {
|
|
54
|
+
console.error("Error: CLI source files not found in cloned repo.");
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
mkdirSync(INSTALL_DIR, { recursive: true });
|
|
59
|
+
|
|
60
|
+
// Copy source files
|
|
61
|
+
const { copyFileSync } = await import("fs");
|
|
62
|
+
copyFileSync(join(cliDir, "index.ts"), join(INSTALL_DIR, "teneo.ts"));
|
|
63
|
+
copyFileSync(join(cliDir, "daemon.ts"), join(INSTALL_DIR, "daemon.ts"));
|
|
64
|
+
log("Copied teneo.ts and daemon.ts");
|
|
65
|
+
|
|
66
|
+
// Install npm dependencies
|
|
67
|
+
if (!existsSync(join(INSTALL_DIR, "package.json"))) {
|
|
68
|
+
run("npm init -y", { cwd: INSTALL_DIR });
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
log("Installing npm dependencies (this may take a minute)...");
|
|
72
|
+
run(`npm install --prefer-offline ${DEPS.join(" ")}`, {
|
|
73
|
+
cwd: INSTALL_DIR,
|
|
74
|
+
env: { ...process.env, NODE_OPTIONS: "--max-old-space-size=512" },
|
|
75
|
+
});
|
|
76
|
+
log("Dependencies installed");
|
|
77
|
+
|
|
78
|
+
// Create bash wrapper
|
|
79
|
+
const wrapper = `#!/bin/bash\ncd ~/teneo-skill && exec npx tsx teneo.ts "$@"\n`;
|
|
80
|
+
writeFileSync(join(INSTALL_DIR, "teneo"), wrapper);
|
|
81
|
+
chmodSync(join(INSTALL_DIR, "teneo"), 0o755);
|
|
82
|
+
log("Created wrapper script");
|
|
83
|
+
|
|
84
|
+
} finally {
|
|
85
|
+
// Clean up temp dir
|
|
86
|
+
try {
|
|
87
|
+
run(`rm -rf ${tmpDir}`);
|
|
88
|
+
} catch {}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ── Step 2: Install skills ────────────────────────────────────
|
|
92
|
+
|
|
93
|
+
log("");
|
|
94
|
+
log("Installing skills for AI coding assistants...");
|
|
95
|
+
|
|
96
|
+
try {
|
|
97
|
+
run(`npx -y skills add ${SKILLS_REPO} -y`, { stdio: "inherit" });
|
|
98
|
+
} catch {
|
|
99
|
+
log("Note: Skills installation skipped (npx skills not available).");
|
|
100
|
+
log("You can install skills manually: npx skills add TeneoProtocolAI/teneo-skills");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// ── Step 3: Verify ────────────────────────────────────────────
|
|
104
|
+
|
|
105
|
+
log("");
|
|
106
|
+
log("Verifying installation...");
|
|
107
|
+
|
|
108
|
+
try {
|
|
109
|
+
const health = run(`${join(INSTALL_DIR, "teneo")} health`);
|
|
110
|
+
log("CLI is working!");
|
|
111
|
+
console.log(health);
|
|
112
|
+
} catch {
|
|
113
|
+
log("CLI installed but health check failed — this is OK on first run.");
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
console.log("");
|
|
117
|
+
console.log(" Teneo CLI installed to ~/teneo-skill/");
|
|
118
|
+
console.log("");
|
|
119
|
+
console.log(" Usage:");
|
|
120
|
+
console.log(" ~/teneo-skill/teneo health");
|
|
121
|
+
console.log(" ~/teneo-skill/teneo list-agents");
|
|
122
|
+
console.log(" ~/teneo-skill/teneo discover");
|
|
123
|
+
console.log("");
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teneo-protocol/cli",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Install the Teneo Protocol CLI and AI agent skills for coding assistants (Claude Code, Cursor, Codex, OpenCode, and more)",
|
|
5
|
+
"bin": {
|
|
6
|
+
"teneo-cli": "./install.mjs"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [
|
|
9
|
+
"teneo",
|
|
10
|
+
"cli",
|
|
11
|
+
"ai-agent",
|
|
12
|
+
"claude-code",
|
|
13
|
+
"cursor",
|
|
14
|
+
"codex",
|
|
15
|
+
"skills",
|
|
16
|
+
"web3",
|
|
17
|
+
"usdc",
|
|
18
|
+
"x402"
|
|
19
|
+
],
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "Teneo Protocol",
|
|
22
|
+
"url": "https://teneo-protocol.ai"
|
|
23
|
+
},
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/TeneoProtocolAI/teneo-skills.git"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://teneo-protocol.ai",
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18"
|
|
32
|
+
}
|
|
33
|
+
}
|