gitmyhub

chsrc

C ★ 6.8k updated 5d ago

chsrc 全平台通用换源工具与框架. Change Source everywhere for every software

A command-line tool that switches software package download sources to faster regional mirror servers with a single command, supports 65+ tools including npm, pip, cargo, and OS package managers across Linux, Windows, and macOS.

Csetup: easycomplexity 1/5

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.

Where it fits