@getreka/cli 0.1.0 → 0.2.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/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +52 -17
- package/dist/index.js +3 -2
- package/package.json +16 -5
package/dist/commands/init.d.ts
CHANGED
package/dist/commands/init.js
CHANGED
|
@@ -56,15 +56,47 @@ const MCP_TEMPLATE = `{
|
|
|
56
56
|
async function initCommand(opts) {
|
|
57
57
|
const projectPath = opts.path || process.cwd();
|
|
58
58
|
const projectName = opts.project || path.basename(projectPath);
|
|
59
|
-
//
|
|
60
|
-
if (opts.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
// Demo mode: connect to public demo instance
|
|
60
|
+
if (opts.demo) {
|
|
61
|
+
const demoUrl = "https://rag.akeryuu.com";
|
|
62
|
+
console.log("");
|
|
63
|
+
console.log(chalk_1.default.bold(" Connecting to Reka Demo..."));
|
|
64
|
+
try {
|
|
65
|
+
const demoClient = (0, api_1.createClient)((0, config_1.loadConfig)({
|
|
66
|
+
api: { url: demoUrl },
|
|
67
|
+
project: { name: projectName, path: projectPath },
|
|
68
|
+
}));
|
|
69
|
+
const { data } = await demoClient.post("/api/keys", {
|
|
70
|
+
projectName: `demo-${projectName}`,
|
|
71
|
+
label: `demo-${Date.now()}`,
|
|
72
|
+
});
|
|
73
|
+
writeMcpConfig(projectPath, data.key, opts.force, demoUrl);
|
|
74
|
+
console.log(chalk_1.default.green(` ✓ Connected to demo at ${demoUrl}`));
|
|
75
|
+
console.log(chalk_1.default.green(` ✓ .mcp.json written`));
|
|
76
|
+
console.log("");
|
|
77
|
+
console.log(" Open your AI assistant — it now has memory via the Reka demo.");
|
|
78
|
+
console.log(chalk_1.default.yellow(" Note: demo data may be reset periodically."));
|
|
79
|
+
console.log("");
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
const msg = err.response?.data?.error || err.message;
|
|
83
|
+
console.log(chalk_1.default.red(`\n Demo unavailable: ${msg}`));
|
|
84
|
+
console.log(chalk_1.default.yellow(` Try self-hosted instead: docker-compose up -d\n`));
|
|
64
85
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
// Cloud mode: coming soon
|
|
89
|
+
if (opts.cloud) {
|
|
90
|
+
console.log("");
|
|
91
|
+
console.log(chalk_1.default.bold(" Reka Cloud — coming soon"));
|
|
92
|
+
console.log("");
|
|
93
|
+
console.log(" Managed RAG with zero infrastructure. Hybrid and fully managed options.");
|
|
94
|
+
console.log(` Join the waitlist: ${chalk_1.default.cyan("https://getreka.dev")}`);
|
|
95
|
+
console.log("");
|
|
96
|
+
console.log(" In the meantime, self-hosted works great:");
|
|
97
|
+
console.log(` ${chalk_1.default.bold("docker-compose up -d")}`);
|
|
98
|
+
console.log(` ${chalk_1.default.bold(`npx @getreka/cli init --project ${projectName}`)}`);
|
|
99
|
+
console.log("");
|
|
68
100
|
return;
|
|
69
101
|
}
|
|
70
102
|
// Self-hosted: generate key via local API
|
|
@@ -93,18 +125,21 @@ async function initCommand(opts) {
|
|
|
93
125
|
console.log(chalk_1.default.yellow(` Is the Reka API running? Start with: docker-compose up -d\n`));
|
|
94
126
|
}
|
|
95
127
|
}
|
|
96
|
-
function writeMcpConfig(projectPath, apiKey, force) {
|
|
128
|
+
function writeMcpConfig(projectPath, apiKey, force, apiUrl) {
|
|
97
129
|
const mcpPath = path.join(projectPath, ".mcp.json");
|
|
130
|
+
const env = { REKA_API_KEY: apiKey };
|
|
131
|
+
if (apiUrl)
|
|
132
|
+
env.REKA_API_URL = apiUrl;
|
|
133
|
+
const rekaEntry = {
|
|
134
|
+
command: "npx",
|
|
135
|
+
args: ["-y", "@getreka/mcp"],
|
|
136
|
+
env,
|
|
137
|
+
};
|
|
98
138
|
if (fs.existsSync(mcpPath) && !force) {
|
|
99
|
-
// Merge into existing .mcp.json
|
|
100
139
|
try {
|
|
101
140
|
const existing = JSON.parse(fs.readFileSync(mcpPath, "utf-8"));
|
|
102
141
|
existing.mcpServers = existing.mcpServers || {};
|
|
103
|
-
existing.mcpServers.reka =
|
|
104
|
-
command: "npx",
|
|
105
|
-
args: ["-y", "@getreka/mcp"],
|
|
106
|
-
env: { REKA_API_KEY: apiKey },
|
|
107
|
-
};
|
|
142
|
+
existing.mcpServers.reka = rekaEntry;
|
|
108
143
|
fs.writeFileSync(mcpPath, JSON.stringify(existing, null, 2) + "\n", "utf-8");
|
|
109
144
|
return;
|
|
110
145
|
}
|
|
@@ -112,6 +147,6 @@ function writeMcpConfig(projectPath, apiKey, force) {
|
|
|
112
147
|
// Fall through to overwrite
|
|
113
148
|
}
|
|
114
149
|
}
|
|
115
|
-
const
|
|
116
|
-
fs.writeFileSync(mcpPath,
|
|
150
|
+
const config = { mcpServers: { reka: rekaEntry } };
|
|
151
|
+
fs.writeFileSync(mcpPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
|
|
117
152
|
}
|
package/dist/index.js
CHANGED
|
@@ -27,8 +27,9 @@ program
|
|
|
27
27
|
.option("--project <name>", "Project name (defaults to directory name)")
|
|
28
28
|
.option("-p, --path <path>", "Project path")
|
|
29
29
|
.option("-f, --force", "Overwrite existing .mcp.json")
|
|
30
|
-
.option("--
|
|
31
|
-
.option("--
|
|
30
|
+
.option("--demo", "Connect to the Reka demo instance")
|
|
31
|
+
.option("--cloud", "Connect to Reka Cloud (coming soon)")
|
|
32
|
+
.option("--key <key>", "API key for cloud or demo")
|
|
32
33
|
.option("--api-url <url>", "RAG API URL (default: http://localhost:3100)")
|
|
33
34
|
.action(async (opts) => {
|
|
34
35
|
await (0, init_1.initCommand)(opts);
|
package/package.json
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getreka/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Reka CLI — manage self-hosted RAG infrastructure for AI coding agents",
|
|
5
5
|
"bin": {
|
|
6
|
-
"reka": "
|
|
6
|
+
"reka": "dist/index.js"
|
|
7
7
|
},
|
|
8
8
|
"main": "dist/index.js",
|
|
9
|
-
"files": [
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
10
13
|
"publishConfig": {
|
|
11
14
|
"access": "public"
|
|
12
15
|
},
|
|
13
16
|
"repository": {
|
|
14
17
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/getreka/reka.git",
|
|
18
|
+
"url": "git+https://github.com/getreka/reka.git",
|
|
16
19
|
"directory": "cli"
|
|
17
20
|
},
|
|
18
21
|
"homepage": "https://getreka.dev",
|
|
@@ -38,5 +41,13 @@
|
|
|
38
41
|
"node": ">=18"
|
|
39
42
|
},
|
|
40
43
|
"license": "BSL-1.1",
|
|
41
|
-
"keywords": [
|
|
44
|
+
"keywords": [
|
|
45
|
+
"reka",
|
|
46
|
+
"rag",
|
|
47
|
+
"mcp",
|
|
48
|
+
"ai",
|
|
49
|
+
"cli",
|
|
50
|
+
"coding-agent",
|
|
51
|
+
"memory"
|
|
52
|
+
]
|
|
42
53
|
}
|