Switch npm, pip, or cargo to a Chinese mirror server with one command instead of editing config files manually.
Configure a Linux system's apt or Arch AUR package sources to use a faster regional mirror.
Speed up package downloads on macOS, Windows, or Linux when default servers are slow due to geographic distance.
Use on Android, BSD, or RISC-V systems to configure package manager sources that would otherwise require manual file editing.
Primarily designed for users in China where default package server speeds are slow, works globally but offers the most benefit for regional mirror switching.
chsrc is a command-line tool that lets you switch the download source for software packages and programming language tools on your computer. When you install packages using tools like npm, pip, cargo, or your operating system's package manager, those packages are downloaded from a server. For users in certain regions, particularly China, the default servers can be slow. Mirror servers exist that host the same files and are geographically closer, but finding and manually configuring the right mirror for each tool is tedious. chsrc does that configuration for you with a single command. Instead of editing config files by hand for each tool, you run one command and specify which tool's source you want to change. According to the README, it supports over 65 targets, covering programming language package managers, operating system package sources, and other tools. The tool works across a wide range of platforms: Linux, Windows (including MSYS2 and Cygwin environments), macOS, BSD, and Android. It supports multiple CPU architectures including x64, ARM, and RISC-V. The README notes it was written in C rather than Python or JavaScript specifically to avoid requiring a large runtime just to do a simple source-switching task. Installation varies by platform. On macOS you can use Homebrew. On Windows, Scoop or WinGet work. On Linux, packages are available for apt-based systems and the Arch Linux AUR. Prebuilt binaries are also available for direct download on all supported platforms. The project is open source under a GPL-3.0 license combined with MIT for some parts. The README is written primarily in Chinese, reflecting the project's main audience.
← rubymetric on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.