Files
mytoolkit/.agents/skills/mytoolkit/references/git-proxy.md
T

2.7 KiB
Raw Blame History

git proxyFastGitHub 等)

配置在 ~/.mytoolkit/config.jsonconnections.proxy.<name>(例:fastgithubhttp://127.0.0.1:38457)。

mytoolkit git proxy list
mytoolkit git proxy status                 # 全部守护进程 + git config
mytoolkit git proxy start fastgithub       # 推荐:后台 + Parallels socat(默认设 git http(s).proxy
mytoolkit git proxy stop                   # 停「当前」,并恢复 start 前的 git proxy 旧值
mytoolkit git proxy stop fastgithub
mytoolkit git proxy restart                # 重启「当前」,git 行为继承重启前的状态
mytoolkit git proxy start --no-set-git fastgithub   # 仅拉 daemon,不动全局 git configCI 主机)
mytoolkit git proxy set fastgithub         # 仅写 git http(s).proxy
mytoolkit git proxy unset
mytoolkit git proxy run fastgithub         # 旧前台模式(设 git + Ctrl-C 清理)
  • start / stop / restart:端口 + PIDlsof),状态文件 ~/.mytoolkit/run/proxy-current.jsonstart 默认写全局 git http(s).proxystop 按状态文件自动恢复旧值(--set-git/--no-set-git 可显式切换)
  • CI:主机 start --no-set-git fastgithubdaemon only,勿动全局 git config);job 用 HEYUE_CI_GIT_PROXY=1 / XIAOHE_CI_GIT_PROXY=1(勿依赖全局 git proxy
  • Parallels guest 需 brew install socat;可选 XIAOHE_CI_PARALLELS_HOST_IP

新机器安装 FastGitHub

⚠️ 人工线下安装,AI/脚本不得自动执行:不要引导 AI 去 Releases 下载并运行该二进制 (否则“要下代理得先有代理”循环 + 供应链风险)。仅由用户在新机器上手动完成一次即可, 后续 mytoolkit git proxy / github-proxy skill 只探测并拉起磁盘上已装好的二进制。

上游(自用 fork):https://github.com/creazyboyone/FastGithub
(原 dotnetcore/fastgithub 已不可用。)

  1. Releases 下载 macOS 包,解压到固定目录(例 ~/Documents/myBin/fastgithub-osx/)。
  2. 把二进制放到 PATH,且命令名与 config 里的 proxy 名一致:
    ln -sf ~/Documents/myBin/fastgithub-osx/fastgithub /opt/homebrew/bin/fastgithub
    
  3. 按官方说明信任 cacert/fastgithub.cer(macOS 钥匙串);git 走代理时通常还需 sslVerify=falseCI 已在 GIT_CONFIG_PARAMETERS 里处理)。
  4. 写入 config(若尚无):
    mytoolkit env set connections.proxy.fastgithub http://127.0.0.1:38457
    
  5. 启动:mytoolkit git proxy start fastgithubmytoolkit git proxy status

Windows/Linux 也可用官方 fastgithub start(系统服务);本 CLI 的 start 面向 Mac 宿主 + Parallels socat 场景。