Elffuss BraidHub

kikocis/clonagent public

main · 4.9 KiBRenderedRawPermalink
1<div align="center">
2
3<a href="https://clonagent.utopiaia.com">
4 <img src="docs/hero.png" alt="ClonAgent — Tell it what you need. Get it done. By email." width="100%" />
5</a>
6
7<br /><br />
8
9**[clonagent.utopiaia.com](https://clonagent.utopiaia.com)**
10
11Build AI agents that watch your inbox, act on requests, and reply — automatically.
12No code. No dashboard. Just send an email.
13
14[![Live](https://img.shields.io/badge/live-clonagent.utopiaia.com-7c5cff?style=flat-square)](https://clonagent.utopiaia.com)
15
16</div>
17
18---
19
20## What is ClonAgent?
21
22ClonAgent lets anyone create an AI agent that monitors an email inbox and acts on what it finds.
23
24You describe your agent in plain language — what project it manages, who can email it, how to deploy. ClonAgent builds it for you. From that moment on, your team manages the agent entirely by email:
25
26```
27→ Someone emails a bug report
28← The agent reads it, fixes the code, deploys, and replies with the result
29```
30
31**Supported workflows out of the box:**
32
33- Bug reports → auto-fix and deploy
34- Feature requests → code and merge
35- Content updates → edit, rebuild, publish
36- Data queries → run and reply with results
37- Anything a developer can do from a terminal
38
39---
40
41## Email commands
42
43Once an agent is running, manage it from any email client. You can either use shorthand commands or just write naturally — the agent understands plain language too.
44
45| Command | What it does |
46|---|---|
47| `!help` | List all available commands |
48| `!status` | Show agent config and last run |
49| `!add someone@company.com` | Authorize a new sender |
50| `!remove someone@company.com` | Revoke access |
51| `!pause` | Stop polling (agent sleeps) |
52| `!resume` | Resume polling |
53| `!senders` | List all authorized senders |
54
55You can also write requests in plain text and the agent will handle them just the same:
56
57> *"The checkout button on mobile is broken, can you fix it?"*
58> *"Add a dark mode toggle to the settings page."*
59> *"Send me a summary of all open issues."*
60
61---
62
63## Self-hosting
64
65### Requirements
66
67- Node.js 18+
68- Python 3.9+ (for the Gmail client)
69- An Anthropic API key (or a LiteLLM proxy)
70
71### Quickstart
72
73```bash
74git clone https://github.com/KikoCisBot/clonagent.git
75cd clonagent
76cp .env.example .env # fill in ANTHROPIC_API_KEY
77
78cd server && npm install && cd ..
79cd client && npm install && cd ..
80
81# Two terminals:
82( cd server && npm run dev ) # → http://localhost:3300
83( cd client && npm run dev ) # → http://localhost:3301
84```
85
86Open http://localhost:3301, register, and create your first agent from the chat.
87
88### Environment variables
89
90| Variable | Description |
91|---|---|
92| `ANTHROPIC_API_KEY` | Required if using Claude directly |
93| `LITELLM_URL` + `LITELLM_MASTER_KEY` | Alternative: route via LiteLLM |
94| `CLONAGENT_MODEL` | Model to use (default: `claude-opus-4-7`) |
95| `PUBLIC_URL` | Your public URL (for magic-link emails) |
96| `SMTP_HOST` / `SMTP_PORT` / `SMTP_USER` / `SMTP_PASS` | Transactional email |
97| `SENDGRID_API_KEY` | Alternative to SMTP |
98| `STRIPE_SECRET_KEY` | Stripe payments |
99| `STRIPE_PUBLISHABLE_KEY` | Stripe frontend |
100| `STRIPE_WEBHOOK_SECRET` | Stripe webhook verification |
101| `AUTH_MODE` | `none` / `basic` / `oidc` (default: `basic`) |
102
103See [.env.example](.env.example) for the full list.
104
105---
106
107## Architecture
108
109```
110Browser ──▶ client (Vite / React)
111 │
112 ▼
113 server (Express, port 3300)
114 ├── /api/chat ──▶ Anthropic / LiteLLM
115 ├── /api/agents ──▶ ~/.claude/skills/<id>/
116 ├── /api/auth ──▶ basic / magic-link / OIDC
117 ├── /api/billing ──▶ Stripe
118 └── gmail-poller ──▶ python3 gmail_client.py
119 │
120 ▼ launchAgent()
121 host-relay ──▶ Claude CLI session
122```
123
124Each agent is a Claude Code skill stored in `~/.claude/skills/<id>/` with its own inbox, authorized senders, and deploy target.
125
126---
127
128## Creating your first agent
129
1301. Open the app → **Chat**
1312. Describe your agent in plain English, for example:
132
133 > Create an agent for MIA bug reports. The bot email is `miabot@gmail.com`.
134 > Only `carlos@company.com` can send requests. Repo at `/home/ubuntu/MIA`,
135 > deploy via SSH to `my-server.com`.
136
1373. Drop your `credentials.json` (Gmail OAuth) into the generated skill folder.
1384. Run the OAuth flow once: `python3 gmail_client.py auth`
1395. Enable the agent from the **Agents** page. Polling starts immediately.
140
141---
142
143## Security
144
145- Passwords are bcrypt-hashed in `data/users.json` (never stored in plain text)
146- Magic-link tokens are single-use with a 15-minute expiry
147- Secrets (`credentials.json`, `token.json`) are never exposed via the API
148- Admin-only routes are protected server-side (settings, user management)
149- `.env` and `server/data/` are excluded from git
150