explaingit

rubymetric/chsrc

6,720CAudience · developerComplexity · 1/5LicenseSetup · easy

TLDR

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.

Mindmap

mindmap
  root((chsrc))
    What It Does
      Switch mirror sources
      Single command config
      65+ tools supported
    Package Managers
      npm and pip
      cargo and apt
      OS package sources
    Platforms
      Linux and macOS
      Windows and BSD
      ARM and RISC-V
    Install
      Homebrew on Mac
      Scoop or WinGet
      Direct binary download
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Switch npm, pip, or cargo to a Chinese mirror server with one command instead of editing config files manually.

USE CASE 2

Configure a Linux system's apt or Arch AUR package sources to use a faster regional mirror.

USE CASE 3

Speed up package downloads on macOS, Windows, or Linux when default servers are slow due to geographic distance.

USE CASE 4

Use on Android, BSD, or RISC-V systems to configure package manager sources that would otherwise require manual file editing.

Tech stack

C

Getting it running

Difficulty · easy Time to first run · 5min

Primarily designed for users in China where default package server speeds are slow, works globally but offers the most benefit for regional mirror switching.

GPL-3.0 with some parts MIT, open source and free to use, but modifications you distribute must also be released as open source under GPL.

In plain English

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.

Copy-paste prompts

Prompt 1
Show me the chsrc command to switch my npm package source to a faster mirror and verify it worked.
Prompt 2
How do I use chsrc to change my pip download source on macOS, and how do I check which source it switched to?
Prompt 3
I'm setting up a fresh Linux server, walk me through using chsrc to configure all my package managers to use regional mirrors.
Prompt 4
What package managers and environments does chsrc support on Windows, including MSYS2 and Cygwin?
Open on GitHub → Explain another repo

← rubymetric on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.