Skip to content

Commit 0b67e51

Browse files
committed
v0.3.0: --db and --db-name flags
1 parent 4a19eea commit 0b67e51

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ uvx duckdb-claude-slack
2727
```
2828
--bot-token Slack Bot Token (xoxb-...) [env: SLACK_BOT_TOKEN]
2929
--app-token Slack App Token (xapp-...) [env: SLACK_APP_TOKEN]
30-
--db Attach database file (repeatable)
30+
--db Database file to attach
31+
--db-name Name for attached database (default: filename)
3132
--init-sql Path to SQL file to run on startup
3233
```
3334

@@ -41,10 +42,10 @@ Attach a database:
4142
duckdb-claude-slack --db /path/to/sales.duckdb
4243
```
4344

44-
Multiple databases:
45+
With custom name:
4546

4647
```bash
47-
duckdb-claude-slack --db /data/sales.duckdb --db /data/users.duckdb
48+
duckdb-claude-slack --db /path/to/data.duckdb --db-name mydata
4849
```
4950

5051
Run init SQL on startup (install extensions, attach remote DBs, etc.):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "duckdb-claude-slack"
3-
version = "0.2.2"
3+
version = "0.3.0"
44
description = "Slack bot that uses DuckDB ACP extension to call Claude Code"
55
requires-python = ">=3.11"
66
dependencies = [

src/duckdb_acp_slack/__init__.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,15 @@ def main(
187187
envvar="SLACK_APP_TOKEN",
188188
help="Slack App Token (xapp-...)",
189189
),
190-
db: Optional[list[str]] = typer.Option(
190+
db: Optional[Path] = typer.Option(
191191
None,
192192
"--db",
193-
help="Attach database file (or name:path)",
193+
help="Database file to attach",
194+
),
195+
db_name: Optional[str] = typer.Option(
196+
None,
197+
"--db-name",
198+
help="Name for attached database (default: filename)",
194199
),
195200
init_sql: Optional[Path] = typer.Option(
196201
None,
@@ -211,20 +216,14 @@ def main(
211216
console.print("[red]Error:[/red] Missing --app-token or SLACK_APP_TOKEN")
212217
raise typer.Exit(1)
213218

214-
# Parse databases
219+
# Parse database
215220
databases = {}
216221
if db:
217-
for entry in db:
218-
# Support both "name:/path" and just "/path"
219-
if ":" in entry and not entry.startswith("/"):
220-
name, path = entry.split(":", 1)
221-
else:
222-
path = entry
223-
name = Path(path).stem
224-
if not Path(path).exists():
225-
console.print(f"[red]Error:[/red] Database not found: {path}")
226-
raise typer.Exit(1)
227-
databases[name] = path
222+
if not db.exists():
223+
console.print(f"[red]Error:[/red] Database not found: {db}")
224+
raise typer.Exit(1)
225+
name = db_name or db.stem
226+
databases[name] = str(db)
228227

229228
# Load init SQL
230229
init_sql_content = None

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)