Skip to content

Commit a62a1b7

Browse files
abrichrclaude
andauthored
fix: add LICENSE and README for public release (#2)
Add MIT license file and comprehensive README.md with architecture overview, CLI reference, configuration docs, and Telegram bot commands. Update pyproject.toml to point readme to README.md file. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 06b088b commit a62a1b7

3 files changed

Lines changed: 109 additions & 1 deletion

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Richard Abrich / OpenAdapt AI
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# openadapt-crier
2+
3+
Event-driven social media approval bot with Telegram.
4+
5+
## How it works
6+
7+
Crier watches GitHub repositories for new commits, releases, and merged PRs. When activity is detected, it uses an LLM (Claude) to score how interesting the event is. Events that pass the interest threshold get platform-specific draft posts generated automatically. Drafts are sent to a Telegram bot for human review, where you can approve, edit, or reject them. On approval, posts are dispatched to Discord, Twitter/X, and LinkedIn via [openadapt-herald](https://github.com/OpenAdaptAI/openadapt-herald).
8+
9+
```
10+
GitHub Events ──> Watcher ──> Drafter (LLM) ──> Telegram Bot ──> Dispatcher ──> Herald ──> Social Platforms
11+
(commits, (polls (scores (approve, (posts to (publish) (Discord,
12+
releases, GitHub interest, edit, or selected Twitter,
13+
merged PRs) API) generates reject) platforms) LinkedIn)
14+
drafts)
15+
```
16+
17+
## Quick start
18+
19+
```bash
20+
pip install .
21+
22+
# Required env vars
23+
export CRIER_TELEGRAM_BOT_TOKEN="your-telegram-bot-token"
24+
export CRIER_TELEGRAM_OWNER_ID="your-telegram-user-id"
25+
export CRIER_REPOS="owner/repo1,owner/repo2"
26+
export ANTHROPIC_API_KEY="your-anthropic-key"
27+
28+
# Optional: platform credentials for posting
29+
export DISCORD_WEBHOOK_URL="..."
30+
export TWITTER_CONSUMER_KEY="..."
31+
export TWITTER_CONSUMER_SECRET="..."
32+
export TWITTER_ACCESS_TOKEN="..."
33+
export TWITTER_ACCESS_TOKEN_SECRET="..."
34+
export LINKEDIN_ACCESS_TOKEN="..."
35+
36+
# Start the bot
37+
crier run
38+
```
39+
40+
## CLI commands
41+
42+
| Command | Description |
43+
|---------|-------------|
44+
| `crier run` | Start the bot and watcher loop (runs forever) |
45+
| `crier status` | Show bot status and configuration summary |
46+
| `crier draft <owner/repo>` | Generate a one-shot draft for a repo (no Telegram, no posting) |
47+
| `crier drafts` | List recent drafts, with optional `--status` and `--platform` filters |
48+
| `crier history` | Show posting history |
49+
50+
## Configuration
51+
52+
All settings can be set via `CRIER_`-prefixed environment variables or a `.env` file:
53+
54+
| Variable | Description | Default |
55+
|----------|-------------|---------|
56+
| `CRIER_TELEGRAM_BOT_TOKEN` | Telegram bot token | (required) |
57+
| `CRIER_TELEGRAM_OWNER_ID` | Telegram user ID for approvals | (required) |
58+
| `CRIER_REPOS` | Comma-separated `owner/repo` list | (required) |
59+
| `CRIER_GITHUB_TOKEN` | GitHub API token (higher rate limits) | `$GH_TOKEN` |
60+
| `CRIER_ANTHROPIC_API_KEY` | Anthropic API key | `$ANTHROPIC_API_KEY` |
61+
| `CRIER_POLL_INTERVAL` | Seconds between polls | `60` |
62+
| `CRIER_INTEREST_THRESHOLD` | Minimum score (0-10) to generate drafts | `5.0` |
63+
| `CRIER_DRY_RUN` | Skip actual posting | `false` |
64+
65+
## Telegram bot commands
66+
67+
Once the bot is running, these commands are available in Telegram:
68+
69+
- `/start` -- Show help
70+
- `/status` -- Bot status and pending draft count
71+
- `/history` -- Recent posting history
72+
- `/draft <owner/repo>` -- Manually trigger a draft
73+
74+
Draft messages include inline buttons to **Approve**, **Edit**, or **Reject**, plus per-platform toggles (Twitter, Discord, LinkedIn).
75+
76+
## Tests
77+
78+
132 tests covering all modules:
79+
80+
```bash
81+
pip install ".[dev]"
82+
pytest
83+
```
84+
85+
## License
86+
87+
MIT -- see [LICENSE](LICENSE).

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66
name = "crier"
77
version = "0.1.0"
88
description = "Event-driven social media approval bot with Telegram"
9-
readme = { text = "Event-driven social media approval bot with Telegram", content-type = "text/plain" }
9+
readme = "README.md"
1010
license = "MIT"
1111
requires-python = ">=3.10"
1212
authors = [

0 commit comments

Comments
 (0)