bat-cli 0.1.1__tar.gz → 2026.6__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.
- bat_cli-2026.6/PKG-INFO +290 -0
- bat_cli-2026.6/README.md +271 -0
- bat_cli-2026.6/pyproject.toml +95 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/add/client.py +2 -0
- bat_cli-2026.6/src/bat_cli.egg-info/PKG-INFO +290 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/bat_cli.egg-info/requires.txt +2 -2
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/build/build.py +4 -10
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/cli.py +57 -18
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/create/agent.py +132 -17
- bat_cli-2026.6/src/create/templates/agent/.python-version +1 -0
- bat_cli-2026.6/src/create/templates/agent/Makefile +28 -0
- bat_cli-2026.6/src/create/templates/agent/__main__.py +12 -0
- bat_cli-2026.6/src/create/templates/agent/llm_client.py.template +30 -0
- bat_cli-2026.6/src/create/templates/agent/src/__init__.py +4 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/create/templates/agent/src/graph.py +5 -5
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/eval/commands.py +54 -40
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/eval/engine/adapter.py +51 -22
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/eval/engine/bench_runner.py +28 -10
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/eval/engine/eval_config.py +42 -18
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/eval/engine/evaluator.py +13 -4
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/eval/engine/metrics/llm_evaluators.py +60 -17
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/eval/engine/metrics/metrics.py +19 -5
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/eval/engine/metrics/qualitative_helpers.py +6 -2
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/eval/engine/orchestrator.py +25 -9
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/eval/engine/plotter.py +263 -57
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/image_defaults.py +4 -2
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/push/push.py +17 -7
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/set/env.py +7 -6
- bat_cli-2026.6/tests/test_create_new_agent.py +547 -0
- bat_cli-2026.6/tests/test_eval_commands.py +516 -0
- bat_cli-0.1.1/PKG-INFO +0 -231
- bat_cli-0.1.1/README.md +0 -217
- bat_cli-0.1.1/pyproject.toml +0 -49
- bat_cli-0.1.1/src/bat_cli.egg-info/PKG-INFO +0 -231
- bat_cli-0.1.1/src/create/templates/agent/.python-version +0 -1
- bat_cli-0.1.1/src/create/templates/agent/Makefile +0 -34
- bat_cli-0.1.1/src/create/templates/agent/__main__.py +0 -2
- bat_cli-0.1.1/src/create/templates/agent/llm_client.py.template +0 -36
- bat_cli-0.1.1/src/create/templates/agent/tests/__init__.py +0 -0
- bat_cli-0.1.1/tests/test_create_new_agent.py +0 -477
- bat_cli-0.1.1/tests/test_eval_commands.py +0 -483
- {bat_cli-0.1.1 → bat_cli-2026.6}/setup.cfg +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/add/__init__.py +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/bat_cli.egg-info/SOURCES.txt +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/bat_cli.egg-info/dependency_links.txt +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/bat_cli.egg-info/entry_points.txt +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/bat_cli.egg-info/top_level.txt +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/build/__init__.py +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/create/__init__.py +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/create/templates/agent/.dockerignore +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/create/templates/agent/.env.template +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/create/templates/agent/Dockerfile +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/create/templates/agent/README.md +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/create/templates/agent/agent.json.template +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/create/templates/agent/agent.spec +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/create/templates/agent/config.yaml +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/create/templates/agent/pyproject.toml.template +0 -0
- {bat_cli-0.1.1/src/create/templates/agent/src → bat_cli-2026.6/src/create/templates/agent/src/llm_clients}/__init__.py +0 -0
- {bat_cli-0.1.1/src/create/templates/agent/src/llm_clients → bat_cli-2026.6/src/create/templates/agent/tests}/__init__.py +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/eval/__init__.py +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/eval/engine/__init__.py +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/eval/engine/contracts.py +1 -1
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/eval/engine/metrics/__init__.py +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/push/__init__.py +0 -0
- {bat_cli-0.1.1 → bat_cli-2026.6}/src/set/__init__.py +0 -0
bat_cli-2026.6/PKG-INFO
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bat-cli
|
|
3
|
+
Version: 2026.6
|
|
4
|
+
Summary: CLI tool to interact with BAT agents
|
|
5
|
+
Author-email: Enrico SBUTTONI <enrico.sbuttoni@bubbleran.com>
|
|
6
|
+
Project-URL: Homepage, https://bubbleran.com/
|
|
7
|
+
Project-URL: Repository, https://github.com/bubbleran/bat
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.12
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: typer>=0.12.3
|
|
13
|
+
Requires-Dist: bat-adk>=2026.06
|
|
14
|
+
Requires-Dist: bat-adk[all]
|
|
15
|
+
Requires-Dist: a2a-sdk>=1.0.0
|
|
16
|
+
Requires-Dist: python-dotenv>=1.0.1
|
|
17
|
+
Requires-Dist: typing-extensions>=4.12.0
|
|
18
|
+
Requires-Dist: matplotlib>=3.8
|
|
19
|
+
|
|
20
|
+
# bat-cli
|
|
21
|
+
|
|
22
|
+
A CLI tool for creating, building, and evaluating BAT agent projects.
|
|
23
|
+
|
|
24
|
+
## Prerequisites
|
|
25
|
+
|
|
26
|
+
- Python 3.12+ and [uv](https://docs.astral.sh/uv/) installed
|
|
27
|
+
- Docker installed (required for `bat build` and `bat push`)
|
|
28
|
+
- For evaluation commands: an existing BAT agent root containing `agent.json`, `config.yaml`, and `pyproject.toml`
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
### Option A — install system-wide with `uv tool` (recommended)
|
|
35
|
+
|
|
36
|
+
Installs `bat` into an isolated environment and puts the executable on your `PATH`,
|
|
37
|
+
so it is available from any directory.
|
|
38
|
+
|
|
39
|
+
````bash
|
|
40
|
+
# from PyPI
|
|
41
|
+
uv tool install bat-cli
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
Make sure the uv tools bin directory is on your `PATH` (uv prints the path on first
|
|
45
|
+
install; this is usually `~/.local/bin`):
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
uv tool update-shell # adds the uv tools dir to your shell profile
|
|
49
|
+
````
|
|
50
|
+
|
|
51
|
+
Then verify:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
bat --help
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
To upgrade or remove later:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
uv tool upgrade bat-cli
|
|
61
|
+
uv tool uninstall bat-cli
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Option B — install into a virtual environment with `uv pip`
|
|
65
|
+
|
|
66
|
+
Use this when you want `bat` scoped to a specific project/venv rather than installed
|
|
67
|
+
globally.
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
uv venv # create .venv (skip if you already have one)
|
|
71
|
+
source .venv/bin/activate # .venv\Scripts\activate on Windows
|
|
72
|
+
|
|
73
|
+
# from PyPI
|
|
74
|
+
uv pip install bat-cli
|
|
75
|
+
|
|
76
|
+
# or from a local checkout (run from the cli/ directory)
|
|
77
|
+
uv pip install . # add -e for an editable/development install
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`bat` is available whenever that virtual environment is active:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
bat --help
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Option C — run without installing (development)
|
|
87
|
+
|
|
88
|
+
From the `cli/` directory:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
uv sync --group dev
|
|
92
|
+
uv run bat --help
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
All examples below show `bat ...`; replace with `uv run bat ...` when using this option.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Command Tree
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
bat
|
|
103
|
+
├── init
|
|
104
|
+
│ └── agent
|
|
105
|
+
│ ├── <name>
|
|
106
|
+
│ ├── --clients, -c
|
|
107
|
+
│ ├── --output-dir, -o
|
|
108
|
+
│ ├── --force, -f
|
|
109
|
+
│ ├── --port
|
|
110
|
+
│ ├── --model
|
|
111
|
+
│ └── --model-provider
|
|
112
|
+
├── add
|
|
113
|
+
│ └── client
|
|
114
|
+
│ ├── <clients>
|
|
115
|
+
│ └── --force, -f
|
|
116
|
+
├── set
|
|
117
|
+
│ └── env
|
|
118
|
+
│ ├── --port
|
|
119
|
+
│ ├── --model
|
|
120
|
+
│ ├── --model-provider
|
|
121
|
+
│ ├── --docker-registry
|
|
122
|
+
│ └── --repo
|
|
123
|
+
├── eval
|
|
124
|
+
│ ├── init
|
|
125
|
+
│ │ └── --force, -f
|
|
126
|
+
│ ├── run
|
|
127
|
+
│ ├── show
|
|
128
|
+
│ └── plot
|
|
129
|
+
│ ├── --folder, -f
|
|
130
|
+
│ └── --filter, -F
|
|
131
|
+
├── build
|
|
132
|
+
│ ├── --context, -C
|
|
133
|
+
│ ├── --docker-registry
|
|
134
|
+
│ ├── --repo
|
|
135
|
+
│ ├── --version
|
|
136
|
+
│ └── --no-cache
|
|
137
|
+
└── push
|
|
138
|
+
├── --context, -C
|
|
139
|
+
├── --docker-registry
|
|
140
|
+
├── --repo
|
|
141
|
+
└── --version
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Built-in help is available at every level:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
bat --help
|
|
148
|
+
bat init agent --help
|
|
149
|
+
bat eval --help
|
|
150
|
+
bat build --help
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Workflows
|
|
156
|
+
|
|
157
|
+
### 1. Create a new agent
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
bat init agent my_agent
|
|
161
|
+
|
|
162
|
+
# specific output directory
|
|
163
|
+
bat init agent my_agent --output-dir .
|
|
164
|
+
|
|
165
|
+
# pre-generate LLM clients
|
|
166
|
+
bat init agent my_agent --clients reformulator,planner,executor
|
|
167
|
+
|
|
168
|
+
# set the port/model/provider written to .env
|
|
169
|
+
bat init agent my_agent --port 9900 --model gpt-4o-mini --model-provider openai
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### 2. Add clients to an existing agent
|
|
173
|
+
|
|
174
|
+
Run from the agent root (must contain `src/llm_clients/`):
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
bat add client planner,executor
|
|
178
|
+
|
|
179
|
+
# overwrite existing files
|
|
180
|
+
bat add client planner,executor --force
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### 3. Update agent environment variables
|
|
184
|
+
|
|
185
|
+
Run from the agent root (updates an existing `.env`):
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
bat set env --port 8080 --model gpt-4o-mini --model-provider openai
|
|
189
|
+
|
|
190
|
+
# also set Docker defaults for build/push
|
|
191
|
+
bat set env --docker-registry hub.bubbleran.com --repo orama/labs/my-agent
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### 4. Build and push a Docker image
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# --version is used both as the image tag and as the VERSION build arg (default: latest)
|
|
198
|
+
bat build --context ./my_agent --docker-registry hub.bubbleran.com --repo orama/labs/my-agent --version latest
|
|
199
|
+
|
|
200
|
+
# no-cache build with a specific version
|
|
201
|
+
bat build --context ./my_agent --repo orama/labs/my-agent --version 1.0.0 --no-cache
|
|
202
|
+
|
|
203
|
+
bat push --context ./my_agent --docker-registry hub.bubbleran.com --repo orama/labs/my-agent --version latest
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
The image reference is always `{registry}/{repo}:{version}`.
|
|
207
|
+
|
|
208
|
+
If `BAT_DOCKER_REGISTRY` and `BAT_DOCKER_REPO` are already set in `.env` or the shell, `--docker-registry` and `--repo` can be omitted.
|
|
209
|
+
|
|
210
|
+
**Precedence** (both `--docker-registry` / `--repo`):
|
|
211
|
+
|
|
212
|
+
1. CLI flag
|
|
213
|
+
2. Shell environment variable (`BAT_DOCKER_REGISTRY` / `BAT_DOCKER_REPO`)
|
|
214
|
+
3. `.env` file in the current directory
|
|
215
|
+
4. Hardcoded default (`default_registry` / `default-repository/<project-name>`)
|
|
216
|
+
|
|
217
|
+
### 5. Run evaluation
|
|
218
|
+
|
|
219
|
+
Run all `eval` commands from an existing agent root (must contain `agent.json`,
|
|
220
|
+
`config.yaml`, and `pyproject.toml`):
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# scaffold evaluation files
|
|
224
|
+
bat eval init
|
|
225
|
+
|
|
226
|
+
# inspect the resolved configuration
|
|
227
|
+
bat eval show
|
|
228
|
+
|
|
229
|
+
# run evaluation
|
|
230
|
+
bat eval run
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
`eval init` creates:
|
|
234
|
+
|
|
235
|
+
- `eval/eval.yaml`
|
|
236
|
+
- `eval/input/tasks.json`
|
|
237
|
+
- `eval/output/`
|
|
238
|
+
|
|
239
|
+
Minimal `eval/eval.yaml`:
|
|
240
|
+
|
|
241
|
+
```yaml
|
|
242
|
+
evaluation:
|
|
243
|
+
dataset: eval/input/tasks.json # default path if omitted
|
|
244
|
+
output_dir: eval/output # default path if omitted
|
|
245
|
+
agent_url: http://127.0.0.1:9900 # must include the scheme; this is the default
|
|
246
|
+
agent_startup_timeout_s: 45
|
|
247
|
+
agent_shutdown_timeout_s: 10
|
|
248
|
+
k: 1
|
|
249
|
+
qualitative: false # set true to enable LLM judge scoring
|
|
250
|
+
|
|
251
|
+
models:
|
|
252
|
+
- provider: openai
|
|
253
|
+
model: your-model-name
|
|
254
|
+
- provider: ollama
|
|
255
|
+
model: your-local-model
|
|
256
|
+
base_url: http://localhost:11434
|
|
257
|
+
|
|
258
|
+
# required only when qualitative: true
|
|
259
|
+
judge:
|
|
260
|
+
provider: ollama
|
|
261
|
+
model: local-judge-model
|
|
262
|
+
base_url: http://localhost:11434
|
|
263
|
+
# api_key_env: BAT_JUDGE_API_KEY # env var name holding the judge's API key
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Notes:
|
|
267
|
+
|
|
268
|
+
- `bat eval run` starts the agent via `uv run .` from the agent root and waits until
|
|
269
|
+
`agent_url` accepts a TCP connection, so the agent project must have its
|
|
270
|
+
dependencies installed (its own `.venv`).
|
|
271
|
+
- `models` entries may also be written as `"<provider>:<model>"` strings.
|
|
272
|
+
- For models that require an API key, set it in the agent's `.env` under
|
|
273
|
+
`<PROVIDER>_API_KEY` (e.g. `OPENAI_API_KEY`).
|
|
274
|
+
|
|
275
|
+
### 6. Plot evaluation metrics
|
|
276
|
+
|
|
277
|
+
`bat eval plot` reads the `metrics.json` files produced by `eval run` and renders
|
|
278
|
+
charts. Point `--folder` at an evaluation output directory; each sub-folder
|
|
279
|
+
containing a `metrics.json` is treated as one run.
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# plot every run found under the output folder
|
|
283
|
+
bat eval plot --folder eval/output
|
|
284
|
+
|
|
285
|
+
# restrict the per-task charts to task ids containing a substring
|
|
286
|
+
bat eval plot --folder eval/output --filter smoke
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Charts are saved back into the given folder. `--filter` only narrows the per-task
|
|
290
|
+
charts; summary charts always cover all runs.
|
bat_cli-2026.6/README.md
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# bat-cli
|
|
2
|
+
|
|
3
|
+
A CLI tool for creating, building, and evaluating BAT agent projects.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Python 3.12+ and [uv](https://docs.astral.sh/uv/) installed
|
|
8
|
+
- Docker installed (required for `bat build` and `bat push`)
|
|
9
|
+
- For evaluation commands: an existing BAT agent root containing `agent.json`, `config.yaml`, and `pyproject.toml`
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
### Option A — install system-wide with `uv tool` (recommended)
|
|
16
|
+
|
|
17
|
+
Installs `bat` into an isolated environment and puts the executable on your `PATH`,
|
|
18
|
+
so it is available from any directory.
|
|
19
|
+
|
|
20
|
+
````bash
|
|
21
|
+
# from PyPI
|
|
22
|
+
uv tool install bat-cli
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
Make sure the uv tools bin directory is on your `PATH` (uv prints the path on first
|
|
26
|
+
install; this is usually `~/.local/bin`):
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uv tool update-shell # adds the uv tools dir to your shell profile
|
|
30
|
+
````
|
|
31
|
+
|
|
32
|
+
Then verify:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
bat --help
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
To upgrade or remove later:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
uv tool upgrade bat-cli
|
|
42
|
+
uv tool uninstall bat-cli
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Option B — install into a virtual environment with `uv pip`
|
|
46
|
+
|
|
47
|
+
Use this when you want `bat` scoped to a specific project/venv rather than installed
|
|
48
|
+
globally.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
uv venv # create .venv (skip if you already have one)
|
|
52
|
+
source .venv/bin/activate # .venv\Scripts\activate on Windows
|
|
53
|
+
|
|
54
|
+
# from PyPI
|
|
55
|
+
uv pip install bat-cli
|
|
56
|
+
|
|
57
|
+
# or from a local checkout (run from the cli/ directory)
|
|
58
|
+
uv pip install . # add -e for an editable/development install
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`bat` is available whenever that virtual environment is active:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
bat --help
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Option C — run without installing (development)
|
|
68
|
+
|
|
69
|
+
From the `cli/` directory:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
uv sync --group dev
|
|
73
|
+
uv run bat --help
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
All examples below show `bat ...`; replace with `uv run bat ...` when using this option.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Command Tree
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
bat
|
|
84
|
+
├── init
|
|
85
|
+
│ └── agent
|
|
86
|
+
│ ├── <name>
|
|
87
|
+
│ ├── --clients, -c
|
|
88
|
+
│ ├── --output-dir, -o
|
|
89
|
+
│ ├── --force, -f
|
|
90
|
+
│ ├── --port
|
|
91
|
+
│ ├── --model
|
|
92
|
+
│ └── --model-provider
|
|
93
|
+
├── add
|
|
94
|
+
│ └── client
|
|
95
|
+
│ ├── <clients>
|
|
96
|
+
│ └── --force, -f
|
|
97
|
+
├── set
|
|
98
|
+
│ └── env
|
|
99
|
+
│ ├── --port
|
|
100
|
+
│ ├── --model
|
|
101
|
+
│ ├── --model-provider
|
|
102
|
+
│ ├── --docker-registry
|
|
103
|
+
│ └── --repo
|
|
104
|
+
├── eval
|
|
105
|
+
│ ├── init
|
|
106
|
+
│ │ └── --force, -f
|
|
107
|
+
│ ├── run
|
|
108
|
+
│ ├── show
|
|
109
|
+
│ └── plot
|
|
110
|
+
│ ├── --folder, -f
|
|
111
|
+
│ └── --filter, -F
|
|
112
|
+
├── build
|
|
113
|
+
│ ├── --context, -C
|
|
114
|
+
│ ├── --docker-registry
|
|
115
|
+
│ ├── --repo
|
|
116
|
+
│ ├── --version
|
|
117
|
+
│ └── --no-cache
|
|
118
|
+
└── push
|
|
119
|
+
├── --context, -C
|
|
120
|
+
├── --docker-registry
|
|
121
|
+
├── --repo
|
|
122
|
+
└── --version
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Built-in help is available at every level:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
bat --help
|
|
129
|
+
bat init agent --help
|
|
130
|
+
bat eval --help
|
|
131
|
+
bat build --help
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Workflows
|
|
137
|
+
|
|
138
|
+
### 1. Create a new agent
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
bat init agent my_agent
|
|
142
|
+
|
|
143
|
+
# specific output directory
|
|
144
|
+
bat init agent my_agent --output-dir .
|
|
145
|
+
|
|
146
|
+
# pre-generate LLM clients
|
|
147
|
+
bat init agent my_agent --clients reformulator,planner,executor
|
|
148
|
+
|
|
149
|
+
# set the port/model/provider written to .env
|
|
150
|
+
bat init agent my_agent --port 9900 --model gpt-4o-mini --model-provider openai
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### 2. Add clients to an existing agent
|
|
154
|
+
|
|
155
|
+
Run from the agent root (must contain `src/llm_clients/`):
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
bat add client planner,executor
|
|
159
|
+
|
|
160
|
+
# overwrite existing files
|
|
161
|
+
bat add client planner,executor --force
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 3. Update agent environment variables
|
|
165
|
+
|
|
166
|
+
Run from the agent root (updates an existing `.env`):
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
bat set env --port 8080 --model gpt-4o-mini --model-provider openai
|
|
170
|
+
|
|
171
|
+
# also set Docker defaults for build/push
|
|
172
|
+
bat set env --docker-registry hub.bubbleran.com --repo orama/labs/my-agent
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### 4. Build and push a Docker image
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# --version is used both as the image tag and as the VERSION build arg (default: latest)
|
|
179
|
+
bat build --context ./my_agent --docker-registry hub.bubbleran.com --repo orama/labs/my-agent --version latest
|
|
180
|
+
|
|
181
|
+
# no-cache build with a specific version
|
|
182
|
+
bat build --context ./my_agent --repo orama/labs/my-agent --version 1.0.0 --no-cache
|
|
183
|
+
|
|
184
|
+
bat push --context ./my_agent --docker-registry hub.bubbleran.com --repo orama/labs/my-agent --version latest
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The image reference is always `{registry}/{repo}:{version}`.
|
|
188
|
+
|
|
189
|
+
If `BAT_DOCKER_REGISTRY` and `BAT_DOCKER_REPO` are already set in `.env` or the shell, `--docker-registry` and `--repo` can be omitted.
|
|
190
|
+
|
|
191
|
+
**Precedence** (both `--docker-registry` / `--repo`):
|
|
192
|
+
|
|
193
|
+
1. CLI flag
|
|
194
|
+
2. Shell environment variable (`BAT_DOCKER_REGISTRY` / `BAT_DOCKER_REPO`)
|
|
195
|
+
3. `.env` file in the current directory
|
|
196
|
+
4. Hardcoded default (`default_registry` / `default-repository/<project-name>`)
|
|
197
|
+
|
|
198
|
+
### 5. Run evaluation
|
|
199
|
+
|
|
200
|
+
Run all `eval` commands from an existing agent root (must contain `agent.json`,
|
|
201
|
+
`config.yaml`, and `pyproject.toml`):
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
# scaffold evaluation files
|
|
205
|
+
bat eval init
|
|
206
|
+
|
|
207
|
+
# inspect the resolved configuration
|
|
208
|
+
bat eval show
|
|
209
|
+
|
|
210
|
+
# run evaluation
|
|
211
|
+
bat eval run
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
`eval init` creates:
|
|
215
|
+
|
|
216
|
+
- `eval/eval.yaml`
|
|
217
|
+
- `eval/input/tasks.json`
|
|
218
|
+
- `eval/output/`
|
|
219
|
+
|
|
220
|
+
Minimal `eval/eval.yaml`:
|
|
221
|
+
|
|
222
|
+
```yaml
|
|
223
|
+
evaluation:
|
|
224
|
+
dataset: eval/input/tasks.json # default path if omitted
|
|
225
|
+
output_dir: eval/output # default path if omitted
|
|
226
|
+
agent_url: http://127.0.0.1:9900 # must include the scheme; this is the default
|
|
227
|
+
agent_startup_timeout_s: 45
|
|
228
|
+
agent_shutdown_timeout_s: 10
|
|
229
|
+
k: 1
|
|
230
|
+
qualitative: false # set true to enable LLM judge scoring
|
|
231
|
+
|
|
232
|
+
models:
|
|
233
|
+
- provider: openai
|
|
234
|
+
model: your-model-name
|
|
235
|
+
- provider: ollama
|
|
236
|
+
model: your-local-model
|
|
237
|
+
base_url: http://localhost:11434
|
|
238
|
+
|
|
239
|
+
# required only when qualitative: true
|
|
240
|
+
judge:
|
|
241
|
+
provider: ollama
|
|
242
|
+
model: local-judge-model
|
|
243
|
+
base_url: http://localhost:11434
|
|
244
|
+
# api_key_env: BAT_JUDGE_API_KEY # env var name holding the judge's API key
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Notes:
|
|
248
|
+
|
|
249
|
+
- `bat eval run` starts the agent via `uv run .` from the agent root and waits until
|
|
250
|
+
`agent_url` accepts a TCP connection, so the agent project must have its
|
|
251
|
+
dependencies installed (its own `.venv`).
|
|
252
|
+
- `models` entries may also be written as `"<provider>:<model>"` strings.
|
|
253
|
+
- For models that require an API key, set it in the agent's `.env` under
|
|
254
|
+
`<PROVIDER>_API_KEY` (e.g. `OPENAI_API_KEY`).
|
|
255
|
+
|
|
256
|
+
### 6. Plot evaluation metrics
|
|
257
|
+
|
|
258
|
+
`bat eval plot` reads the `metrics.json` files produced by `eval run` and renders
|
|
259
|
+
charts. Point `--folder` at an evaluation output directory; each sub-folder
|
|
260
|
+
containing a `metrics.json` is treated as one run.
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
# plot every run found under the output folder
|
|
264
|
+
bat eval plot --folder eval/output
|
|
265
|
+
|
|
266
|
+
# restrict the per-task charts to task ids containing a substring
|
|
267
|
+
bat eval plot --folder eval/output --filter smoke
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Charts are saved back into the given folder. `--filter` only narrows the per-task
|
|
271
|
+
charts; summary charts always cover all runs.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "bat-cli"
|
|
7
|
+
version = "2026.06"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Enrico SBUTTONI", email="enrico.sbuttoni@bubbleran.com" },
|
|
10
|
+
]
|
|
11
|
+
description = "CLI tool to interact with BAT agents"
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.12"
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Operating System :: OS Independent",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
dependencies = [
|
|
20
|
+
"typer>=0.12.3",
|
|
21
|
+
"bat-adk>=2026.06",
|
|
22
|
+
"bat-adk[all]",
|
|
23
|
+
"a2a-sdk>=1.0.0",
|
|
24
|
+
"python-dotenv>=1.0.1",
|
|
25
|
+
"typing-extensions>=4.12.0",
|
|
26
|
+
"matplotlib>=3.8",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.scripts]
|
|
30
|
+
bat = "cli:main"
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
"Homepage" = "https://bubbleran.com/"
|
|
34
|
+
"Repository" = "https://github.com/bubbleran/bat"
|
|
35
|
+
|
|
36
|
+
[dependency-groups]
|
|
37
|
+
dev = [
|
|
38
|
+
"pytest>=8.0",
|
|
39
|
+
]
|
|
40
|
+
packaging = [
|
|
41
|
+
"pyinstaller>=6.0",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[tool.setuptools]
|
|
45
|
+
package-dir = {"" = "src"}
|
|
46
|
+
py-modules = ["cli", "image_defaults"]
|
|
47
|
+
|
|
48
|
+
[tool.setuptools.packages.find]
|
|
49
|
+
where = ["src"]
|
|
50
|
+
|
|
51
|
+
[tool.setuptools.package-data]
|
|
52
|
+
create = [
|
|
53
|
+
"templates/agent/*",
|
|
54
|
+
"templates/agent/.*",
|
|
55
|
+
"templates/agent/src/*",
|
|
56
|
+
"templates/agent/src/llm_clients/*",
|
|
57
|
+
"templates/agent/tests/*",
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
[tool.pytest.ini_options]
|
|
61
|
+
pythonpath = ["src"]
|
|
62
|
+
|
|
63
|
+
[tool.ruff]
|
|
64
|
+
target-version = "py312"
|
|
65
|
+
line-length = 80
|
|
66
|
+
|
|
67
|
+
# Files or directories to ignore entirely
|
|
68
|
+
exclude = [
|
|
69
|
+
".git",
|
|
70
|
+
".venv",
|
|
71
|
+
"__pycache__",
|
|
72
|
+
"build",
|
|
73
|
+
"dist",
|
|
74
|
+
"src/create/templates", # agent scaffold templates, not valid Python
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
[tool.ruff.lint]
|
|
78
|
+
select = [
|
|
79
|
+
"E", # pycodestyle errors (standard spacing, formatting)
|
|
80
|
+
"W", # pycodestyle warnings
|
|
81
|
+
"F", # Pyflakes (catches unused imports, undefined variables)
|
|
82
|
+
"I", # isort (automatically sorts your imports alphabetically)
|
|
83
|
+
"B", # flake8-bugbear (catches tricky hidden Python bugs)
|
|
84
|
+
"SIM", # flake8-simplify (helps you write simpler, shorter code)
|
|
85
|
+
]
|
|
86
|
+
ignore = [
|
|
87
|
+
"B008", # function call in default argument (this is the Typer/FastAPI pattern)
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
# Custom settings for specific files
|
|
91
|
+
[tool.ruff.lint.per-file-ignores]
|
|
92
|
+
"tests/*" = ["S101"] # Allow 'assert' statements in tests without warning
|
|
93
|
+
|
|
94
|
+
[tool.ruff.format]
|
|
95
|
+
indent-style = "space"
|