Skip to content

feat(xtask): comprehensive build automation CLI with 31 subcommands#1511

Merged
houko merged 33 commits intomainfrom
feat/xtask-automation
Mar 22, 2026
Merged

feat(xtask): comprehensive build automation CLI with 31 subcommands#1511
houko merged 33 commits intomainfrom
feat/xtask-automation

Conversation

@houko
Copy link
Copy Markdown
Contributor

@houko houko commented Mar 22, 2026

Summary

Replace scattered shell scripts with a unified, cross-platform cargo xtask CLI (31 subcommands), migrate CI workflows to use xtask, and extract shared utilities.

Core Build Commands

  • ci: local CI suite (build + test + clippy + web lint) with --no-test, --no-web, --release
  • fmt: check or fix formatting (Rust + web) with --fix
  • build-web: build dashboard / web / docs frontends via pnpm
  • clean-all: remove all build artifacts (target/, node_modules/, dist/, .next/)
  • pre-commit: run fmt + clippy + test as pre-commit check

Release & Publishing

  • release: full release flow — changelog, version sync, commit, tag, PR creation
  • changelog: generate CHANGELOG.md from merged PRs via gh pr list
  • sync-versions: sync CalVer across Cargo.toml, JS/Python/Rust SDKs, Tauri
  • dist: build release binaries for multiple platforms
  • docker: build and optionally push Docker image
  • publish-sdks: publish SDKs to npm, PyPI, and crates.io
  • publish-npm-binaries: publish platform-specific CLI binaries to npm (replaces publish-npm-binaries.sh)
  • publish-pypi-binaries: publish platform-specific CLI wheels to PyPI (replaces publish-pypi-binaries.sh)

Development & Testing

  • dev: start daemon + dashboard hot reload together
  • setup: set up local development environment
  • doctor: diagnose development environment issues
  • bench: run criterion benchmarks
  • coverage: generate test coverage report
  • integration-test: start daemon, test API endpoints, verify LLM + budget

Code Quality & Analysis

  • deps: audit dependencies for vulnerabilities (--audit, --ignore RUSTSEC-ID) and check outdated
  • codegen: generate OpenAPI spec, TypeScript bindings, etc.
  • check-links: check for broken links in documentation
  • license-check: check dependency licenses for compliance
  • loc: lines of code statistics with per-crate breakdown
  • api-docs: generate Swagger UI site from OpenAPI spec
  • validate-config: validate ~/.librefang/config.toml syntax

Data & Infra

  • db: database management (info, backup, reset)
  • migrate: migrate agents from other frameworks (OpenClaw, OpenFang)
  • update-deps: batch update Rust and web dependencies
  • contributors: generate contributors SVG and star history SVG (replaces Python scripts)

CI Migration

  • ci.yml: quality job uses cargo xtask fmt + cargo xtask ci --no-test --no-web
  • ci.yml: security job uses cargo xtask deps --audit --ignore ...
  • update-contributors.yml: uses cargo xtask contributors
  • release-shell.yml: npm/PyPI publish steps use xtask commands

Code Quality

  • Extract duplicated repo_root() from 27 files into shared common.rs module (-450 lines)
  • All &PathBuf&Path (clippy ptr_arg), div_ceil, too_many_arguments fixes
  • Fix db.rs WAL cleanup path construction bug
  • Delete migrated scripts: generate_contributors.py, generate_star_history.py, publish-npm-binaries.sh, publish-pypi-binaries.sh

Usage

cargo xtask --help                              # list all 31 commands
cargo xtask ci                                  # full local CI
cargo xtask ci --no-test --no-web               # build + clippy only
cargo xtask fmt --fix                           # auto-fix formatting
cargo xtask deps --audit --ignore RUSTSEC-2024-0001
cargo xtask release --version 2026.3.2214 --no-confirm
cargo xtask contributors --repo librefang/librefang
cargo xtask publish-npm-binaries --version $VER --tag $TAG

Test plan

  • cargo clippy -p xtask --all-targets -- -D warnings passes (zero warnings)
  • cargo xtask --help shows all 31 subcommands
  • cargo xtask ci --no-test --no-web runs build + clippy
  • CI workflows pass with xtask commands
  • Justfile recipes cover all 31 commands

houko added 2 commits March 22, 2026 22:02
Set up clap-based CLI dispatcher with module stubs for:
- release, build-web, ci, changelog, sync-versions, integration-test
- release: full release flow (changelog + sync-versions + commit + tag + PR)
- build-web: build dashboard, web frontend, and docs site via pnpm
- ci: local CI suite (cargo build + test + clippy + web lint)
- changelog: generate CHANGELOG.md from merged PRs via gh CLI
- sync-versions: sync CalVer across Cargo.toml, JS/Python/Rust SDKs, Tauri
- integration-test: start daemon, test endpoints, verify LLM + budget
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added the area/ci CI/CD and build tooling label Mar 22, 2026
houko and others added 15 commits March 22, 2026 22:10
…ipts

- Add tag-exists cleanup: delete old tag, branch, and GitHub Release
- Add Dev.to article generation (skipped for pre-releases or --no-article)
- Include changelog section and diff link in PR body
- Scope README version replacement to [dependencies] blocks only
- Show git status --short on dirty worktree error
- Fix step order: article generation before dashboard build
- Add --repo librefang/librefang to all gh commands
- Add Claude CLI article polishing (env -u CLAUDECODE)
…deps, validate-config, pre-commit, api-docs)

Also fix missing skillhub_cache field in test_app.rs.
…h-npm-binaries, publish-pypi-binaries)

- Replace generate_contributors.py + generate_star_history.py with `cargo xtask contributors`
- Replace publish-npm-binaries.sh with `cargo xtask publish-npm-binaries`
- Replace publish-pypi-binaries.sh with `cargo xtask publish-pypi-binaries`
- Update CI workflows to call xtask instead of scripts
- Delete migrated scripts
Add the file inbox section to the init template so `librefang init` includes
it, and document the feature with config reference, usage examples, and
use cases in both English and Chinese configuration pages.
@github-actions github-actions Bot added the area/docs Documentation and guides label Mar 22, 2026
houko and others added 6 commits March 23, 2026 00:39
…generation

Adds `librefang hash-password` CLI command so users can generate
Argon2id hashes directly instead of relying on the login-and-copy-from-logs
workflow. Also updates zh configuration docs with dashboard_pass_hash
field documentation and migration guide.
- Quality job: cargo xtask fmt + cargo xtask ci --no-test --no-web
- Security job: cargo xtask deps --audit with --ignore support
- Add --ignore flag to deps command for RUSTSEC advisory exclusions
- Remove separate cargo-audit install step (xtask auto-installs)
@houko houko changed the title feat(xtask): build automation CLI with 6 subcommands feat(xtask): comprehensive build automation CLI with 31 subcommands Mar 22, 2026
@houko houko merged commit 30ccc64 into main Mar 22, 2026
@houko houko deleted the feat/xtask-automation branch March 22, 2026 16:17
This was referenced Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci CI/CD and build tooling area/docs Documentation and guides

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant