botable-dev 0.3.1__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.
Files changed (38) hide show
  1. botable_dev-0.3.1/.github/workflows/ci.yml +31 -0
  2. botable_dev-0.3.1/.github/workflows/publish.yml +43 -0
  3. botable_dev-0.3.1/.gitignore +10 -0
  4. botable_dev-0.3.1/AGENTS.md +114 -0
  5. botable_dev-0.3.1/LICENSE +21 -0
  6. botable_dev-0.3.1/PKG-INFO +186 -0
  7. botable_dev-0.3.1/README.md +147 -0
  8. botable_dev-0.3.1/botable_mcp/__init__.py +3 -0
  9. botable_dev-0.3.1/botable_mcp/server.py +227 -0
  10. botable_dev-0.3.1/botable_status_bot/.env.example +4 -0
  11. botable_dev-0.3.1/botable_status_bot/.gitignore +5 -0
  12. botable_dev-0.3.1/botable_status_bot/Dockerfile +36 -0
  13. botable_dev-0.3.1/botable_status_bot/__init__.py +1 -0
  14. botable_dev-0.3.1/botable_status_bot/__main__.py +5 -0
  15. botable_dev-0.3.1/botable_status_bot/bot.py +150 -0
  16. botable_dev-0.3.1/botable_status_bot/collectors.py +424 -0
  17. botable_dev-0.3.1/botable_status_bot/config.py +42 -0
  18. botable_dev-0.3.1/botable_status_bot/formatters.py +316 -0
  19. botable_dev-0.3.1/botable_status_bot/requirements.txt +2 -0
  20. botable_dev-0.3.1/botable_status_bot/scheduler.py +71 -0
  21. botable_dev-0.3.1/botable_status_bot/setup.sh +25 -0
  22. botable_dev-0.3.1/pyproject.toml +66 -0
  23. botable_dev-0.3.1/src/botable/__init__.py +3 -0
  24. botable_dev-0.3.1/src/botable/__main__.py +5 -0
  25. botable_dev-0.3.1/src/botable/api_client.py +203 -0
  26. botable_dev-0.3.1/src/botable/cli.py +781 -0
  27. botable_dev-0.3.1/src/botable/config.py +193 -0
  28. botable_dev-0.3.1/src/botable/errors.py +53 -0
  29. botable_dev-0.3.1/src/botable/generate.py +288 -0
  30. botable_dev-0.3.1/src/botable/mcp_install.py +72 -0
  31. botable_dev-0.3.1/src/botable/prompts.py +137 -0
  32. botable_dev-0.3.1/src/botable/runner.py +333 -0
  33. botable_dev-0.3.1/src/botable/scaffold.py +104 -0
  34. botable_dev-0.3.1/src/botable/ui.py +48 -0
  35. botable_dev-0.3.1/tests/__init__.py +0 -0
  36. botable_dev-0.3.1/tests/test_cli_smoke.py +149 -0
  37. botable_dev-0.3.1/tests/test_login_mcp_install.py +294 -0
  38. botable_dev-0.3.1/tests/test_mcp_and_config.py +102 -0
@@ -0,0 +1,31 @@
1
+ name: CLI CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, stage]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ lint-and-test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.10", "3.11", "3.12"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install dependencies
25
+ run: pip install -e ".[dev]"
26
+
27
+ - name: Lint with ruff
28
+ run: ruff check src/
29
+
30
+ - name: Run tests
31
+ run: pytest tests/ -v --tb=short
@@ -0,0 +1,43 @@
1
+ name: Publish to PyPI
2
+
3
+ # Trusted Publishing (OIDC): PyPI trusts this workflow of Botable-dev/cli for the botable-dev project,
4
+ # so no API token is stored anywhere. A release is a pushed tag v<version> matching pyproject.toml.
5
+ on:
6
+ push:
7
+ tags:
8
+ - "v*"
9
+
10
+ jobs:
11
+ publish:
12
+ # GitHub-hosted minutes are exhausted for the org; pc-3060 is the org-level self-hosted runner (private repos only).
13
+ runs-on: [self-hosted, Linux, pc-3060]
14
+ permissions:
15
+ id-token: write
16
+ contents: read
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12"
25
+
26
+ - name: Check tag matches the package version
27
+ run: |
28
+ version=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
29
+ test "v${version}" = "${GITHUB_REF_NAME}" || { echo "tag ${GITHUB_REF_NAME} != v${version}"; exit 1; }
30
+
31
+ - name: Build package
32
+ run: |
33
+ python -m pip install --upgrade build twine
34
+ python -m build
35
+ python -m twine check dist/*
36
+
37
+ - name: Publish to PyPI
38
+ uses: pypa/gh-action-pypi-publish@release/v1
39
+
40
+ - name: Summary
41
+ run: |
42
+ echo "### Published botable-dev ${GITHUB_REF_NAME} to PyPI" >> "$GITHUB_STEP_SUMMARY"
43
+ echo '`pip install "botable-dev[mcp]"`' >> "$GITHUB_STEP_SUMMARY"
@@ -0,0 +1,10 @@
1
+ .venv/
2
+ venv/
3
+ __pycache__/
4
+ *.pyc
5
+ *.egg-info/
6
+ dist/
7
+ build/
8
+ .ruff_cache/
9
+ .pytest_cache/
10
+ dev_logs/
@@ -0,0 +1,114 @@
1
+ # AGENTS.md -- CLI
2
+
3
+ ## Update Rules
4
+
5
+ - **Owner**: cli repo (`Botable-dev/cli`)
6
+ - Update when: new CLI command added, status bot changed, config format changed
7
+ - Do NOT duplicate backend API details here -- those live in `backend/AGENTS.md`
8
+ - Max 150 lines. Every line must earn its place.
9
+
10
+ ---
11
+
12
+ ## Purpose
13
+
14
+ PyPI package **`botable`** (v0.2.0) -- Typer-based CLI for generating Telegram bots via the
15
+ Botable platform API. Also contains the **Telegram status bot** for staging server monitoring.
16
+ Stack: **Typer**, **Rich**, **httpx**, **OpenAI** (for local generation).
17
+
18
+ ---
19
+
20
+ ## Directory Map
21
+
22
+ ```
23
+ cli/
24
+ pyproject.toml # Package metadata, version, dependencies (hatchling build)
25
+ src/
26
+ botable/
27
+ __init__.py # __version__
28
+ __main__.py # `python -m botable` entry
29
+ cli.py # Typer app, all commands registered here
30
+ mcp_install.py # Claude/Codex MCP config registration
31
+ config.py # 3-layer config merge (defaults -> user -> project)
32
+ api_client.py # httpx client for backend API
33
+ generate.py # Bot generation logic (local + remote)
34
+ runner.py # Bot runner (start generated bot locally)
35
+ scaffold.py # Project scaffolding / init
36
+ prompts.py # Interactive prompts (Rich)
37
+ ui.py # Rich output helpers (banner, success, error, info)
38
+ errors.py # APIError from httpx responses
39
+ botable_status_bot/
40
+ __init__.py
41
+ __main__.py # `python -m botable_status_bot`
42
+ bot.py # aiogram Telegram bot -- /status, /health, /services
43
+ collectors.py # SSH + Docker data collectors
44
+ config.py # Bot token, SSH host, chat IDs
45
+ formatters.py # Rich-text formatting for Telegram messages
46
+ scheduler.py # Periodic health check scheduler
47
+ Dockerfile # Container for running on staging
48
+ requirements.txt # Bot-specific dependencies
49
+ setup.sh # Setup script for staging deployment
50
+ tests/ # pytest tests
51
+ botable_mcp/server.py # MCP tools backed by the CLI
52
+ dev_logs/ # Development notes
53
+ ```
54
+
55
+ ---
56
+
57
+ ## CLI Commands
58
+
59
+ Entry point: `botable = "botable.cli:app"` (defined in `pyproject.toml`).
60
+
61
+ | Command | Purpose |
62
+ |---------------------|----------------------------------------------|
63
+ | `botable generate` | Generate a bot from description (API or local)|
64
+ | `botable dev` | Run generated bot in dev mode |
65
+ | `botable deploy` | Deploy bot to server (`--json` for agents) |
66
+ | `botable logs` | Show bot status snapshot (`--json` supported) |
67
+ | `botable version` | Show version and effective API URL |
68
+ | `botable login` | Browser device login or `--api-key` |
69
+ | `botable mcp install` | Register Claude Code and/or Codex MCP |
70
+ | `botable bots` | List user's bots |
71
+ | `botable templates` | Browse available templates |
72
+ | `botable credits` | Check credit balance |
73
+
74
+ Auth token and optional API URL stored via `config.py` after browser login or `botable login --api-key YOUR_KEY --api-url URL`. `botable-mcp` runs the packaged MCP server.
75
+
76
+ ---
77
+
78
+ ## Status Bot
79
+
80
+ Standalone Telegram bot for monitoring the staging server. Lives in `botable_status_bot/`.
81
+
82
+ - **bot.py**: aiogram handlers -- `/status` (full report), `/health` (quick check), `/services` (Docker ps)
83
+ - **collectors.py**: SSH into staging VPS, runs `docker ps`, `docker stats`, disk/memory checks
84
+ - **formatters.py**: Formats collected data into Telegram-friendly HTML
85
+ - **scheduler.py**: Periodic polling (configurable interval), sends alerts on failures
86
+ - **Deployment**: Dockerfile, runs as a container on the staging VPS
87
+
88
+ Env vars for status bot: `BOT_TOKEN`, `CHAT_ID`, `SSH_HOST`, `SSH_KEY_PATH`.
89
+
90
+ ---
91
+
92
+ ## Configuration (3-Layer Merge)
93
+
94
+ Defined in `src/botable/config.py`:
95
+
96
+ 1. **Defaults** -- hardcoded in `config.py`
97
+ 2. **User config** -- `~/.config/botable/config.toml` (API key, preferred defaults)
98
+ 3. **Project config** -- `botable.toml` in project root (overrides per-project)
99
+
100
+ Later layers override earlier ones. Auth token and API URL are stored in the user config; `BOTABLE_API_URL` overrides the saved URL. Default API URL is `https://api-staging.botable.dev` (staging until the CLI routes reach production; `DEFAULT_API_URL` in `src/botable/config.py`).
101
+
102
+ ---
103
+
104
+ ## Publishing
105
+
106
+ - Build system: **hatchling**
107
+ - Publish: `python -m build && twine upload dist/*`
108
+ - Version: defined in `pyproject.toml` (`version = "0.2.0"`)
109
+ - PyPI: https://pypi.org/project/botable-dev/ (the name `botable` belongs to an unrelated package)
110
+ - Python: `>=3.10`
111
+
112
+ ---
113
+
114
+ > **Last reviewed**: October 18, 2026
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 HabLab LLP
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.
@@ -0,0 +1,186 @@
1
+ Metadata-Version: 2.5
2
+ Name: botable-dev
3
+ Version: 0.3.1
4
+ Summary: Botable CLI: build, deploy and run Telegram bots from your terminal, Claude Code or Codex
5
+ Project-URL: Homepage, https://botable.dev
6
+ Author-email: Botable Team <hello@botable.dev>
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Keywords: ai,aiogram,bot,chatbot,cli,generator,telegram
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Framework :: AsyncIO
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Communications :: Chat
20
+ Classifier: Topic :: Software Development :: Code Generators
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: httpx>=0.27
23
+ Requires-Dist: openai>=1.0
24
+ Requires-Dist: python-dotenv>=1.0
25
+ Requires-Dist: rich>=13.0
26
+ Requires-Dist: tomli-w>=1.0
27
+ Requires-Dist: tomli>=2.0; python_version < '3.11'
28
+ Requires-Dist: typer>=0.15
29
+ Provides-Extra: dev
30
+ Requires-Dist: build>=1.0; extra == 'dev'
31
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
32
+ Requires-Dist: pytest>=8.0; extra == 'dev'
33
+ Requires-Dist: ruff>=0.11; extra == 'dev'
34
+ Requires-Dist: twine>=6.0; extra == 'dev'
35
+ Requires-Dist: watchfiles>=1.0; extra == 'dev'
36
+ Provides-Extra: mcp
37
+ Requires-Dist: mcp<2,>=1.0; extra == 'mcp'
38
+ Description-Content-Type: text/markdown
39
+
40
+ # ⚡ Botable CLI
41
+
42
+ > **Generate Telegram bots with AI — from idea to running bot in 3 minutes.**
43
+
44
+ [![PyPI](https://img.shields.io/pypi/v/botable-dev?color=blue)](https://pypi.org/project/botable-dev/)
45
+ [![Python](https://img.shields.io/pypi/pyversions/botable-dev)](https://pypi.org/project/botable-dev/)
46
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
47
+
48
+ ## Quick Start
49
+
50
+ ```bash
51
+ pip install "botable-dev[mcp]"
52
+ botable login
53
+ botable mcp install
54
+
55
+ # Create a project
56
+ botable init my-bot
57
+ cd my-bot
58
+
59
+ # Add your keys to .env
60
+ echo "BOT_TOKEN=your-telegram-token" >> .env
61
+ echo "OPENAI_API_KEY=sk-..." >> .env
62
+
63
+ # Generate a bot from a description
64
+ botable generate "a FAQ bot for my restaurant with menu and hours"
65
+
66
+ # Run locally
67
+ botable dev
68
+ ```
69
+
70
+ **That's it.** Your bot is running in under 3 minutes.
71
+
72
+ ## Commands
73
+
74
+ ### Local Development
75
+
76
+ | Command | Description |
77
+ |---------|-------------|
78
+ | `botable init [name]` | Scaffold a new bot project |
79
+ | `botable generate "description"` | Generate bot from natural language |
80
+ | `botable dev` | Run bot locally with live output |
81
+ | `botable dev --watch` | Run with hot reload on file changes |
82
+ | `botable version` | Show CLI version and effective API URL |
83
+
84
+ ### Cloud Deployment
85
+
86
+ | Command | Description |
87
+ |---------|-------------|
88
+ | `botable login [--no-browser]` | Sign in through the browser |
89
+ | `botable login --api-key KEY [--api-url URL]` | Save an existing API key and API URL |
90
+ | `botable mcp install [--target claude\|codex\|all] [--scope user\|project]` | Configure agent MCP clients |
91
+ | `botable logout` | Remove stored authentication |
92
+ | `botable deploy` | Deploy to Botable cloud |
93
+ | `botable logs [project_id]` | Show the current bot status snapshot |
94
+ | `botable bots list` | List all deployed bots |
95
+ | `botable bots stop {id}` | Stop a running bot |
96
+
97
+ ## Deploy to Cloud
98
+
99
+ ```bash
100
+ botable login
101
+
102
+ # Deploy your bot
103
+ botable deploy
104
+
105
+ # Check status
106
+ botable bots list
107
+ botable logs
108
+ ```
109
+
110
+ ## Configuration
111
+
112
+ Botable uses a 3-layer config system:
113
+
114
+ | File | Scope | Purpose |
115
+ |------|-------|---------|
116
+ | `botable.toml` | Project | Bot name, template, branding (committed to git) |
117
+ | `.env` | Project | Secrets: BOT_TOKEN, API keys (NOT committed) |
118
+ | `~/.config/botable/config.toml` | User | Global defaults, auth token |
119
+
120
+ `botable login --api-url URL` saves the API URL. `BOTABLE_API_URL` overrides it for the current process; otherwise the default is `https://api-staging.botable.dev` (staging, until the CLI routes reach production). Run `botable version` to see the effective URL.
121
+
122
+ ## Use Botable from Claude Code / Codex
123
+
124
+ In Botable's **Code** tab, export your bot project. The export contains `botable.toml` with the project ID. Edit the files locally, then run `botable deploy` from that directory to deploy the same project. The CLI deployment routes currently work on staging, which is the default API URL:
125
+
126
+ ```bash
127
+ botable login
128
+ botable mcp install
129
+ botable version
130
+ cd path/to/exported-bot
131
+ botable deploy
132
+ botable bots list
133
+ botable logs PROJECT_ID
134
+ ```
135
+
136
+ **`botable deploy` uploads the project's `.env` file**, including any secrets in it. Check its contents before deployment. `botable logs` currently returns a status snapshot; runtime log lines and live streaming are not available through the CLI API yet.
137
+
138
+ `botable mcp install` registers the installed `botable-mcp` executable with Claude Code and Codex. Use `--target` to select one client. Claude uses its `claude mcp add` command when installed; without Claude, `--scope project` writes project `.mcp.json` (the default user scope requires Claude). Codex configuration goes in `~/.codex/config.toml` with a backup of an existing file. Check with `claude mcp list` or `codex mcp list`.
139
+
140
+ The MCP server exposes project creation, generation, templates, local development, deployment, bot listing, status, and the available status snapshot through its logs tool. Its former SSH staging status tool was removed because it requires operator access and is unrelated to customer bots. The MCP server uses the API URL and key saved by `botable login` (or the `BOTABLE_API_URL` environment override).
141
+
142
+ ### Branding
143
+
144
+ Every generated bot includes a `# Built with Botable` comment. Customize or disable it:
145
+
146
+ ```toml
147
+ # In botable.toml (per-project)
148
+ [branding]
149
+ enabled = true
150
+ text = "Built with Botable (botable.dev)"
151
+ style = "comment" # "comment" | "docstring" | "none"
152
+ ```
153
+
154
+ To disable globally:
155
+
156
+ ```toml
157
+ # In ~/.config/botable/config.toml
158
+ [branding]
159
+ enabled = false
160
+ ```
161
+
162
+ ## How It Works
163
+
164
+ 1. **`botable init`** — creates project structure with `botable.toml` + `.env`
165
+ 2. **`botable generate`** — calls OpenAI to generate aiogram bot code, validates syntax, writes `main.py` + `requirements.txt`
166
+ 3. **`botable dev`** — creates a venv, installs deps, runs your bot with live output
167
+ 4. **`botable deploy`** — packages project, uploads to Botable cloud, deploys automatically
168
+
169
+ Generated bots use [aiogram](https://docs.aiogram.dev/) (MIT license) — async-native, production-ready.
170
+
171
+ ## Development
172
+
173
+ ```bash
174
+ git clone https://github.com/Botable-dev/cli.git
175
+ cd cli
176
+ pip install -e ".[dev]"
177
+ pytest
178
+ ```
179
+
180
+ ## License
181
+
182
+ MIT — see [LICENSE](LICENSE) for details.
183
+
184
+ ---
185
+
186
+ ⚡ Built with [Botable](https://botable.dev)
@@ -0,0 +1,147 @@
1
+ # ⚡ Botable CLI
2
+
3
+ > **Generate Telegram bots with AI — from idea to running bot in 3 minutes.**
4
+
5
+ [![PyPI](https://img.shields.io/pypi/v/botable-dev?color=blue)](https://pypi.org/project/botable-dev/)
6
+ [![Python](https://img.shields.io/pypi/pyversions/botable-dev)](https://pypi.org/project/botable-dev/)
7
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
8
+
9
+ ## Quick Start
10
+
11
+ ```bash
12
+ pip install "botable-dev[mcp]"
13
+ botable login
14
+ botable mcp install
15
+
16
+ # Create a project
17
+ botable init my-bot
18
+ cd my-bot
19
+
20
+ # Add your keys to .env
21
+ echo "BOT_TOKEN=your-telegram-token" >> .env
22
+ echo "OPENAI_API_KEY=sk-..." >> .env
23
+
24
+ # Generate a bot from a description
25
+ botable generate "a FAQ bot for my restaurant with menu and hours"
26
+
27
+ # Run locally
28
+ botable dev
29
+ ```
30
+
31
+ **That's it.** Your bot is running in under 3 minutes.
32
+
33
+ ## Commands
34
+
35
+ ### Local Development
36
+
37
+ | Command | Description |
38
+ |---------|-------------|
39
+ | `botable init [name]` | Scaffold a new bot project |
40
+ | `botable generate "description"` | Generate bot from natural language |
41
+ | `botable dev` | Run bot locally with live output |
42
+ | `botable dev --watch` | Run with hot reload on file changes |
43
+ | `botable version` | Show CLI version and effective API URL |
44
+
45
+ ### Cloud Deployment
46
+
47
+ | Command | Description |
48
+ |---------|-------------|
49
+ | `botable login [--no-browser]` | Sign in through the browser |
50
+ | `botable login --api-key KEY [--api-url URL]` | Save an existing API key and API URL |
51
+ | `botable mcp install [--target claude\|codex\|all] [--scope user\|project]` | Configure agent MCP clients |
52
+ | `botable logout` | Remove stored authentication |
53
+ | `botable deploy` | Deploy to Botable cloud |
54
+ | `botable logs [project_id]` | Show the current bot status snapshot |
55
+ | `botable bots list` | List all deployed bots |
56
+ | `botable bots stop {id}` | Stop a running bot |
57
+
58
+ ## Deploy to Cloud
59
+
60
+ ```bash
61
+ botable login
62
+
63
+ # Deploy your bot
64
+ botable deploy
65
+
66
+ # Check status
67
+ botable bots list
68
+ botable logs
69
+ ```
70
+
71
+ ## Configuration
72
+
73
+ Botable uses a 3-layer config system:
74
+
75
+ | File | Scope | Purpose |
76
+ |------|-------|---------|
77
+ | `botable.toml` | Project | Bot name, template, branding (committed to git) |
78
+ | `.env` | Project | Secrets: BOT_TOKEN, API keys (NOT committed) |
79
+ | `~/.config/botable/config.toml` | User | Global defaults, auth token |
80
+
81
+ `botable login --api-url URL` saves the API URL. `BOTABLE_API_URL` overrides it for the current process; otherwise the default is `https://api-staging.botable.dev` (staging, until the CLI routes reach production). Run `botable version` to see the effective URL.
82
+
83
+ ## Use Botable from Claude Code / Codex
84
+
85
+ In Botable's **Code** tab, export your bot project. The export contains `botable.toml` with the project ID. Edit the files locally, then run `botable deploy` from that directory to deploy the same project. The CLI deployment routes currently work on staging, which is the default API URL:
86
+
87
+ ```bash
88
+ botable login
89
+ botable mcp install
90
+ botable version
91
+ cd path/to/exported-bot
92
+ botable deploy
93
+ botable bots list
94
+ botable logs PROJECT_ID
95
+ ```
96
+
97
+ **`botable deploy` uploads the project's `.env` file**, including any secrets in it. Check its contents before deployment. `botable logs` currently returns a status snapshot; runtime log lines and live streaming are not available through the CLI API yet.
98
+
99
+ `botable mcp install` registers the installed `botable-mcp` executable with Claude Code and Codex. Use `--target` to select one client. Claude uses its `claude mcp add` command when installed; without Claude, `--scope project` writes project `.mcp.json` (the default user scope requires Claude). Codex configuration goes in `~/.codex/config.toml` with a backup of an existing file. Check with `claude mcp list` or `codex mcp list`.
100
+
101
+ The MCP server exposes project creation, generation, templates, local development, deployment, bot listing, status, and the available status snapshot through its logs tool. Its former SSH staging status tool was removed because it requires operator access and is unrelated to customer bots. The MCP server uses the API URL and key saved by `botable login` (or the `BOTABLE_API_URL` environment override).
102
+
103
+ ### Branding
104
+
105
+ Every generated bot includes a `# Built with Botable` comment. Customize or disable it:
106
+
107
+ ```toml
108
+ # In botable.toml (per-project)
109
+ [branding]
110
+ enabled = true
111
+ text = "Built with Botable (botable.dev)"
112
+ style = "comment" # "comment" | "docstring" | "none"
113
+ ```
114
+
115
+ To disable globally:
116
+
117
+ ```toml
118
+ # In ~/.config/botable/config.toml
119
+ [branding]
120
+ enabled = false
121
+ ```
122
+
123
+ ## How It Works
124
+
125
+ 1. **`botable init`** — creates project structure with `botable.toml` + `.env`
126
+ 2. **`botable generate`** — calls OpenAI to generate aiogram bot code, validates syntax, writes `main.py` + `requirements.txt`
127
+ 3. **`botable dev`** — creates a venv, installs deps, runs your bot with live output
128
+ 4. **`botable deploy`** — packages project, uploads to Botable cloud, deploys automatically
129
+
130
+ Generated bots use [aiogram](https://docs.aiogram.dev/) (MIT license) — async-native, production-ready.
131
+
132
+ ## Development
133
+
134
+ ```bash
135
+ git clone https://github.com/Botable-dev/cli.git
136
+ cd cli
137
+ pip install -e ".[dev]"
138
+ pytest
139
+ ```
140
+
141
+ ## License
142
+
143
+ MIT — see [LICENSE](LICENSE) for details.
144
+
145
+ ---
146
+
147
+ ⚡ Built with [Botable](https://botable.dev)
@@ -0,0 +1,3 @@
1
+ """Botable MCP Server — exposes Botable CLI tools via the Model Context Protocol."""
2
+
3
+ __version__ = "0.1.0"