mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-01 01:10:21 +08:00
2.0 KiB
2.0 KiB
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
Ruffextension for real-time formatting and linting in the editor.
Dev environment tips
- When modifying the WebUI, be sure to maintain componentization and clean code. Avoid duplicate code.
- Do not add any report files such as xxx_SUMMARY.md.
- After finishing, use
ruff format .andruff check .to format and check the code. - When committing, ensure to use conventional commits messages, such as
feat: add new agent for data analysisorfix: resolve bug in provider manager. - Use English for all new comments.
- For path handling, use
pathlib.Pathinstead of string paths, and useastrbot.core.utils.path_utilsto get the AstrBot data and temp directory.
PR instructions
- Title format: use conventional commit messages
- Use English to write PR title and descriptions.
Release versions
- Replace current version name to specific version name.
- Write changelog in
changelogs/, you can refer to the full commit messages between the latest tag to the latest commit. - Make and push a commit into master branch with message format like:
chore: bump version to 4.25.0 - Create a tag and push the tag. For example:
git tag v4.25.0 && git push origin v4.25.0