Skip to content

User Guide ​

Profiles Enhanced Mode ​

Clash Verge Rev currently supports 4 types of configuration profiles: Remote, Local, Script, and Merge. Among them, Remote and Local are main profiles, while Script and Merge are enhanced profiles used to modify the main profiles. Click "New" to create these profiles (see screenshot below). For Remote profiles, you can also directly import by entering the URL. (Note: This mode is inspired by CFW.)

image

Remote Configuration ​

Only Clash format configuration URLs are supported. The response body must follow the Clash config format (UTF-8 encoded). If the response headers include the Subscription-Userinfo field, traffic usage will be displayed. Remote profiles can be updated by clicking the refresh button at the top-right corner.

Local Configuration ​

After creating a local profile, right-click and select Open File to open the config file (by default, it opens with VS Code; if not found, the default editor is used). After editing the local file, right-click and choose Use to refresh the config.

Merge Processing ​

This profile type is used to append or prepend fields to the main profile. The file format is .yaml. This idea is borrowed from CFW’s pre-processing method. Currently, six types of operations are supported. Enable it by Right-click -> Enable, and click refresh after modifying the file to trigger changes.

Supported operations:

  • prepend-rules: Merges with rules at the beginning.
  • append-rules: Merges with rules at the end.
  • prepend-proxies: Merges with proxies at the beginning.
  • append-proxies: Merges with proxies at the end.
  • prepend-proxy-groups: Merges with proxy-groups at the beginning.
  • append-proxy-groups: Merges with proxy-groups at the end.
  • Other Clash fields: The default five (rules, proxies, proxy-groups, proxy-providers, rule-providers) and additional Clash Meta fields can be directly overridden by specifying them.

Script Processing ​

This type allows using JavaScript to modify config files. The JS runtime is quickjs. The idea is derived from CFW’s Mixin/parser. Enable it via Right-click -> Enable, and click refresh after editing the file.

You must declare a main function with the following signature:

ts
main(params: object): object;

The function receives the current Clash config as a JavaScript object and must return the modified config.

If the script throws an error, its changes will be skipped, and the profile item will turn red with an error message.

The runtime environment is based on quickjs, so operations like file system access are not supported.

Example: processing ws config changes:

javascript
function main(config) {
  if (!config.proxies) return config;

  config.proxies.forEach((proxy) => {
    if (proxy.network === "ws" && (proxy["ws-path"] || proxy["ws-headers"])) {
      const opts = proxy["ws-opts"] || {};

      opts.path = proxy["ws-path"];
      opts.headers = proxy["ws-headers"];

      delete proxy["ws-path"];
      delete proxy["ws-headers"];
    }
  });

  return config;
}

Profile Processing Flow ​

First, choose a main profile. If none is selected, an empty default config is used. Then, if any Script or Merge enhanced profiles are enabled, they will be processed sequentially in chain—i.e., the output of one will be the input for the next.