Total Pageviews

Thursday, 20 August 2026

翻墙工具ClashTui

 Mihomo (Clash.Meta) / sing-box TUI Client

Release Pre-release License Build PR Release CI

clashtui_demo.webm

Language: English | 中文

ClashTui is a terminal user interface (TUI) proxy management tool supporting both Mihomo (Clash.Meta) and sing-box proxy cores. Switch nodes, update subscriptions, manage connections, and control services — all from the terminal.

Features

  • Dual Core Support — Compatible with both Mihomo and sing-box; switch anytime in the UI
  • Subscription Management — Supports File, URL, and Template (ClashTui template) profile types
  • Proxy Switching — Switch by group or by node, with latency testing
  • Connection Monitoring — View all active connections in real time; close individual or all connections
  • Service Control — Manage core start, stop, and restart via systemd
  • Log Viewing — View core logs in real time within the interface
  • CLI Mode — Supports profile, mode, service, update subcommands for scripting and automation
  • Config Override — Override final config via core_override_config without modifying original subscription files
  • Template System — Auto-generate config files using templates + proxy node groups, with variable expansion (recommended for sing-box to avoid configuration version issues)
  • Custom Key Bindings — Customize shortcuts for each tab via keymap.yaml
  • Custom themes - user-definable via theme.yaml
  • which panel - convenient for user operations
  • Supports fzf - users can use fzf for selection

Supported Platforms

  • Linux
  • macOs
  • Windows

Installation

Requirements

Linux and macOS:

  • sudo
  • fzf

Windows:

  • nssm

With root access (for TUN mode)

Linux

  1. [Optional] Install mihomo and clashtui from your package repository:
sudo pacman -S mihomo sing-box clashtui  # ArchLinux. (Note: the latest clashtui may not be uploaded yet — please build and install it manually)

This step ensures mihomo, sing-box, and clashtui are available in your environment so the install script will skip downloading them. You can also download them manually and run which mihomo sing-box clashtui to verify they are correctly configured.

  1. Run the install script:
bash <(curl -fsSL https://raw.githubusercontent.com/JohanChane/clashtui/refs/heads/main/installs/install) --core all

Tip: The install script downloads resources from GitHub. If downloads keep failing, try enabling a proxy before running the script.

  1. [Optional] Enable clashtui_mihomo.service / clashtui_singbox.service on boot:
sudo systemctl enable clashtui_mihomo.service
# OR
sudo systemctl enable clashtui_singbox.service

macOS

  1. [Optional] Install mihomo and clashtui from Homebrew:
brew install mihomo sing-box clashtui  # Note: the latest clashtui may not be uploaded yet — please build and install it manually
  1. Run the install script (same as Linux):
bash <(curl -fsSL https://raw.githubusercontent.com/JohanChane/clashtui/refs/heads/main/installs/install) --core all
  1. [Optional] Enable clashtui_mihomo / clashtui_singbox launchd plists on boot:
sudo launchctl load -w /Library/LaunchDaemons/clashtui_mihomo.plist
# OR
sudo launchctl load -w /Library/LaunchDaemons/clashtui_singbox.plist

Windows

  1. [Optional] Install mihomo and clashtui from Scoop:
scoop install mihomo sing-box clashtui  # Note: the latest clashtui may not be uploaded yet — please build and install it manually
# Verify
Get-Command mihomo sing-box clashtui

This step ensures mihomo, sing-box, and clashtui are in PATH so the install script will skip downloading them.

  1. Run the install script (as Administrator):
# Default install to D:\ClashTui
irm https://raw.githubusercontent.com/JohanChane/clashtui/refs/heads/main/installs/install.ps1 | iex

# Custom directory (no spaces allowed)
iex "& {$(irm https://raw.githubusercontent.com/JohanChane/clashtui/refs/heads/main/installs/install.ps1)} -Core all -InstallDir 'D:\MyTools\ClashTui'"

# Only install mihomo core
iex "& {$(irm https://raw.githubusercontent.com/JohanChane/clashtui/refs/heads/main/installs/install.ps1)} -Core mihomo"
  1. Start clashtui, then use CoreSrvCtl to install and start core services:

The install script does NOT register Windows Services. Launch clashtui and use the built-in CoreSrvCtl to manage services. Enable only one core service at boot (do not enable both simultaneously).

Without root access (no TUN)

Linux

bash <(curl -fsSL https://raw.githubusercontent.com/JohanChane/clashtui/refs/heads/main/installs/install) --core all --is-user

Enable on boot:

systemctl --user enable clashtui_mihomo.service
# OR
systemctl --user enable clashtui_singbox.service

macOS

bash <(curl -fsSL https://raw.githubusercontent.com/JohanChane/clashtui/refs/heads/main/installs/install) --core all --is-user

Enable on boot:

launchctl load -w ~/Library/LaunchAgents/clashtui_mihomo.plist
# OR
launchctl load -w ~/Library/LaunchAgents/clashtui_singbox.plist

FAQ

  • File permission issues: Since clashtui requires group permissions, please log in again for the group permissions to take effect.
  • Connection refused issues (e.g., with mihomo): Please use netstat -utapln | grep 9090 to check whether the Clash API port is open.

Documentation

Document Description
Getting Started Detailed usage guide: UI operations, CLI, subscription management, config reference, FAQ
Manual Installation Step-by-step manual installation for system/user mode
Feature Design Feature design: config structure, subscription management, Template expansion, sing-box merge algorithm
Architecture Code architecture: module structure, startup flow, TUI event loop, Tab system
Development Conventions Branch naming, commit format, CHANGELOG conventions

from  https://github.com/JohanChane/clashtui

No comments:

Post a Comment