Skip to main content

xb - Project Management Tool

xb 是一个基于 uv 又类似 uv 的项目管理工具,用于快速初始化 UV + FastAPI + Vue3 + Electron 桌面应用。

特性

  • 一键初始化完整项目结构
  • UV + FastAPI + Vue3 + Electron 开箱即用
  • 可选 sudo 免密配置
  • 内置开发、构建、版本管理脚本
  • 自动初始化 git 仓库并提交首个 commit

安装

# 安装 uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# 安装 xb
cd xb
uv sync
uv tool install .

xb --help

快速开始

# 在当前目录创建 myapp/ 子目录,自动 git init + 首次 commit
xb init myapp

# 带 sudo 免密配置
xb init myapp --sudoers

cd myapp

# 启动开发环境
xb dev

# 查看状态
xb dev status

# 停止
xb dev stop

xb init 自动行为:在目标目录执行 git init 并以 chore: xb init 初始化 <package> 项目 提交首个 commit。 若系统未安装 git 或未配置 user.name/user.email,会打印警告但不阻塞项目创建,可稍后手动补提交。

构建

# 构建所有
xb build

# 单独构建
xb build frontend    # 或 xb build -f
xb build backend     # 或 xb build -b
xb build electron    # 或 xb build -e

项目结构

myapp/
├── pyproject.toml          # Python 依赖 (uv)
├── backend/                # FastAPI 后端
│   ├── main.py
│   ├── api/
│   └── managers/
├── frontend/               # Vue 3 前端
│   └── src/
├── electron/               # Electron 主进程
├── version/                # 版本管理
│   ├── hooks/
│   └── scripts/
├── configs/                # 配置文件
├── scripts/                # 可执行脚本
├── dev.sh                  # 开发脚本
├── build.sh                # 打包脚本
└── .venv                   # Python 虚拟环境

版本管理

# 查看当前版本
xb version

配置

Sudo 免密

# 启用 sudo 免密配置
xb init myapp --sudoers

# 密码存储在 configs/secrets.yaml
# 建议设置文件权限: chmod 600 configs/secrets.yaml

技术栈

组件 技术
后端 FastAPI + Uvicorn
前端 Vue 3 + Vite
桌面 Electron
构建 PyInstaller + electron-builder
依赖 uv

环境要求

  • Python: 3.12+
  • Node.js: 16+
  • npm: 8+
  • OS: Linux

许可证

MIT

故障排查

# 后端启动失败
cat datas/logs/backend.log
lsof -i :8000

# 手动启动测试
cd myapp
.venv/bin/python backend/main.py

# 前端启动失败
cat datas/logs/frontend.log
cd frontend && rm -rf node_modules && npm install

Metadata

Release files for xiaomi-xb 1.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xiaomi-xb 1.3.2
File Size Uploaded Provenance Actions
xiaomi_xb-1.3.2.tar.gz 83.0 kB Without provenance Details for xiaomi_xb-1.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xiaomi-xb 1.3.2
File Interpreter ABI Platform Actions
xiaomi_xb-1.3.2-py3-none-any.whl Python 3 none any Details for xiaomi_xb-1.3.2-py3-none-any.whl

Total release size: 187.0 kB

Release files / xiaomi_xb-1.3.2.tar.gz

Download URL xiaomi_xb-1.3.2.tar.gz
Size 83.0 kB
Tags Source
SHA-256 checksum
How to use checksums
98d3249435419deb8e65e146ca897b25f9e2f10ab50f332a391d9f7dfae145be
BLAKE2b-256 checksum
How to use checksums
92e79e4589393cd41243a04611fe21e56fac603d81b6c165a17553b7b2dc6f58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / xiaomi_xb-1.3.2-py3-none-any.whl

Download URL xiaomi_xb-1.3.2-py3-none-any.whl
Size 104.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9005e5c9701493729f8dbbb2ea4d651a9868614e37f20f4eec00160739d14203
BLAKE2b-256 checksum
How to use checksums
e9790db8969f6391f56726a0af9bf95046c812184c786e0f742c338cc7c2307c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for xiaomi-xb 1.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page