chsrc is a cross-platform command-line tool that changes package manager and software repository URLs to faster or local mirrors across Linux, macOS, Windows, and BSD. It functions as a source mirror framework, embedding a database of mirror URLs and metadata directly into its binary at build time, eliminating the need for plugins or runtime downloads.
The tool distinguishes itself through idempotent configuration patching, rewriting repository configuration files deterministically so repeated runs produce the same result and restoration is always possible. It includes a latency probe that measures TCP connection time to available mirrors and automatically selects the fastest one without user intervention, and supports scoped source changes at the project, user, or system level depending on the target's configuration capabilities.
chsrc provides a unified interface for switching software sources, listing supported targets and mirrors, restoring default upstream URLs, and applying specific mirrors from a list or custom URL. Its architecture abstracts every package manager's config format behind a single command-line interface and a common source-switching API, using platform-agnostic shell commands and file writes to modify system configuration files across operating systems.