نصب MirrorMan
برای نصب پروژه، ابتدا ریپوزیتوری را کلون کنید:
# Clone the repository
git clone https://github.com/solamente0/mirrorman.git
cd mirrorman
# Make executable (Linux/macOS)
chmod +x bin/mirrorman.sh
sudo ln -s $(pwd)/bin/mirrorman.sh /usr/local/bin/mirrorman
# Install shell aliases
mirrorman alias install
برای ویندوز، از PowerShell استفاده کنید:
# Add to PATH or call directly
.\bin\mirrorman.ps1 help
استفاده در Linux و macOS
# لیست همه میرورها
mirrorman list
# اسکن سریعترین میرور برای Python
mirrorman scan python
# اعمال دائمی میرور
mirrorman set python tsinghua
# نمایش وضعیت فعلی
mirrorman status
# بازگشت به حالت پیشفرض
mirrorman reset python
استفاده در Windows (PowerShell)
# لیست میرورها
.\mirrorman.ps1 list
# اسکن سرعت
.\mirrorman.ps1 scan python
# اعمال دائمی
.\mirrorman.ps1 set python tsinghua
# اعمال موقت (فقط برای این session)
.\mirrorman.ps1 set npm taobao -Temp
# بازگشت به پیشفرض
.\mirrorman.ps1 reset npm
استفاده موقت (بدون تغییر دائمی)
برای اجرای یک دستور با میرور خاص، بدون تغییر تنظیمات سیستم:
# یک دستور با میرور موقت
mirrorman use python tsinghua -- pip install requests
# npm با میرور taobao
mirrorman use npm taobao -- npm install express
# go get با میرور چینی
mirrorman use golang goproxy_cn -- go get golang.org/x/tools
# یا از alias های پیشفرض
pip-cn install requests
npm-cn install express
go-cn golang.org/x/tools
افزودن میرور سفارشی
میتوانید میرور اختصاصی سازمان یا خود را اضافه کنید:
# افزودن میرور اختصاصی
mirrorman add python corporate "PyPI شرکت
ما" https://pypi.company.com/simple/
# سپس مثل بقیه استفاده کنید
mirrorman set python corporate
# میرورهای سفارشی در این فایل ذخیره میشوند:
# ~/.config/mirrorman/custom_mirrors.json
یا مستقیماً فایل JSON را ویرایش کنید و میرور دلخواه اضافه کنید.