Thanks to visit codestin.com
Credit goes to github.com

Skip to content
forked from SukkaW/zsh-proxy

🔩 An oh-my-zsh plugin to configure proxy

License

Notifications You must be signed in to change notification settings

LHyphen/zsh-proxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 

Repository files navigation

zsh-proxy

Author License

🔩 An oh-my-zsh plugin to configure proxy for some packages manager and software.

Installation

oh-my-zsh

Firstly, clone this repository in oh-my-zsh's plugins directory.

git clone https://github.com/sukkaw/zsh-proxy.git ~/.oh-my-zsh/custom/plugins/zsh-proxy

Secondly, activate the plugin in ~/.zshrc. Enable it by adding zsh-proxy to the plugins array.

plugins=(
    [plugins
     ...]
    zsh-proxy
)

Antigen

Antigen is a zsh plugin manager, and it support oh-my-zsh plugin as well. You only need to add antigen bundle sukkaw/zsh-proxy to your .zshrc with your other bundle commands if you are using Antigen. Antigen will handle cloning the plugin for you automatically the next time you start zsh. You can also add the plugin to a running zsh with antigen bundle sukkaw/zsh-proxy for testing before adding it to your .zshrc.


Congratulations! Open a new terminal or run source $HOME/.zshrc. If you see following lines, you have successfully installed zsh-proxy:

========================================
You should run following command first:
$ proxyctl init
========================================

Quick Start

After installation, initialize and configure the plugin:

# Initialize zsh-proxy (creates configuration directory)
proxyctl init

# Configure your proxy settings
proxyctl edit

# Enable proxy
proxyctl on

# Check status
proxyctl status

Default configuration uses 127.0.0.1:1080 for SOCKS5 proxy and 127.0.0.1:8080 for HTTP proxy. You can leave any field blank during configuration to use the default values.

Note: Currently zsh-proxy doesn't support proxy with authentication.

Unified CLI - proxyctl

zsh-proxy provides a unified proxyctl command for all proxy management operations. All functionality is accessible through intuitive subcommands.

Basic Operations

# Enable proxy with default profile
proxyctl on

# Enable proxy with specific profile (temporary for current session)
proxyctl on work

# Disable proxy
proxyctl off

# Check current IP
proxyctl ip

# Show current status
proxyctl status

Profile Management

zsh-proxy supports managing multiple proxy configurations (profiles) for different scenarios (work, home, VPN, etc.).

# List all available profiles
proxyctl list

# Create a new profile (will prompt for configuration)
proxyctl add work
proxyctl add home

# Edit a profile
proxyctl edit work

# Delete a profile
proxyctl delete old-profile

# Copy a profile
proxyctl copy home vpn

# Rename a profile
proxyctl rename default personal

# Show profile configuration
proxyctl show work

Default Profile Management

The default profile is used when you run proxyctl on without arguments or when starting a new shell session.

# Show current default profile
proxyctl default

# Set a new default profile
proxyctl default work

Note: Using proxyctl on <profile> only switches the profile for the current session. To make it permanent across sessions, use proxyctl default <profile>.

System Commands

# Initialize zsh-proxy (first-time setup)
proxyctl init

# Migrate from old configuration format
proxyctl migrate

# Update zsh-proxy plugin
proxyctl update

# Show help
proxyctl help

Migration Note: If you're upgrading from an older version, you'll be prompted to migrate your configuration on first use. Your existing settings will become the "default" profile, and old files will be backed up to ~/.zsh-proxy/legacy/.

Uninstallation

If you install zsh-proxy with Antigen, you need to remove antigen bundle sukkaw/zsh-proxy to disable the plugin. If you install zsh-proxy with oh-myzsh, you need to remove zsh-proxy item from plugin array, then run rm -rf ~/.oh-my-zsh/custom/plugins/zsh-proxy to remove the plugin.

And you can clean up files & folders created by zsh-proxy using following command:

$ rm -rf ~/.zsh-proxy

Supported

zsh-proxy currently support those package manager & software:

  • http_proxy
  • https_proxy
  • ftp_proxy
  • rsync_proxy
  • all_proxy
  • git (http)
  • npm & yarn
  • apt

Todo List

  • socks5 & http proxy with authentication.
  • check whether the program exist before enable proxy for it
  • proxy for sudo user (env_keep or sorts of things)
  • proxy for:
    • yum
    • pip
    • gradle
    • git with ssh
    • gem
  • no_proxy config
  • learn some from arch wiki

Author

zsh-proxy © Sukka, Released under the MIT License.
Authored and maintained by Sukka with help from contributors (list).

Personal Website · Blog · GitHub @SukkaW · Telegram Channel @SukkaChannel · Twitter @isukkaw · Keybase @sukka

About

🔩 An oh-my-zsh plugin to configure proxy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%