增加makefile
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
.PHONY: help sync sync-dev install reinstall run chat gateway config-sync config-path config-open data-dump test fmt lint
|
||||
|
||||
help: ## Show available targets
|
||||
@/usr/bin/awk 'BEGIN {FS = ":.*## "; print "VoidBot Make Targets\n"} /^[a-zA-Z0-9_-]+:.*## / {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}' /home/mcallzbl/File2/Workshop/Projects/VoidBot/Makefile
|
||||
|
||||
sync: ## Sync runtime dependencies with uv
|
||||
uv sync
|
||||
|
||||
sync-dev: ## Sync runtime and dev dependencies with uv
|
||||
uv sync --group dev
|
||||
|
||||
install: ## Install voidbot into the local user environment
|
||||
uv tool install --editable .
|
||||
|
||||
reinstall: ## Reinstall voidbot into the local user environment
|
||||
uv tool install --editable . --reinstall
|
||||
|
||||
run: ## Start the interactive VoidBot CLI
|
||||
uv run voidbot
|
||||
|
||||
chat: ## Run one CLI message, pass MESSAGE='...'
|
||||
uv run voidbot --message "$(MESSAGE)"
|
||||
|
||||
gateway: ## Start the standalone gateway
|
||||
uv run voidbot gateway
|
||||
|
||||
config-sync: ## Sync the default user config into ~/.voidbot
|
||||
uv run voidbot config sync
|
||||
|
||||
config-path: ## Print the default user config path
|
||||
uv run voidbot config path
|
||||
|
||||
config-open: ## Open the default user config file
|
||||
uv run voidbot config open
|
||||
|
||||
data-dump: ## Dump stored SQLite data, optional SESSION_ID=... LIMIT=...
|
||||
uv run voidbot data dump $(if $(SESSION_ID),--session-id "$(SESSION_ID)") $(if $(LIMIT),--limit "$(LIMIT)")
|
||||
|
||||
test: ## Run the unit test suite
|
||||
uv run python -m unittest discover -s tests
|
||||
|
||||
fmt: ## Format the codebase with Ruff
|
||||
uv run --group dev ruff format src tests
|
||||
|
||||
lint: ## Run Ruff checks
|
||||
uv run --group dev ruff check
|
||||
+22
-1
@@ -32,6 +32,15 @@ After installation:
|
||||
voidbot --help
|
||||
```
|
||||
|
||||
You can also use the `Makefile` shortcuts:
|
||||
|
||||
```bash
|
||||
make help
|
||||
make sync
|
||||
make install
|
||||
make run
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
||||
1. Sync the default config into `~/.voidbot/config.json`
|
||||
@@ -74,6 +83,19 @@ voidbot data dump
|
||||
voidbot data dump --session-id main
|
||||
```
|
||||
|
||||
Common `make` targets:
|
||||
|
||||
- `make help`
|
||||
- `make sync`
|
||||
- `make sync-dev`
|
||||
- `make install`
|
||||
- `make reinstall`
|
||||
- `make run`
|
||||
- `make gateway`
|
||||
- `make test`
|
||||
- `make fmt`
|
||||
- `make lint`
|
||||
|
||||
## Config Shape
|
||||
|
||||
Key fields:
|
||||
@@ -144,4 +166,3 @@ Without `--config`, config lookup order is:
|
||||
- Built-in tools are `list_dir`, `read_file`, `write_file`, and `run_command`
|
||||
- `voidbot` starts the interactive CLI by default
|
||||
- `voidbot gateway` starts HTTP and any enabled channel listeners
|
||||
|
||||
|
||||
+22
-1
@@ -32,6 +32,15 @@ uv tool install --editable .
|
||||
voidbot --help
|
||||
```
|
||||
|
||||
也可以使用 `Makefile`:
|
||||
|
||||
```bash
|
||||
make help
|
||||
make sync
|
||||
make install
|
||||
make run
|
||||
```
|
||||
|
||||
## 快速开始
|
||||
|
||||
1. 同步默认配置到 `~/.voidbot/config.json`
|
||||
@@ -74,6 +83,19 @@ voidbot data dump
|
||||
voidbot data dump --session-id main
|
||||
```
|
||||
|
||||
常用 `make` 目标:
|
||||
|
||||
- `make help`
|
||||
- `make sync`
|
||||
- `make sync-dev`
|
||||
- `make install`
|
||||
- `make reinstall`
|
||||
- `make run`
|
||||
- `make gateway`
|
||||
- `make test`
|
||||
- `make fmt`
|
||||
- `make lint`
|
||||
|
||||
## 配置结构
|
||||
|
||||
核心配置字段:
|
||||
@@ -144,4 +166,3 @@ voidbot data dump --session-id main
|
||||
- 内置工具有 `list_dir`、`read_file`、`write_file`、`run_command`
|
||||
- `voidbot` 默认启动交互式 CLI
|
||||
- `voidbot gateway` 启动 HTTP 与已启用渠道监听
|
||||
|
||||
|
||||
Reference in New Issue
Block a user