Skip to content

Commit 4ad6791

Browse files
author
antx-code
committed
docs: add README and MIT license
1 parent 95f419b commit 4ad6791

2 files changed

Lines changed: 134 additions & 0 deletions

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 antx-code
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: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# openfeedback
2+
3+
Human-in-the-loop decision gate CLI for AI agents.
4+
5+
When an AI agent (Claude Code, Kiro, or any automation script) reaches a decision point that requires human approval, `openfeedback` sends a rich message to your IM (Telegram) with **Approve / Reject** buttons and waits for a response.
6+
7+
```
8+
Agent → openfeedback send → Telegram → Human clicks Approve/Reject
9+
← exit code + JSON ←
10+
```
11+
12+
## Install
13+
14+
```bash
15+
cargo install --path .
16+
```
17+
18+
## Quick Start
19+
20+
```bash
21+
# 1. Initialize config
22+
openfeedback init
23+
# Edit ~/.config/openfeedback/config.toml (or ~/Library/Application Support/openfeedback/config.toml on macOS)
24+
25+
# 2. Send a request
26+
openfeedback send --title "Deploy to prod?" --body "Release v2.0 with breaking changes"
27+
28+
# 3. Or use a markdown file
29+
openfeedback send --title "Review Plan" --body-file /tmp/plan.md --timeout 300
30+
```
31+
32+
## Exit Codes
33+
34+
| Code | Meaning |
35+
|------|---------|
36+
| 0 | Approved |
37+
| 1 | Rejected |
38+
| 2 | Timeout |
39+
40+
## Output
41+
42+
JSON to stdout for agent consumption:
43+
44+
```json
45+
{
46+
"decision": "approved",
47+
"user": "@username",
48+
"user_id": 123456789,
49+
"feedback": null,
50+
"timestamp": "2026-03-09T09:25:27Z",
51+
"request_title": "Deploy to prod?"
52+
}
53+
```
54+
55+
## Configuration
56+
57+
`~/.config/openfeedback/config.toml`:
58+
59+
```toml
60+
default_provider = "telegram"
61+
default_timeout = 3600
62+
# locale: "en" (default), "zh-CN", "zh-TW"
63+
locale = "en"
64+
65+
[telegram]
66+
bot_token = "YOUR_BOT_TOKEN"
67+
chat_id = 0
68+
# Only these user IDs can approve/reject. Empty = allow all.
69+
trusted_user_ids = []
70+
71+
[logging]
72+
# audit_file = "~/.local/share/openfeedback/audit.jsonl"
73+
```
74+
75+
### Telegram Setup
76+
77+
1. Create a bot via [@BotFather](https://t.me/BotFather)
78+
2. Send a message to your bot
79+
3. Get your `chat_id`:
80+
```bash
81+
curl -s "https://api.telegram.org/bot<TOKEN>/getUpdates" | jq '.result[0].message.chat.id'
82+
```
83+
4. Add `bot_token`, `chat_id`, and your user ID to `trusted_user_ids`
84+
85+
## Features
86+
87+
- **Single binary** - no runtime dependencies, no server needed
88+
- **Blocking CLI** - sends message, polls for response, exits with result
89+
- **Trusted users** - whitelist who can approve/reject
90+
- **Audit log** - every decision recorded to JSONL
91+
- **i18n** - English, Simplified Chinese, Traditional Chinese
92+
- **Provider trait** - extensible for Slack, Discord, etc.
93+
94+
## Use with AI Agents
95+
96+
```bash
97+
# In a shell script or agent hook
98+
result=$(openfeedback send --title "Proceed with PR?" --body-file /tmp/plan.md)
99+
exit_code=$?
100+
101+
if [ $exit_code -eq 0 ]; then
102+
echo "Approved, continuing..."
103+
elif [ $exit_code -eq 1 ]; then
104+
feedback=$(echo "$result" | jq -r '.feedback // empty')
105+
echo "Rejected: $feedback"
106+
else
107+
echo "Timeout, aborting"
108+
fi
109+
```
110+
111+
## License
112+
113+
[MIT](LICENSE)

0 commit comments

Comments
 (0)