uv sync
uv run main.py
Exposed an API server on http://localhost:6185 by default.
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.
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 installAfter 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.
- 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.
- Title format: use conventional commit messages
- Use English to write PR title and descriptions.