main.py: app entrypoint.src/: primary source code.src/core/pages/: PyQt UI pages (home/settings/tools, etc.).src/core/services/: business services (LLM, template rendering, Chrome profile, etc.).src/core/processor/: content/image processing threads and helpers.
templates/: prompt templates (e.g.templates/prompts/*.json).assets/: bundled template showcase assets.tests/: unit/integration tests and pytest config (tests/pytest.ini).docs/,images/: documentation and screenshots.
Install & run (macOS/Linux):
./install.sh
./启动程序.shManual run:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python main.pyPlaywright browser (only if needed):
PLAYWRIGHT_BROWSERS_PATH="$HOME/.xhs_system/ms-playwright" python -m playwright install chromiumTests:
pip install -r tests/requirements.txt
pytest -q
pytest -m unit- Python: 4-space indentation,
snake_casefor functions/vars,CapWordsfor classes. - Keep UI code in
src/core/pages/and reusable logic insrc/core/services/. - Prefer small, testable functions; avoid unrelated refactors in the same PR.
- Framework:
pytest(see markers intests/pytest.inilikeunit,integration,browser). - Naming:
test_*.py,Test*classes,test_*functions. - Mark slow/network/browser tests appropriately and keep unit tests deterministic.
- Commit style in this repo commonly uses prefixes like
feat:,fix:,docs:,chore:(Chinese descriptions are OK). - PRs should include: a short problem/solution summary, steps to verify, and UI screenshots when changing layouts (store under
docs/assets/orimages/). - If you change user-facing behavior, update both
readme.mdandreadme_en.md.
- Never commit real keys. Use
.envlocally (it’s gitignored) and keep secrets empty in.env.example. - Local runtime data lives under
~/.xhs_system/(db, logs, cached images, Playwright browsers).