GoForum🌐 V2EX

用 Codex vibe 了一个快速在命令行设置代理的工具

taozhiw · 2026-01-15 10:13 · 0 次点赞 · 1 条回复

很多时候在终端需要设置代理,每次都要手动打开软件复制,所以 vibe 了一个命令行工具,会自动嗅探常用的代理软件,运行命令后会自动将环境变量写入剪切板,粘贴下就能运行,也支持了关闭、测试谷歌连接状态等。

主要自己用,说不定有人能用上。分享出来。

只在 mac 做了真机测试

安装

curl -fsSL https://raw.githubusercontent.com/cj0x39e/p/main/install.sh | sh

使用方法

Command Purpose
p copy proxy env commands to clipboard
p on print shell commands to enable proxy
p off print shell commands to disable proxy
p status show detected proxy
p detect show detection details
p test test current proxy env with curl
p set 7890 save local HTTP proxy port
p --shell sh force output shell (sh, fish, ps)
p --version print version

仓库地址:

https://github.com/cj0x39e/p

1 条回复
liangdi · 2026-01-15 10:13
#1

我之前是用 shell function 搞的,确实可以做个见的程序来做,方便一些,我也去 vibe 一个 rust 的版本

添加回复
你还需要 登录 后发表回复

登录后可发帖和回复

登录 注册
主题信息
作者: taozhiw
发布: 2026-01-15
点赞: 0
回复: 0