cc-claw 0.2.1 → 0.2.3
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 +1 -1
- package/dist/cli.js +57 -32
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# CC-Claw
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<img src="assets/cc_claw.png" alt="CC-Claw Logo" width="
|
|
4
|
+
<img src="assets/cc_claw.png" alt="CC-Claw Logo" width="500" />
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
A personal AI assistant on Telegram, powered by coding CLIs. CC-Claw uses **Claude Code**, **Gemini CLI**, and **Codex** as interchangeable backends — giving you a multi-model AI assistant accessible from any device.
|
package/dist/cli.js
CHANGED
|
@@ -48,7 +48,7 @@ var VERSION;
|
|
|
48
48
|
var init_version = __esm({
|
|
49
49
|
"src/version.ts"() {
|
|
50
50
|
"use strict";
|
|
51
|
-
VERSION = true ? "0.2.
|
|
51
|
+
VERSION = true ? "0.2.3" : (() => {
|
|
52
52
|
try {
|
|
53
53
|
return JSON.parse(readFileSync(join2(process.cwd(), "package.json"), "utf-8")).version ?? "unknown";
|
|
54
54
|
} catch {
|
|
@@ -13823,39 +13823,57 @@ async function setup() {
|
|
|
13823
13823
|
header(3, TOTAL_STEPS, "Backend Configuration");
|
|
13824
13824
|
console.log(" CC-Claw supports multiple AI backends: Claude, Gemini, and Codex.");
|
|
13825
13825
|
console.log(" Configure the ones you plan to use. You can add more later.\n");
|
|
13826
|
-
const
|
|
13827
|
-
if (
|
|
13826
|
+
const configureClaude = env.CLAUDE_CODE_USE_VERTEX === "1" || env.ANTHROPIC_API_KEY || await confirm("Configure Claude Code?", true);
|
|
13827
|
+
if (configureClaude) {
|
|
13828
13828
|
const detectedVertex = process.env.CLAUDE_CODE_USE_VERTEX === "1";
|
|
13829
|
-
const
|
|
13830
|
-
|
|
13831
|
-
if (detectedVertex && detectedProject) {
|
|
13829
|
+
const detectedApiKey = process.env.ANTHROPIC_API_KEY;
|
|
13830
|
+
if (detectedVertex && process.env.ANTHROPIC_VERTEX_PROJECT_ID) {
|
|
13832
13831
|
console.log(green(" Auto-detected Vertex AI from your environment:"));
|
|
13833
|
-
console.log(green(` Project: ${
|
|
13834
|
-
console.log(green(` Region: ${
|
|
13832
|
+
console.log(green(` Project: ${process.env.ANTHROPIC_VERTEX_PROJECT_ID}`));
|
|
13833
|
+
console.log(green(` Region: ${process.env.CLOUD_ML_REGION ?? "global"}`));
|
|
13835
13834
|
const useDetected = await confirm("Use these settings?", true);
|
|
13836
13835
|
if (useDetected) {
|
|
13837
13836
|
env.CLAUDE_CODE_USE_VERTEX = "1";
|
|
13838
|
-
env.CLOUD_ML_REGION =
|
|
13839
|
-
env.ANTHROPIC_VERTEX_PROJECT_ID =
|
|
13837
|
+
env.CLOUD_ML_REGION = process.env.CLOUD_ML_REGION ?? "global";
|
|
13838
|
+
env.ANTHROPIC_VERTEX_PROJECT_ID = process.env.ANTHROPIC_VERTEX_PROJECT_ID;
|
|
13839
|
+
}
|
|
13840
|
+
} else if (detectedApiKey) {
|
|
13841
|
+
console.log(green(" Auto-detected Anthropic API key from your environment."));
|
|
13842
|
+
const useDetected = await confirm("Use it?", true);
|
|
13843
|
+
if (useDetected) {
|
|
13844
|
+
env.ANTHROPIC_API_KEY = detectedApiKey;
|
|
13845
|
+
}
|
|
13846
|
+
}
|
|
13847
|
+
if (!env.CLAUDE_CODE_USE_VERTEX && !env.ANTHROPIC_API_KEY) {
|
|
13848
|
+
console.log(" How do you access Claude Code?\n");
|
|
13849
|
+
console.log(cyan(" 1. Claude Max/Pro subscription (already logged in via 'claude login')"));
|
|
13850
|
+
console.log(cyan(" 2. Anthropic API key"));
|
|
13851
|
+
console.log(cyan(" 3. Google Vertex AI (enterprise)"));
|
|
13852
|
+
console.log(cyan(" 4. Skip Claude for now\n"));
|
|
13853
|
+
const choice = await ask(" Choose [1/2/3/4]: ");
|
|
13854
|
+
if (choice.trim() === "1") {
|
|
13855
|
+
console.log(green(" No extra config needed \u2014 Claude uses your existing login."));
|
|
13856
|
+
console.log(dim(" Make sure you've run 'claude login' at least once."));
|
|
13857
|
+
} else if (choice.trim() === "2") {
|
|
13858
|
+
console.log("");
|
|
13859
|
+
console.log(dim(" Get an API key at: https://console.anthropic.com/settings/keys\n"));
|
|
13860
|
+
const apiKey = await requiredInput("Anthropic API key", env.ANTHROPIC_API_KEY);
|
|
13861
|
+
env.ANTHROPIC_API_KEY = apiKey;
|
|
13862
|
+
console.log(green(" Claude configured with API key."));
|
|
13863
|
+
} else if (choice.trim() === "3") {
|
|
13864
|
+
console.log("");
|
|
13865
|
+
console.log(dim(" You need a Google Cloud project with the Vertex AI API enabled."));
|
|
13866
|
+
console.log(dim(" See: https://docs.anthropic.com/en/docs/build-with-claude/vertex-ai\n"));
|
|
13867
|
+
const projectId = await requiredInput("Vertex AI Project ID", env.ANTHROPIC_VERTEX_PROJECT_ID);
|
|
13868
|
+
env.ANTHROPIC_VERTEX_PROJECT_ID = projectId;
|
|
13869
|
+
const regionInput = await ask(` Cloud ML Region ${dim(`[${env.CLOUD_ML_REGION ?? "global"}]`)}: `);
|
|
13870
|
+
env.CLOUD_ML_REGION = regionInput.trim() || env.CLOUD_ML_REGION || "global";
|
|
13871
|
+
env.CLAUDE_CODE_USE_VERTEX = "1";
|
|
13872
|
+
console.log(green(` Vertex AI configured: ${projectId} (${env.CLOUD_ML_REGION})`));
|
|
13840
13873
|
} else {
|
|
13841
|
-
|
|
13874
|
+
console.log(dim(" Skipping Claude. You can configure it later in ~/.cc-claw/.env"));
|
|
13842
13875
|
}
|
|
13843
13876
|
}
|
|
13844
|
-
if (!env.CLAUDE_CODE_USE_VERTEX) {
|
|
13845
|
-
console.log(dim(" You need a Google Cloud project with the Vertex AI API enabled."));
|
|
13846
|
-
console.log(dim(" See: https://docs.anthropic.com/en/docs/build-with-claude/vertex-ai\n"));
|
|
13847
|
-
const projectId = await requiredInput(
|
|
13848
|
-
"Vertex AI Project ID",
|
|
13849
|
-
env.ANTHROPIC_VERTEX_PROJECT_ID
|
|
13850
|
-
);
|
|
13851
|
-
env.ANTHROPIC_VERTEX_PROJECT_ID = projectId;
|
|
13852
|
-
const regionInput = await ask(
|
|
13853
|
-
` Cloud ML Region ${dim(`[${env.CLOUD_ML_REGION ?? "global"}]`)}: `
|
|
13854
|
-
);
|
|
13855
|
-
env.CLOUD_ML_REGION = regionInput.trim() || env.CLOUD_ML_REGION || "global";
|
|
13856
|
-
env.CLAUDE_CODE_USE_VERTEX = "1";
|
|
13857
|
-
console.log(green(` Vertex AI configured: ${projectId} (${env.CLOUD_ML_REGION})`));
|
|
13858
|
-
}
|
|
13859
13877
|
} else {
|
|
13860
13878
|
console.log(dim(" Skipping Claude. You can configure it later in ~/.cc-claw/.env"));
|
|
13861
13879
|
}
|
|
@@ -13896,13 +13914,20 @@ async function setup() {
|
|
|
13896
13914
|
"",
|
|
13897
13915
|
"# Telegram",
|
|
13898
13916
|
`TELEGRAM_BOT_TOKEN=${env.TELEGRAM_BOT_TOKEN ?? ""}`,
|
|
13899
|
-
`ALLOWED_CHAT_ID=${env.ALLOWED_CHAT_ID ?? ""}
|
|
13900
|
-
"",
|
|
13901
|
-
"# Vertex AI",
|
|
13902
|
-
`CLAUDE_CODE_USE_VERTEX=${env.CLAUDE_CODE_USE_VERTEX ?? "1"}`,
|
|
13903
|
-
`CLOUD_ML_REGION=${env.CLOUD_ML_REGION ?? "global"}`,
|
|
13904
|
-
`ANTHROPIC_VERTEX_PROJECT_ID=${env.ANTHROPIC_VERTEX_PROJECT_ID ?? ""}`
|
|
13917
|
+
`ALLOWED_CHAT_ID=${env.ALLOWED_CHAT_ID ?? ""}`
|
|
13905
13918
|
];
|
|
13919
|
+
if (env.ANTHROPIC_API_KEY) {
|
|
13920
|
+
envLines.push("", "# Claude (API key)", `ANTHROPIC_API_KEY=${env.ANTHROPIC_API_KEY}`);
|
|
13921
|
+
}
|
|
13922
|
+
if (env.CLAUDE_CODE_USE_VERTEX === "1") {
|
|
13923
|
+
envLines.push(
|
|
13924
|
+
"",
|
|
13925
|
+
"# Claude (Vertex AI)",
|
|
13926
|
+
`CLAUDE_CODE_USE_VERTEX=1`,
|
|
13927
|
+
`CLOUD_ML_REGION=${env.CLOUD_ML_REGION ?? "global"}`,
|
|
13928
|
+
`ANTHROPIC_VERTEX_PROJECT_ID=${env.ANTHROPIC_VERTEX_PROJECT_ID ?? ""}`
|
|
13929
|
+
);
|
|
13930
|
+
}
|
|
13906
13931
|
if (env.GROQ_API_KEY) {
|
|
13907
13932
|
envLines.push("", "# Voice", `GROQ_API_KEY=${env.GROQ_API_KEY}`);
|
|
13908
13933
|
if (env.ELEVENLABS_API_KEY) {
|
package/package.json
CHANGED