@inetafrica/open-claudia 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/.env.example +11 -0
- package/README.md +99 -0
- package/bin/cli.js +59 -0
- package/bot.js +871 -0
- package/crons.json +1 -0
- package/package.json +41 -0
- package/setup.js +344 -0
- package/soul.md +39 -0
- package/vault.js +140 -0
package/.env.example
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
TELEGRAM_BOT_TOKEN=your-bot-token-from-botfather
|
|
2
|
+
TELEGRAM_CHAT_ID=your-chat-id
|
|
3
|
+
WORKSPACE=/path/to/your/workspace
|
|
4
|
+
CLAUDE_PATH=/path/to/claude
|
|
5
|
+
WHISPER_CLI=
|
|
6
|
+
WHISPER_MODEL=
|
|
7
|
+
FFMPEG=
|
|
8
|
+
VAULT_FILE=vault.enc
|
|
9
|
+
SOUL_FILE=soul.md
|
|
10
|
+
CRONS_FILE=crons.json
|
|
11
|
+
ONBOARDED=false
|
package/README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Open Claudia
|
|
2
|
+
|
|
3
|
+
Your always-on AI coding assistant — Claude Code via Telegram.
|
|
4
|
+
|
|
5
|
+
Send text, voice notes, screenshots, and files from your phone. Claude Code works on your projects and reports back.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Multi-project sessions** — switch between workspace projects
|
|
10
|
+
- **Voice notes** — speak instructions, transcribed locally via Whisper
|
|
11
|
+
- **Screenshots** — send UI mockups, errors, or code screenshots
|
|
12
|
+
- **File sharing** — send and receive files directly in Telegram
|
|
13
|
+
- **Streaming output** — see Claude working in real-time
|
|
14
|
+
- **Cron jobs** — scheduled tasks (standups, git digests, health checks)
|
|
15
|
+
- **Encrypted vault** — store API keys and credentials securely
|
|
16
|
+
- **Customizable soul** — define your assistant's personality and knowledge
|
|
17
|
+
- **Model switching** — toggle between Opus, Sonnet, Haiku
|
|
18
|
+
- **Plan mode, effort levels, budgets** — full Claude Code control from Telegram
|
|
19
|
+
|
|
20
|
+
## Prerequisites
|
|
21
|
+
|
|
22
|
+
- [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated
|
|
23
|
+
- [Node.js](https://nodejs.org/) 18+
|
|
24
|
+
- A Telegram bot token (from [@BotFather](https://t.me/BotFather))
|
|
25
|
+
- (Optional) whisper-cpp + ffmpeg for voice notes
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# From npm package
|
|
31
|
+
npm install -g open-claudia
|
|
32
|
+
|
|
33
|
+
# Or from source
|
|
34
|
+
git clone https://git.coders.africa/agents/open-claudia.git
|
|
35
|
+
cd open-claudia
|
|
36
|
+
npm install
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Setup
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
open-claudia setup
|
|
43
|
+
# or: node setup.js
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The setup wizard will:
|
|
47
|
+
1. Detect Claude CLI and dependencies
|
|
48
|
+
2. Ask for your Telegram bot token and verify it
|
|
49
|
+
3. Auto-detect your chat ID
|
|
50
|
+
4. Set a vault password for credential encryption
|
|
51
|
+
5. Optionally install as a background service (macOS launchd / Linux systemd)
|
|
52
|
+
|
|
53
|
+
## Run
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
open-claudia start # Start the bot
|
|
57
|
+
open-claudia stop # Stop the bot
|
|
58
|
+
open-claudia status # Check if running
|
|
59
|
+
open-claudia logs # View recent logs
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Telegram Commands
|
|
63
|
+
|
|
64
|
+
| Command | Description |
|
|
65
|
+
|---------|-------------|
|
|
66
|
+
| `/session` | Pick a project to work on |
|
|
67
|
+
| `/projects` | Browse all workspace projects |
|
|
68
|
+
| `/model` | Switch model (opus/sonnet/haiku) |
|
|
69
|
+
| `/effort` | Set effort level |
|
|
70
|
+
| `/budget` | Set max spend per task |
|
|
71
|
+
| `/plan` | Toggle plan mode |
|
|
72
|
+
| `/continue` | Resume last conversation |
|
|
73
|
+
| `/cron` | Manage scheduled tasks |
|
|
74
|
+
| `/vault` | Manage credentials (password-protected) |
|
|
75
|
+
| `/soul` | View/edit assistant identity |
|
|
76
|
+
| `/stop` | Cancel running task |
|
|
77
|
+
| `/end` | End current session |
|
|
78
|
+
|
|
79
|
+
## How It Works
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
Phone (Telegram) → Bot (Node.js) → Claude Code CLI → Your codebase
|
|
83
|
+
← ← ←
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The bot spawns `claude -p` for each message, streaming output back to Telegram. It maintains conversation context via `--resume` and passes a system prompt that gives Claude awareness of the Telegram environment, its own configuration files, and the ability to send files/images directly.
|
|
87
|
+
|
|
88
|
+
## Configuration Files
|
|
89
|
+
|
|
90
|
+
| File | Purpose |
|
|
91
|
+
|------|---------|
|
|
92
|
+
| `.env` | Telegram token, paths, settings (created by setup) |
|
|
93
|
+
| `soul.md` | Assistant identity and personality (editable) |
|
|
94
|
+
| `crons.json` | Scheduled tasks |
|
|
95
|
+
| `vault.enc` | Encrypted credential store |
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
MIT
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execSync } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
const args = process.argv.slice(2);
|
|
7
|
+
const command = args[0] || "help";
|
|
8
|
+
|
|
9
|
+
const botDir = path.join(__dirname, "..");
|
|
10
|
+
|
|
11
|
+
switch (command) {
|
|
12
|
+
case "setup":
|
|
13
|
+
require(path.join(botDir, "setup.js"));
|
|
14
|
+
break;
|
|
15
|
+
|
|
16
|
+
case "start":
|
|
17
|
+
console.log("Starting Open Claudia...");
|
|
18
|
+
require(path.join(botDir, "bot.js"));
|
|
19
|
+
break;
|
|
20
|
+
|
|
21
|
+
case "stop":
|
|
22
|
+
try {
|
|
23
|
+
execSync('pkill -f "node.*bot.js"', { stdio: "inherit" });
|
|
24
|
+
console.log("Stopped.");
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.log("Not running.");
|
|
27
|
+
}
|
|
28
|
+
break;
|
|
29
|
+
|
|
30
|
+
case "logs":
|
|
31
|
+
const logFile = path.join(botDir, "bot.log");
|
|
32
|
+
try {
|
|
33
|
+
execSync(`tail -50 "${logFile}"`, { stdio: "inherit" });
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.log("No logs found.");
|
|
36
|
+
}
|
|
37
|
+
break;
|
|
38
|
+
|
|
39
|
+
case "status":
|
|
40
|
+
try {
|
|
41
|
+
execSync('pgrep -f "node.*bot.js"', { stdio: "pipe" });
|
|
42
|
+
console.log("Running.");
|
|
43
|
+
} catch (e) {
|
|
44
|
+
console.log("Not running.");
|
|
45
|
+
}
|
|
46
|
+
break;
|
|
47
|
+
|
|
48
|
+
default:
|
|
49
|
+
console.log(`
|
|
50
|
+
Open Claudia — AI Coding Assistant via Telegram
|
|
51
|
+
|
|
52
|
+
Commands:
|
|
53
|
+
open-claudia setup Interactive setup wizard
|
|
54
|
+
open-claudia start Start the bot
|
|
55
|
+
open-claudia stop Stop the bot
|
|
56
|
+
open-claudia status Check if running
|
|
57
|
+
open-claudia logs View recent logs
|
|
58
|
+
`);
|
|
59
|
+
}
|