Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.62 KB

File metadata and controls

54 lines (37 loc) · 1.62 KB

Setup commands

Core

uv sync
uv run main.py

Exposed an API server on http://localhost:6185 by default.

Dashboard(WebUI)

cd dashboard
pnpm install # First time only. Use npm install -g pnpm if pnpm is not installed.
pnpm dev

Runs on http://localhost:3000 by default.

Pre-commit setup

AstrBot uses pre-commit hooks to automatically format and lint Python code before each commit. The hooks run ruff check, ruff format, and pyupgrade (see .pre-commit-config.yaml for details).

To set it up:

pip install pre-commit
pre-commit install

After installation, the hooks will run automatically on git commit. You can also run them manually at any time:

ruff format .
ruff check .

Note: If you use VSCode, install the Ruff extension for real-time formatting and linting in the editor.

Dev environment tips

  1. When modifying the WebUI, be sure to maintain componentization and clean code. Avoid duplicate code.
  2. Do not add any report files such as xxx_SUMMARY.md.
  3. After finishing, use ruff format . and ruff check . to format and check the code.
  4. When committing, ensure to use conventional commits messages, such as feat: add new agent for data analysis or fix: resolve bug in provider manager.
  5. Use English for all new comments.
  6. For path handling, use pathlib.Path instead of string paths, and use astrbot.core.utils.path_utils to get the AstrBot data and temp directory.

PR instructions

  1. Title format: use conventional commit messages
  2. Use English to write PR title and descriptions.