debatr 0.1.0__tar.gz
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.
- debatr-0.1.0/.gitignore +64 -0
- debatr-0.1.0/LICENSE +21 -0
- debatr-0.1.0/PKG-INFO +218 -0
- debatr-0.1.0/README.md +185 -0
- debatr-0.1.0/pyproject.toml +77 -0
- debatr-0.1.0/src/debatr/__init__.py +3 -0
- debatr-0.1.0/src/debatr/__main__.py +3 -0
- debatr-0.1.0/src/debatr/api.py +310 -0
- debatr-0.1.0/src/debatr/cli.py +1097 -0
- debatr-0.1.0/src/debatr/config.py +136 -0
- debatr-0.1.0/src/debatr/debate.py +365 -0
- debatr-0.1.0/src/debatr/markers.py +58 -0
- debatr-0.1.0/src/debatr/mcp_server.py +568 -0
- debatr-0.1.0/src/debatr/py.typed +0 -0
- debatr-0.1.0/src/debatr/render.py +443 -0
- debatr-0.1.0/src/debatr/styling.py +97 -0
- debatr-0.1.0/tests/conftest.py +216 -0
- debatr-0.1.0/tests/test_api.py +121 -0
- debatr-0.1.0/tests/test_cli.py +393 -0
- debatr-0.1.0/tests/test_config.py +74 -0
- debatr-0.1.0/tests/test_debate.py +136 -0
- debatr-0.1.0/tests/test_markers.py +65 -0
- debatr-0.1.0/tests/test_mcp.py +204 -0
- debatr-0.1.0/tests/test_styling.py +55 -0
debatr-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# System
|
|
2
|
+
.DS_Store
|
|
3
|
+
Thumbs.db
|
|
4
|
+
|
|
5
|
+
# Environment
|
|
6
|
+
.env
|
|
7
|
+
.env.local
|
|
8
|
+
.venv
|
|
9
|
+
venv/
|
|
10
|
+
env/
|
|
11
|
+
|
|
12
|
+
# Editor
|
|
13
|
+
.vscode/
|
|
14
|
+
.idea/
|
|
15
|
+
*.swp
|
|
16
|
+
*.swo
|
|
17
|
+
|
|
18
|
+
# Docker
|
|
19
|
+
docker-compose.override.yml
|
|
20
|
+
|
|
21
|
+
# Generated audio/timeline files (backend MEDIA_ROOT)
|
|
22
|
+
/backend/media/
|
|
23
|
+
/media/
|
|
24
|
+
|
|
25
|
+
# Python
|
|
26
|
+
__pycache__/
|
|
27
|
+
*.py[cod]
|
|
28
|
+
*$py.class
|
|
29
|
+
*.so
|
|
30
|
+
.Python
|
|
31
|
+
build/
|
|
32
|
+
develop-eggs/
|
|
33
|
+
dist/
|
|
34
|
+
downloads/
|
|
35
|
+
eggs/
|
|
36
|
+
.eggs/
|
|
37
|
+
lib/
|
|
38
|
+
!frontend/src/lib/
|
|
39
|
+
lib64/
|
|
40
|
+
parts/
|
|
41
|
+
sdist/
|
|
42
|
+
var/
|
|
43
|
+
wheels/
|
|
44
|
+
share/python-wheels/
|
|
45
|
+
*.egg-info/
|
|
46
|
+
.installed.cfg
|
|
47
|
+
*.egg
|
|
48
|
+
MANIFEST
|
|
49
|
+
|
|
50
|
+
# Node
|
|
51
|
+
node_modules/
|
|
52
|
+
npm-debug.log
|
|
53
|
+
yarn-error.log
|
|
54
|
+
|
|
55
|
+
# Tooling caches
|
|
56
|
+
.ruff_cache/
|
|
57
|
+
.pytest_cache/
|
|
58
|
+
*.tsbuildinfo
|
|
59
|
+
|
|
60
|
+
# Standalone media demo (not part of the app)
|
|
61
|
+
demo/
|
|
62
|
+
|
|
63
|
+
# Private planning notes (public roadmap lives in README.md)
|
|
64
|
+
PROGRESS.md
|
debatr-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Khoren Markosyan
|
|
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.
|
debatr-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: debatr
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Run AI debates from your terminal and give AI agents a debate tool (MCP): the command-line client for Debatr.
|
|
5
|
+
Project-URL: Homepage, https://ai-debates.net
|
|
6
|
+
Project-URL: Documentation, https://github.com/khoren93/debatr/tree/main/cli#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/khoren93/debatr
|
|
8
|
+
Project-URL: Issues, https://github.com/khoren93/debatr/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/khoren93/debatr/blob/main/CHANGELOG.md
|
|
10
|
+
Author: Khoren Markosyan
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: agents,ai,cli,debate,llm,mcp,openrouter
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
26
|
+
Classifier: Typing :: Typed
|
|
27
|
+
Requires-Python: >=3.10
|
|
28
|
+
Requires-Dist: httpx<1,>=0.28.1
|
|
29
|
+
Requires-Dist: mcp<3,>=2.3
|
|
30
|
+
Requires-Dist: rich>=14
|
|
31
|
+
Requires-Dist: typer<1,>=0.27
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# debatr
|
|
35
|
+
|
|
36
|
+
**Run AI debates from your terminal, and give AI agents a debate tool over MCP.**
|
|
37
|
+
|
|
38
|
+
`debatr` is the command-line client for [Debatr](https://ai-debates.net), the AI debate studio:
|
|
39
|
+
pick a question and the models, watch them argue live in your terminal and get the judge's
|
|
40
|
+
verdict. The same package is an [MCP](https://modelcontextprotocol.io) server, so Claude, Cursor
|
|
41
|
+
and other agents can stage a debate to stress-test a decision or see both sides of a question.
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
$ debatr run "Should cities ban cars from their centres?" -d anthropic/claude-sonnet-4.5 -d openai/gpt-5
|
|
45
|
+
|
|
46
|
+
● The Host HOST · openrouter/free
|
|
47
|
+
Welcome! Today two models take on car-free city centres…
|
|
48
|
+
|
|
49
|
+
● Nova PRO · anthropic/claude-sonnet-4.5
|
|
50
|
+
Cities belong to people, not parked metal…
|
|
51
|
+
|
|
52
|
+
● Atlas CON · openai/gpt-5
|
|
53
|
+
A ban hits the people with the fewest alternatives first…
|
|
54
|
+
|
|
55
|
+
╭─ ⚖ The judge's verdict ─────────────────────────────╮
|
|
56
|
+
│ Winner: Nova │
|
|
57
|
+
│ Nova grounded every claim in what cities measured. │
|
|
58
|
+
╰─────────────────────────────────────────────────────╯
|
|
59
|
+
✓ Completed · 7 turns · provider cost $0.0213
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Install
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
uv tool install debatr # or: pipx install debatr
|
|
66
|
+
debatr --help
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
No install needed for a one-off: `uvx debatr run "Tabs or spaces?"`. Python 3.10+ is required
|
|
70
|
+
(uv fetches one if you have none).
|
|
71
|
+
|
|
72
|
+
## Sign in
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
debatr login
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
This opens Debatr in your browser and asks you to confirm a code (like `gh auth login`). You can
|
|
79
|
+
give this computer a spending limit there. The token is saved in `~/.config/debatr/config.json`
|
|
80
|
+
(readable only by you) and can be revoked at any time under **Account → API tokens** on the
|
|
81
|
+
website, or with `debatr logout`.
|
|
82
|
+
|
|
83
|
+
For CI and scripts, create a token under **Account → API tokens** and pass it in the
|
|
84
|
+
environment:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
export DEBATR_TOKEN=debatr_…
|
|
88
|
+
debatr whoami
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
A token acts as you for debates and spending, but can never change your password, keys or
|
|
92
|
+
payments, or create other tokens.
|
|
93
|
+
|
|
94
|
+
## Run a debate
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
debatr run "Is remote work better for juniors?" # two free models
|
|
98
|
+
debatr run "Nuclear or renewables?" \
|
|
99
|
+
-d anthropic/claude-sonnet-4.5 -n Ada -s "A nuclear engineer" \
|
|
100
|
+
-d google/gemini-2.5-pro -n Ben -s "A grid operator who favours renewables" \
|
|
101
|
+
--rounds 3 --length medium
|
|
102
|
+
debatr run "Should we rewrite it in Rust?" --context "A 40k-line Go service, team of 4" --json
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
| Option | What it does |
|
|
106
|
+
|---|---|
|
|
107
|
+
| `-d, --debater MODEL` | A debater's model; repeat for each (1–7). Default: `openrouter/free` twice. |
|
|
108
|
+
| `-n, --name` / `-s, --stance` | Names and personas, in the order of `-d`. By default the first argues for, the second against. |
|
|
109
|
+
| `--host MODEL` / `--no-host` | The host opens each round and judges (default `openrouter/free`). |
|
|
110
|
+
| `-r, --rounds`, `-l, --length` | 1–10 rounds; turns `very_short`, `short`, `medium` or `long`. |
|
|
111
|
+
| `--language`, `--intensity`, `--style` | Debate language, 1 calm … 10 fierce, `markdown` or `spoken`. |
|
|
112
|
+
| `-c, --context TEXT` | Background the speakers should know. |
|
|
113
|
+
| `--scenes`, `--fact-check` | Design charts and schemes for the web page; web fact-check of the figures (paid). |
|
|
114
|
+
| `--audio`, `--voices` | Voice it when done (free `edge` voices or premium `elevenlabs`). |
|
|
115
|
+
| `--public` | Publish to the gallery when finished (after an automatic content check). Private by default. |
|
|
116
|
+
| `-y, --yes`, `--max-cost USD` | Start paid runs without a prompt; refuse runs estimated above a limit. |
|
|
117
|
+
| `--detach`, `--json` | Print the id and return at once; or no live output, a JSON result at the end. |
|
|
118
|
+
| `--config FILE`, `--print-config` | Use a full request body; print the one the options make. |
|
|
119
|
+
|
|
120
|
+
Every run is estimated first. Free models cost nothing; paid models are charged to your Debatr
|
|
121
|
+
credits (or to your own OpenRouter key: set `DEBATR_OPENROUTER_KEY`). Without a terminal (CI,
|
|
122
|
+
agents), a paid run needs `--yes` or `--max-cost`. Press Ctrl+C to stop following a debate: you
|
|
123
|
+
are asked whether to stop it on the server too.
|
|
124
|
+
|
|
125
|
+
## More commands
|
|
126
|
+
|
|
127
|
+
| Command | What it does |
|
|
128
|
+
|---|---|
|
|
129
|
+
| `debatr models [WORDS] [--free]` | Models you can cast, newest first, with prices per million tokens. |
|
|
130
|
+
| `debatr watch DEBATE` | Follow a running debate live, or replay a finished one. |
|
|
131
|
+
| `debatr show DEBATE [-f text\|markdown\|json] [-o FILE]` | Transcript and verdict; export as Markdown or JSON. |
|
|
132
|
+
| `debatr list [WORDS] [--status S]` | Your debates. |
|
|
133
|
+
| `debatr stop` / `delete` / `publish` / `unpublish DEBATE` | Manage a debate. |
|
|
134
|
+
| `debatr open DEBATE` | Open it in the browser: player, audience vote, video export. |
|
|
135
|
+
| `debatr audio DEBATE [--build] [-o FILE]` | Download the voiced debate as MP3 (`--build` voices it first). |
|
|
136
|
+
| `debatr gallery [WORDS] [--sort trending\|new\|top]` | Browse public debates. |
|
|
137
|
+
| `debatr leaderboard [--free]` | Models ranked by audience votes. |
|
|
138
|
+
| `debatr whoami` / `logout` | The account, balance and token; sign out and revoke the token. |
|
|
139
|
+
|
|
140
|
+
`DEBATE` is an id, a link (`…/debate/<id>`, `…/d/<slug>`) or a share slug. Commands that print
|
|
141
|
+
data accept `--json`. Exit codes: `0` success, `1` an error or a debate that did not complete,
|
|
142
|
+
`130` interrupted.
|
|
143
|
+
|
|
144
|
+
## For AI agents (MCP)
|
|
145
|
+
|
|
146
|
+
`debatr mcp` runs an MCP server on stdio. Sign in once with `debatr login` (or pass
|
|
147
|
+
`DEBATR_TOKEN`), then add it to your agent:
|
|
148
|
+
|
|
149
|
+
**Claude Code**
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
claude mcp add debatr --scope user -- uvx debatr mcp
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Claude Desktop, Cursor, Windsurf and other clients** (`mcpServers` in their config file):
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"mcpServers": {
|
|
160
|
+
"debatr": {
|
|
161
|
+
"command": "uvx",
|
|
162
|
+
"args": ["debatr", "mcp"],
|
|
163
|
+
"env": { "DEBATR_MAX_COST_USD": "0.50" }
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Desktop apps do not always see your shell's `PATH`: if `uvx` is not found, use its full path
|
|
170
|
+
(`which uvx`). Add `"DEBATR_TOKEN": "debatr_…"` to `env` to use a dedicated token instead of
|
|
171
|
+
your `debatr login`.
|
|
172
|
+
|
|
173
|
+
| Tool | What it does |
|
|
174
|
+
|---|---|
|
|
175
|
+
| `start_debate` | Starts a debate and returns its id at once (a debate takes 1–5 minutes). |
|
|
176
|
+
| `get_debate` | Status, progress, verdict and transcript; `wait_seconds` waits for the end and reports progress per turn. |
|
|
177
|
+
| `estimate_debate` | Price and length before starting. |
|
|
178
|
+
| `list_models`, `get_leaderboard` | Models to cast, and how audiences rank them. |
|
|
179
|
+
| `list_my_debates`, `search_gallery` | The user's debates; public debates to read. |
|
|
180
|
+
| `stop_debate`, `publish_debate`, `get_account` | Manage a debate; balance and the token's limit. |
|
|
181
|
+
|
|
182
|
+
Agents spend your credits only within two limits: the token's own spending limit (set it when
|
|
183
|
+
you approve `debatr login` or create the token) and `DEBATR_MAX_COST_USD`, the most one debate
|
|
184
|
+
may cost through this server (default `1.00`). Debates started by agents are private unless they
|
|
185
|
+
ask to publish them.
|
|
186
|
+
|
|
187
|
+
## Configuration
|
|
188
|
+
|
|
189
|
+
| Variable | Meaning |
|
|
190
|
+
|---|---|
|
|
191
|
+
| `DEBATR_URL` | Server to use (default: the one you signed in to, else `https://ai-debates.net`). Same as `--url`. |
|
|
192
|
+
| `DEBATR_TOKEN` | API token; takes precedence over `debatr login`. |
|
|
193
|
+
| `DEBATR_OPENROUTER_KEY` | Your OpenRouter key: models run on your account instead of your credits. Never stored by Debatr. |
|
|
194
|
+
| `DEBATR_ELEVENLABS_KEY` | Your ElevenLabs key for `--voices elevenlabs`. |
|
|
195
|
+
| `DEBATR_MAX_COST_USD` | MCP server: the most one debate may cost (default `1.00`). |
|
|
196
|
+
| `DEBATR_CONFIG_DIR` | Where logins are saved (default `~/.config/debatr`, `%APPDATA%\debatr` on Windows). |
|
|
197
|
+
|
|
198
|
+
**Self-hosted Debatr**: point the CLI at your server with `--url` (or `DEBATR_URL`), e.g.
|
|
199
|
+
`debatr --url http://localhost login`. Logins are kept per server.
|
|
200
|
+
|
|
201
|
+
## Development
|
|
202
|
+
|
|
203
|
+
The package lives in the [`cli/`](https://github.com/khoren93/debatr/tree/main/cli) folder of the
|
|
204
|
+
Debatr repository and only uses the public REST API (`/api/docs` on any Debatr server).
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
cd cli
|
|
208
|
+
uv sync
|
|
209
|
+
uv run debatr --url http://localhost --help
|
|
210
|
+
uv run pytest -q && uv run ruff check . && uv run pyright
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Releases are published to PyPI by GitHub Actions when a `cli-vX.Y.Z` tag is pushed (the version
|
|
214
|
+
lives in `src/debatr/__init__.py`).
|
|
215
|
+
|
|
216
|
+
## License
|
|
217
|
+
|
|
218
|
+
MIT
|
debatr-0.1.0/README.md
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# debatr
|
|
2
|
+
|
|
3
|
+
**Run AI debates from your terminal, and give AI agents a debate tool over MCP.**
|
|
4
|
+
|
|
5
|
+
`debatr` is the command-line client for [Debatr](https://ai-debates.net), the AI debate studio:
|
|
6
|
+
pick a question and the models, watch them argue live in your terminal and get the judge's
|
|
7
|
+
verdict. The same package is an [MCP](https://modelcontextprotocol.io) server, so Claude, Cursor
|
|
8
|
+
and other agents can stage a debate to stress-test a decision or see both sides of a question.
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
$ debatr run "Should cities ban cars from their centres?" -d anthropic/claude-sonnet-4.5 -d openai/gpt-5
|
|
12
|
+
|
|
13
|
+
● The Host HOST · openrouter/free
|
|
14
|
+
Welcome! Today two models take on car-free city centres…
|
|
15
|
+
|
|
16
|
+
● Nova PRO · anthropic/claude-sonnet-4.5
|
|
17
|
+
Cities belong to people, not parked metal…
|
|
18
|
+
|
|
19
|
+
● Atlas CON · openai/gpt-5
|
|
20
|
+
A ban hits the people with the fewest alternatives first…
|
|
21
|
+
|
|
22
|
+
╭─ ⚖ The judge's verdict ─────────────────────────────╮
|
|
23
|
+
│ Winner: Nova │
|
|
24
|
+
│ Nova grounded every claim in what cities measured. │
|
|
25
|
+
╰─────────────────────────────────────────────────────╯
|
|
26
|
+
✓ Completed · 7 turns · provider cost $0.0213
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
uv tool install debatr # or: pipx install debatr
|
|
33
|
+
debatr --help
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
No install needed for a one-off: `uvx debatr run "Tabs or spaces?"`. Python 3.10+ is required
|
|
37
|
+
(uv fetches one if you have none).
|
|
38
|
+
|
|
39
|
+
## Sign in
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
debatr login
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This opens Debatr in your browser and asks you to confirm a code (like `gh auth login`). You can
|
|
46
|
+
give this computer a spending limit there. The token is saved in `~/.config/debatr/config.json`
|
|
47
|
+
(readable only by you) and can be revoked at any time under **Account → API tokens** on the
|
|
48
|
+
website, or with `debatr logout`.
|
|
49
|
+
|
|
50
|
+
For CI and scripts, create a token under **Account → API tokens** and pass it in the
|
|
51
|
+
environment:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
export DEBATR_TOKEN=debatr_…
|
|
55
|
+
debatr whoami
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
A token acts as you for debates and spending, but can never change your password, keys or
|
|
59
|
+
payments, or create other tokens.
|
|
60
|
+
|
|
61
|
+
## Run a debate
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
debatr run "Is remote work better for juniors?" # two free models
|
|
65
|
+
debatr run "Nuclear or renewables?" \
|
|
66
|
+
-d anthropic/claude-sonnet-4.5 -n Ada -s "A nuclear engineer" \
|
|
67
|
+
-d google/gemini-2.5-pro -n Ben -s "A grid operator who favours renewables" \
|
|
68
|
+
--rounds 3 --length medium
|
|
69
|
+
debatr run "Should we rewrite it in Rust?" --context "A 40k-line Go service, team of 4" --json
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
| Option | What it does |
|
|
73
|
+
|---|---|
|
|
74
|
+
| `-d, --debater MODEL` | A debater's model; repeat for each (1–7). Default: `openrouter/free` twice. |
|
|
75
|
+
| `-n, --name` / `-s, --stance` | Names and personas, in the order of `-d`. By default the first argues for, the second against. |
|
|
76
|
+
| `--host MODEL` / `--no-host` | The host opens each round and judges (default `openrouter/free`). |
|
|
77
|
+
| `-r, --rounds`, `-l, --length` | 1–10 rounds; turns `very_short`, `short`, `medium` or `long`. |
|
|
78
|
+
| `--language`, `--intensity`, `--style` | Debate language, 1 calm … 10 fierce, `markdown` or `spoken`. |
|
|
79
|
+
| `-c, --context TEXT` | Background the speakers should know. |
|
|
80
|
+
| `--scenes`, `--fact-check` | Design charts and schemes for the web page; web fact-check of the figures (paid). |
|
|
81
|
+
| `--audio`, `--voices` | Voice it when done (free `edge` voices or premium `elevenlabs`). |
|
|
82
|
+
| `--public` | Publish to the gallery when finished (after an automatic content check). Private by default. |
|
|
83
|
+
| `-y, --yes`, `--max-cost USD` | Start paid runs without a prompt; refuse runs estimated above a limit. |
|
|
84
|
+
| `--detach`, `--json` | Print the id and return at once; or no live output, a JSON result at the end. |
|
|
85
|
+
| `--config FILE`, `--print-config` | Use a full request body; print the one the options make. |
|
|
86
|
+
|
|
87
|
+
Every run is estimated first. Free models cost nothing; paid models are charged to your Debatr
|
|
88
|
+
credits (or to your own OpenRouter key: set `DEBATR_OPENROUTER_KEY`). Without a terminal (CI,
|
|
89
|
+
agents), a paid run needs `--yes` or `--max-cost`. Press Ctrl+C to stop following a debate: you
|
|
90
|
+
are asked whether to stop it on the server too.
|
|
91
|
+
|
|
92
|
+
## More commands
|
|
93
|
+
|
|
94
|
+
| Command | What it does |
|
|
95
|
+
|---|---|
|
|
96
|
+
| `debatr models [WORDS] [--free]` | Models you can cast, newest first, with prices per million tokens. |
|
|
97
|
+
| `debatr watch DEBATE` | Follow a running debate live, or replay a finished one. |
|
|
98
|
+
| `debatr show DEBATE [-f text\|markdown\|json] [-o FILE]` | Transcript and verdict; export as Markdown or JSON. |
|
|
99
|
+
| `debatr list [WORDS] [--status S]` | Your debates. |
|
|
100
|
+
| `debatr stop` / `delete` / `publish` / `unpublish DEBATE` | Manage a debate. |
|
|
101
|
+
| `debatr open DEBATE` | Open it in the browser: player, audience vote, video export. |
|
|
102
|
+
| `debatr audio DEBATE [--build] [-o FILE]` | Download the voiced debate as MP3 (`--build` voices it first). |
|
|
103
|
+
| `debatr gallery [WORDS] [--sort trending\|new\|top]` | Browse public debates. |
|
|
104
|
+
| `debatr leaderboard [--free]` | Models ranked by audience votes. |
|
|
105
|
+
| `debatr whoami` / `logout` | The account, balance and token; sign out and revoke the token. |
|
|
106
|
+
|
|
107
|
+
`DEBATE` is an id, a link (`…/debate/<id>`, `…/d/<slug>`) or a share slug. Commands that print
|
|
108
|
+
data accept `--json`. Exit codes: `0` success, `1` an error or a debate that did not complete,
|
|
109
|
+
`130` interrupted.
|
|
110
|
+
|
|
111
|
+
## For AI agents (MCP)
|
|
112
|
+
|
|
113
|
+
`debatr mcp` runs an MCP server on stdio. Sign in once with `debatr login` (or pass
|
|
114
|
+
`DEBATR_TOKEN`), then add it to your agent:
|
|
115
|
+
|
|
116
|
+
**Claude Code**
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
claude mcp add debatr --scope user -- uvx debatr mcp
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Claude Desktop, Cursor, Windsurf and other clients** (`mcpServers` in their config file):
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"mcpServers": {
|
|
127
|
+
"debatr": {
|
|
128
|
+
"command": "uvx",
|
|
129
|
+
"args": ["debatr", "mcp"],
|
|
130
|
+
"env": { "DEBATR_MAX_COST_USD": "0.50" }
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Desktop apps do not always see your shell's `PATH`: if `uvx` is not found, use its full path
|
|
137
|
+
(`which uvx`). Add `"DEBATR_TOKEN": "debatr_…"` to `env` to use a dedicated token instead of
|
|
138
|
+
your `debatr login`.
|
|
139
|
+
|
|
140
|
+
| Tool | What it does |
|
|
141
|
+
|---|---|
|
|
142
|
+
| `start_debate` | Starts a debate and returns its id at once (a debate takes 1–5 minutes). |
|
|
143
|
+
| `get_debate` | Status, progress, verdict and transcript; `wait_seconds` waits for the end and reports progress per turn. |
|
|
144
|
+
| `estimate_debate` | Price and length before starting. |
|
|
145
|
+
| `list_models`, `get_leaderboard` | Models to cast, and how audiences rank them. |
|
|
146
|
+
| `list_my_debates`, `search_gallery` | The user's debates; public debates to read. |
|
|
147
|
+
| `stop_debate`, `publish_debate`, `get_account` | Manage a debate; balance and the token's limit. |
|
|
148
|
+
|
|
149
|
+
Agents spend your credits only within two limits: the token's own spending limit (set it when
|
|
150
|
+
you approve `debatr login` or create the token) and `DEBATR_MAX_COST_USD`, the most one debate
|
|
151
|
+
may cost through this server (default `1.00`). Debates started by agents are private unless they
|
|
152
|
+
ask to publish them.
|
|
153
|
+
|
|
154
|
+
## Configuration
|
|
155
|
+
|
|
156
|
+
| Variable | Meaning |
|
|
157
|
+
|---|---|
|
|
158
|
+
| `DEBATR_URL` | Server to use (default: the one you signed in to, else `https://ai-debates.net`). Same as `--url`. |
|
|
159
|
+
| `DEBATR_TOKEN` | API token; takes precedence over `debatr login`. |
|
|
160
|
+
| `DEBATR_OPENROUTER_KEY` | Your OpenRouter key: models run on your account instead of your credits. Never stored by Debatr. |
|
|
161
|
+
| `DEBATR_ELEVENLABS_KEY` | Your ElevenLabs key for `--voices elevenlabs`. |
|
|
162
|
+
| `DEBATR_MAX_COST_USD` | MCP server: the most one debate may cost (default `1.00`). |
|
|
163
|
+
| `DEBATR_CONFIG_DIR` | Where logins are saved (default `~/.config/debatr`, `%APPDATA%\debatr` on Windows). |
|
|
164
|
+
|
|
165
|
+
**Self-hosted Debatr**: point the CLI at your server with `--url` (or `DEBATR_URL`), e.g.
|
|
166
|
+
`debatr --url http://localhost login`. Logins are kept per server.
|
|
167
|
+
|
|
168
|
+
## Development
|
|
169
|
+
|
|
170
|
+
The package lives in the [`cli/`](https://github.com/khoren93/debatr/tree/main/cli) folder of the
|
|
171
|
+
Debatr repository and only uses the public REST API (`/api/docs` on any Debatr server).
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
cd cli
|
|
175
|
+
uv sync
|
|
176
|
+
uv run debatr --url http://localhost --help
|
|
177
|
+
uv run pytest -q && uv run ruff check . && uv run pyright
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Releases are published to PyPI by GitHub Actions when a `cli-vX.Y.Z` tag is pushed (the version
|
|
181
|
+
lives in `src/debatr/__init__.py`).
|
|
182
|
+
|
|
183
|
+
## License
|
|
184
|
+
|
|
185
|
+
MIT
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "debatr"
|
|
3
|
+
dynamic = ["version"]
|
|
4
|
+
description = "Run AI debates from your terminal and give AI agents a debate tool (MCP): the command-line client for Debatr."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
authors = [{ name = "Khoren Markosyan" }]
|
|
10
|
+
keywords = ["ai", "llm", "debate", "openrouter", "mcp", "cli", "agents"]
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Development Status :: 4 - Beta",
|
|
13
|
+
"Environment :: Console",
|
|
14
|
+
"Intended Audience :: Developers",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
18
|
+
"Programming Language :: Python :: 3.10",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
22
|
+
"Programming Language :: Python :: 3.14",
|
|
23
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
24
|
+
"Typing :: Typed",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"httpx>=0.28.1,<1",
|
|
28
|
+
"typer>=0.27,<1",
|
|
29
|
+
"rich>=14",
|
|
30
|
+
"mcp>=2.3,<3",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Homepage = "https://ai-debates.net"
|
|
35
|
+
Documentation = "https://github.com/khoren93/debatr/tree/main/cli#readme"
|
|
36
|
+
Repository = "https://github.com/khoren93/debatr"
|
|
37
|
+
Issues = "https://github.com/khoren93/debatr/issues"
|
|
38
|
+
Changelog = "https://github.com/khoren93/debatr/blob/main/CHANGELOG.md"
|
|
39
|
+
|
|
40
|
+
[project.scripts]
|
|
41
|
+
debatr = "debatr.cli:main"
|
|
42
|
+
|
|
43
|
+
[build-system]
|
|
44
|
+
requires = ["hatchling>=1.27"]
|
|
45
|
+
build-backend = "hatchling.build"
|
|
46
|
+
|
|
47
|
+
[tool.hatch.version]
|
|
48
|
+
path = "src/debatr/__init__.py"
|
|
49
|
+
|
|
50
|
+
[tool.hatch.build.targets.sdist]
|
|
51
|
+
include = ["src/debatr", "tests", "README.md", "LICENSE"]
|
|
52
|
+
|
|
53
|
+
[dependency-groups]
|
|
54
|
+
dev = [
|
|
55
|
+
"pytest>=9.1.1",
|
|
56
|
+
"pytest-asyncio>=1.4.0",
|
|
57
|
+
"ruff>=0.17.1",
|
|
58
|
+
"pyright>=1.1.414",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[tool.ruff]
|
|
62
|
+
target-version = "py310"
|
|
63
|
+
line-length = 100
|
|
64
|
+
|
|
65
|
+
[tool.ruff.lint]
|
|
66
|
+
select = ["E", "F", "W", "I", "B", "UP", "ASYNC", "SIM", "RUF"]
|
|
67
|
+
ignore = [
|
|
68
|
+
"E501", # line length handled by the formatter
|
|
69
|
+
"B008", # typer.Option() in defaults
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
[tool.ruff.lint.isort]
|
|
73
|
+
known-first-party = ["debatr"]
|
|
74
|
+
|
|
75
|
+
[tool.pytest.ini_options]
|
|
76
|
+
testpaths = ["tests"]
|
|
77
|
+
asyncio_mode = "auto"
|