Skip to content

HibariX/clash-verge-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cvg

cvg is a Rust CLI/TUI for operating a local Clash Verge runtime through the Mihomo controller API.

It focuses on the practical control surface you actually use day to day:

  • Runtime status and mode inspection
  • Proxy group and node switching
  • Delay testing
  • Clash Verge subscription inspection and maintenance
  • A keyboard-driven TUI for everyday use

This project is not affiliated with Clash Verge Rev. It works against a local Mihomo controller exposed by Clash Verge or a compatible Mihomo setup.

Features

  • CLI commands for:
    • status
    • mode get|set
    • proxy groups
    • proxy use <group> <node>
    • profile ls
    • profile show <uid|name|current>
  • TUI pages for:
    • Home
    • Groups
    • Profiles
    • Settings
  • Automatic controller discovery:
    • local Mihomo socket
    • Clash Verge config.yaml controller config
  • Simplified Chinese UI by default
  • Subscription add flow that only requires a URL
    • subscription name is inferred automatically from provider metadata or URL host

Current Scope

cvg currently focuses on runtime control and direct editing of Clash Verge subscription files.

What it does well now:

  • Inspect and control Mihomo runtime state
  • Switch nodes in proxy groups
  • Run delay tests in the TUI
  • Read and maintain Clash Verge subscriptions from the terminal

What it does not fully solve yet:

  • App-level Clash Verge profile switching through a dedicated bridge
  • System proxy / service / lightweight mode management

Requirements

  • Rust stable toolchain
  • A local Clash Verge / Mihomo runtime
  • On Unix-like systems, cvg will first try the local Mihomo socket at /tmp/verge/verge-mihomo.sock

Build

cargo build

To run directly from source:

cargo run -- tui

To install the binary locally:

cargo install --path .

Usage

cvg status
cvg mode get
cvg mode set rule
cvg proxy groups
cvg proxy use GLOBAL "Bronze-新加坡-01"
cvg profile ls
cvg profile show current
cvg tui

Global connection options:

cvg --controller http://127.0.0.1:9097 --secret <secret> status
cvg --socket /tmp/verge/verge-mihomo.sock status
cvg --clash-verge-dir "/path/to/clash-verge-config" profile ls

Connection Resolution Order

cvg resolves the runtime controller in this order:

  1. --socket
  2. --controller with optional --secret
  3. Clash Verge local socket auto-discovery
  4. Clash Verge config.yaml HTTP controller discovery

TUI

Core navigation:

  • Tab / Shift+Tab: switch pages
  • j / k: move selection
  • h / l: switch pane or page
  • r: refresh
  • q: quit

Home

  • Runtime overview
  • Current selected subscription / group / node
  • Active route summary

Groups

  • Browse proxy groups and nodes
  • Switch selected node with Enter
  • Run delay tests with d or D
  • Cycle node sorting with s

Profiles

  • Add remote subscription with a
  • Edit selected remote subscription with e
  • Update selected remote subscription with u
  • Update all remote subscriptions with U
  • Delete selected subscription with d

Settings

  • Switch UI language and persist it immediately

Development

cargo fmt --all
cargo check

License

MIT. See LICENSE.

About

Rust CLI/TUI for controlling a local Clash Verge runtime through the Mihomo controller API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages