clash-rule

command module
v0.0.0-...-2809214 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

README

Clash Rule Manager

A Go application to manage Clash proxy rules by updating GitHub Gists and Clash providers.

Features

  • Update rules for different categories (global-tv, direct, reject, trusted)
  • Modify GitHub Gists with new domain rules
  • Update Clash providers via API
  • Check rule update status

Usage

clash-rule <rule-type> <domain>

Supported rule types: global-tv, direct, reject, trusted

Requirements

  • Go 1.16+
  • GitHub personal access token (PAT)
  • Clash API access (configure URL and auth token in the code)

Installation

  1. Clone the repository
  2. Set up your GitHub PAT:
    • Option 1: Set environment variable: export GITHUB_TOKEN=your_token_here
    • Option 2: Store in ~/.gist_pat file
  3. Build the application: go build -o clash-rule

Configuration

Edit the constants in main.go to set:

  • Gist ID
  • Clash API URL
  • Clash API auth token

GitHub PAT

The application will look for the GitHub PAT in the following order:

  1. GITHUB_TOKEN environment variable
  2. ~/.gist_pat file

If using the file method, ensure it contains only the PAT and has appropriate permissions.

License

MIT License

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL