clash_tools documentation

GitHub Repository: sleeping-in-bed/clash_tools

PyPI version PyPI downloads Test status Codecov

clash_tools is a comprehensive collection of utilities for managing Clash proxy configurations and services. It provides multiple command-line tools for different purposes, making it easy to work with Clash in various environments.

Tools Overview

The toolkit includes four main utilities:

wg_docker

WireGuard docker orchestration for server/client deployments.

Key highlights: - WireGuard config directory: /var/lib/clash_tools/wireguard/ (override with CLASH_TOOLS_WG_CONFIG_DIR) - Clash config directory: /var/lib/clash_tools/clash/ (override with CLASH_TOOLS_CONFIG_DIR) - Renders server_wg0.conf/client_wg0.conf and docker compose files - Commands: server (up/down/restart/show/config/get-client-config), client (up/down/restart/config)

clash_docker

Docker proxy management tool for enabling/disabling Docker proxy settings

clash_proxy

Shell script for setting up proxy environment variables in the current session

clash_serve

Service management tool for starting the Clash service and managing configuration files

Features

  • 🚀 Docker Integration: One-click enable/disable Docker client and daemon proxy

  • 🔧 Environment Setup: Easy proxy environment variable configuration

  • 🎯 Service Management: Simple Clash service startup and management

  • 📊 Status Monitoring: Real-time proxy status checking

  • 🔄 Configuration Reset: Convenient reset functionality

  • 💻 Multi-platform: Works on Linux systems with systemd support

Quick Start

Installation:

pip install clash_tools

Basic Usage:

# Start Clash service
clash_serve

# Set proxy environment variables
source clash_proxy

# Configure Docker proxy
clash_docker enable

# Check Docker proxy status
clash_docker status

# Disable Docker proxy
clash_docker disable

Documentation

Indices and tables