explaingit

chikacya/anywhere-rules

13PythonAudience · ops devopsComplexity · 2/5ActiveSetup · easy

TLDR

Subscription rule library in .arrs format for the Anywhere proxy client, auto-converted daily from the blackmatrix7 ios_rule_script upstream.

Mindmap

mindmap
  root((anywhere-rules))
    Inputs
      Upstream Surge rules
      Daily GitHub Action
      User subscription URL
    Outputs
      .arrs rule files
      Common rule set
      Catalog markdown
    Use Cases
      Subscribe to curated proxy rules
      Add per-service routing rules
      Self-host a rules mirror
    Tech Stack
      Python
      GitHub Actions
      Anywhere client
      Surge format

Things people build with this

USE CASE 1

Subscribe to the curated common rule set inside the Anywhere proxy client on iOS or macOS

USE CASE 2

Add a specific service rule from rules/all/ for granular routing control

USE CASE 3

Fork the repo and tune the daily Actions workflow for your own rule mirror

USE CASE 4

Read the conversion script to learn how Surge rules map to .arrs format

Tech stack

PythonGitHubActionsAnywhereSurge

Getting it running

Difficulty · easy Time to first run · 5min

You only need to paste a raw GitHub URL into the Anywhere client, but the .arrs format drops rule types like URL-REGEX and PROCESS-NAME during conversion.

In plain English

This repository is a subscription rule library for a proxy client called Anywhere. Anywhere is a separate project, built in Swift, that acts as a native proxy client on Apple platforms. It supports protocols such as vless, trojan, hysteria, shadowsocks, and http. To decide which network traffic should go through the proxy and which should not, Anywhere needs routing rules. This repo provides those rules in a specific text format with the file extension .arrs, which stands for Anywhere Routing Rule Set. The rules are organized into two folders. The folder rules/common/ holds a curated set of common rules that most users can subscribe to directly. The folder rules/all/ holds a much larger collection, converted from a well-known upstream rule project called blackmatrix7/ios_rule_script, and is aimed at users who want fine-grained control over many specific services. Two catalog files, rules/common/catalog.md and rules/catalog.md, list what is available in each folder. To use the rules, a user copies a raw GitHub link to one of the .arrs files into the Anywhere app. The README shows the link pattern for both common rules and the full rule set. There is no installation step beyond pasting the URL into the client. The content is kept fresh by a GitHub Actions workflow defined in .github/workflows/update-rules.yml. It runs every day at 04:18 Shanghai time, and can also be triggered by hand. The workflow converts the upstream Surge rules into the .arrs format, builds the common rule set, and commits any changes back to the repository automatically. The README is honest about limits. Anywhere only understands domain suffix, domain keyword, IPv4 CIDR, and IPv6 CIDR rules. Other rule types from upstream sources, such as URL-REGEX, PROCESS-NAME, USER-AGENT, and IP-ASN, cannot be expressed and are skipped during conversion, with a note written into the header of each generated file. The repo also thanks the upstream rule projects it depends on and states that its own role is only format conversion and tidying.

Copy-paste prompts

Prompt 1
Walk me through subscribing to rules/common/ inside the Anywhere proxy app
Prompt 2
Explain why URL-REGEX and PROCESS-NAME rules from upstream Surge sources cannot be converted
Prompt 3
Edit the GitHub Actions workflow to also run at 16:18 Shanghai time
Prompt 4
Write an .arrs rule that routes all traffic for a custom domain through the proxy
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.