Skip to content

Conversation

@loonghao
Copy link
Owner

@loonghao loonghao commented Feb 11, 2026

Summary

This PR implements two RFCs plus a robust mirror/download system:

RFC 0031: Unified Structured Output

  • Unified OutputFormat enum (Text/Json/Toon) replacing previous fragmented enums (Table/Json/Yaml and Table/Json/Plain)
  • CommandOutput trait — commands implement Serialize + render_text() for format-agnostic output
  • OutputRenderer — selects between text/JSON/TOON based on global flags
  • Global --json and --format flags on the Cli struct with env var support (VX_OUTPUT, VX_OUTPUT_JSON)
  • vx-console OutputMode wiring — fixed ConsoleBuilder which accepted output_mode but discarded it; added output_mode field to Shell
  • Search command migration — rewritten to use CommandOutput trait with structured SearchOutput/SearchResult
  • GlobalListFormat — renamed local enum to avoid conflict with unified OutputFormat

RFC 0030: Provider Expansion (Tier 1)

6 new providers added:

Provider GitHub Repo Type License
fzf junegunn/fzf archive MIT
ripgrep (rg) BurntSushi/ripgrep archive MIT/Unlicense
fd sharkdp/fd archive MIT/Apache-2.0
bat sharkdp/bat archive MIT/Apache-2.0
yq mikefarah/yq binary MIT
starship starship/starship archive ISC

Region-Aware Mirror Support

Added robust mirror/proxy system for downloads in China region:

Architecture:

  • Shared region.rs module consolidating region detection logic (replaces duplicated code in http_client.rs)
  • Detection priority: VX_MIRROR_REGION env → VX_CDN env → CI detection → locale/timezone → default Global
  • Runtime trait extended with mirror_urls(), download_url_for_mirror(), build_download_url_chain()
  • Transparent fallback: region-matching mirrors tried first (sorted by priority), original URL as fallback
  • ManifestDrivenRuntime wired to load [[runtimes.mirrors]] from provider.toml

Mirror support for 8 providers:

Provider Mirror Source Priority Mirror URL
Node taobao (npmmirror) 100 npmmirror.com/mirrors/node
Node USTC 90 mirrors.ustc.edu.cn/node
PNPM taobao (npmmirror) 100 npmmirror.com/mirrors/pnpm
Yarn taobao (npmmirror) 100 npmmirror.com/mirrors/yarn
Go Google CN (official) 100 golang.google.cn/dl
Go USTC 90 mirrors.ustc.edu.cn/golang
Python npmmirror 100 cdn.npmmirror.com/binaries/python-build-standalone
Rust USTC 100 mirrors.ustc.edu.cn/rust-static/rustup/dist
Rust Tsinghua TUNA 90 mirrors.tuna.tsinghua.edu.cn/rustup/dist
UV GitHub proxy 100 ghgo.xyz (GitHub Release proxy)
Bun npmmirror 100 npmmirror.com/mirrors/bun

SKILL.md Updates

  • Added GitHub Actions integration documentation (basic usage, pre-install tools, project setup, full example, inputs/outputs)
  • Added Docker support documentation (Dockerfile examples, multi-stage build, GitHub Actions with Docker container)

Files Changed

  • 80+ files changed, ~3500 insertions
  • 6 new provider crates (24 new source files)
  • New region.rs shared module + region_tests.rs
  • Mirror support added to 8 provider runtimes
  • Updated existing tests for new enum variants

Testing

  • cargo check --workspace
  • cargo clippy --workspace ✅ (zero new warnings)
  • All 21 provider URL tests pass
  • New region detection tests added

…ion (RFC 0030)

RFC 0031 - Unified Structured Output:

- Add unified OutputFormat enum (Text/Json/Toon) replacing fragmented enums

- Add CommandOutput trait and OutputRenderer for format-agnostic output

- Add global --json and --format CLI flags with env var support

- Wire OutputMode into vx-console Shell and fix ConsoleBuilder

- Migrate search command to use unified output system

- Rename local GlobalListFormat to avoid conflict with unified enum

RFC 0030 - Provider Expansion (Tier 1):

- Add 6 new providers: fzf, ripgrep (rg), fd, bat, yq, starship

- Each with provider.toml manifest, URL builder, and unit tests

- Register all providers in workspace, vx-cli, and registry

- Total providers: ~55 (from ~49)
@loonghao loonghao closed this Feb 11, 2026
@loonghao loonghao reopened this Feb 11, 2026
@loonghao loonghao force-pushed the feat/unified-output-and-provider-expansion branch from 70d065e to 8a610b4 Compare February 11, 2026 11:55
@loonghao loonghao force-pushed the feat/unified-output-and-provider-expansion branch from 8a610b4 to 89dd863 Compare February 11, 2026 12:19
- Add shared region detection module (region.rs) with priority: VX_MIRROR_REGION > VX_CDN > CI detection > locale/timezone > Global

- Extend Runtime trait with mirror_urls(), download_url_for_mirror(), build_download_url_chain()

- Implement mirrors for node/pnpm/yarn/go/python/rust/uv/bun (8 providers)

- Wire ManifestDrivenRuntime to load mirrors from provider.toml

- Refactor http_client.rs to use shared region module

- Add region_tests.rs and update SKILL.md with GitHub Actions/Docker docs
@loonghao loonghao force-pushed the feat/unified-output-and-provider-expansion branch from cce23c1 to f141f72 Compare February 12, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant