Menu

Explicit commands. Readable results.

For terminals, scripts and AI. Begin with the CLI quick start.

On this page

Find cor

Desktop installers include the core, Geo and CLI; no extra runtime is required. Android does not provide this desktop CLI.

SystemEntry
LinuxInstall the appropriate DEB, RPM or Arch package, then run cor.
WindowsThe installer adds PATH by default. Reopen your terminal and run cor. If you turned the option off, run cor.exe from the installation directory.
macOSOpen Clash of Rust from Applications once. Run cor in a new login shell, or run Contents/MacOS/cor inside the app bundle.
cor version
cor help
cor help all
cor help profile add

Add --help to any command to see its usage.

Backend and proxy

cor start
cor status
cor mode rule
cor proxy tun
cor restart
cor stop

start runs in the background after the terminal closes. run is foreground debugging tied to that terminal. Proxy methods are system, tun and off; modes are rule, global and direct.

An existing GUI shares its backend. Status, node lists, connection queries, service status, help and version do not start the backend or core. TUN uses system authorization; --yes does not replace administrator permission.

cor env --shell bash prints proxy environment statements without changing the parent shell. --unset prints removal statements. See the runtime reference ↗.

Profiles

cor profile add home 'https://example.com/subscription'
cor profile use home
cor profile list
cor profile update --all
cor profile import ./subscription.yaml --name local
cor profile export home --output profile.yaml
cor profile source home --view runtime
cor profile remove local --yes

Use a full ID or unique name; duplicates require an ID. Import from a local path or stdin. Failed updates keep the old configuration. Updating all returns nonzero if any item fails while preserving successful updates.

Credentials are hidden by default. A complete backup requires --show-secrets and careful storage. Default direct cannot be removed; removing the active profile falls back to it. See profile editing and file boundaries ↗.

Nodes and policy chains

cor node list
cor node select
cor node select PROXY '🇺🇸 US 01'
cor node test --group PROXY
cor node test --all

Replace example groups and nodes with real names from your profile. The interactive picker accepts filters, numbers, / to clear, and q or EOF to cancel; it requires a running core. Scripts and JSON must supply GROUP NODE. Quote values containing spaces in your shell.

Offline lists read the saved profile and mark offline=true, source=saved_profile; they do not claim live selections or latency. Status may show a reference chain such as PROXY → AUTO → node. Use connection details for actual per-request exits.

Rules

cor rule list --json
cor rule add 'DOMAIN-SUFFIX,example.com,DIRECT' --position 1
cor rule shortcut ads on

Edit, move, toggle or remove custom rules. Use stable IDs from the list in scripts. Positions start at 1; duplicates and core configuration are validated before saving. Subscription rules stay read-only and original YAML is not rewritten.

Quick rules are ads, private-domain, private-ip, cn-domain and cn-ip, all initially disabled. --profile selects a particular profile.

Connections and logs

cor connection list
cor connection show CONNECTION_ID
cor --jsonl connection list --watch --sort download-rate
cor logs --follow

Replace CONNECTION_ID with a real list ID. Queries do not start the core. When stopped, a one-time list is empty and marked offline; details and continuous queries explain unavailability. cor connection close CONNECTION_ID closes one connection; its app may reconnect.

Nodes, connections and rules accept --limit and --offset: default 100, maximum 10000, after filtering and sorting. Review logs for domains and IPs before sharing.

Checks and Claude protection

cor network check example.com
cor network check example.com --json
cor network tls example.com --output tls-report.json
cor ip-check --category AI --output ai-report.json
cor claude protect on --yes
cor claude protect off --yes

See network tools for all checks, options and report states. Checks do not implicitly start the core or turn failure into a direct-route success. Protection or unknown protection state disables system probes that could bypass it.

Protection pins a node and strict TUN, locks network changes and keeps appearance and read-only access available. Disabling restores previous settings. It does not guarantee third-party service acceptance.

Environment and browser checks

cor claude check --output claude-report.json
cor claude audit --offline --output claude-projects.json
cor claude browser --open --output browser-report.json
cor claude watch

check gathers network and region clues. audit --offline reads the current terminal and recorded project configuration without making detection requests. browser --open opens a local sampling page and requires a real browser; SSH sessions without one do not produce invented results. These checks do not read account cookies or login tokens.

watch observes protection coverage and related connections until Ctrl+C. A completed check returning 0 means execution finished; read report fields for availability and risk.

Configuration

cor config get
cor config set theme_mode dark
cor config set subscription_update_interval_minutes 720
cor config set update_check_interval_minutes 0

Subscription and update intervals use minutes: 0 disables, default 360, maximum 10080. A pure CLI backend does not add an automatic software-check task. cor help config set lists writable fields; shared validation still applies.

cor config check
cor config effective --output effective.yaml

check validates the merged configuration. effective exports runtime YAML with overrides included and credentials redacted by default. The original profile stays intact. Sensitive values require an explicit --show-secrets.

cor config override edit
cor config override check ./merge.yaml
cor config override apply ./merge.yaml --state on

Run edit in an interactive terminal to open the multiline editor. Scripts can use check to validate a file and apply to save it. Both accept - for stdin. Running apply --state off alone disables the override and keeps its text. cor guide prints the website guide address in the current language.

The same account shares GUI data by default. --data-dir and --resources choose separate data and resources; keep them for queries, updates and diagnostics. Linux root can select a user with --user; this does not make TUN a user-isolated network.

Software and Geo updates

cor update check
cor update install
cor update status
cor geo status
cor geo update

Stable releases are the default. cor config set update_prereleases true includes newer previews. The actual target is shown before confirmation; only preview targets carry a preview warning. Installer and Geo updates validate data and keep recovery evidence on failure.

When the GUI is closed, Linux DEB and official Arch installations can authorize and wait in the terminal using dpkg and pacman -U respectively. Success starts the backend and core. Failure restores the previous state. Use --no-start to preserve whether the core was running. Update Fedora and openSUSE RPMs with DNF and Zypper respectively.

For graphical installers, use cor update status to check the final result. On unattended systems, use cor update download --output FILE with the filename and extension for your platform, then ask an administrator to install the downloaded package. --timeout N extends slow-network waits. The default is 300 seconds and the maximum is 3600.

Autostart and services

cor service install --yes
cor service status
cor service remove --yes

This configures CLI backend startup at the current user's login; use start now. Linux uses a systemd user unit, macOS a LaunchAgent, Windows a current-user login task. This is not a system service before login.

Status separates configuration, enablement, running state and backend ownership; unobserved values remain unknown. autostart on controls desktop background startup. Choose one method. Removing autostart does not stop the current core.

Scripts and exit codes

cor --json status
cor --json node list
cor --jsonl status --watch

The JSON envelope has schema, command and data. Results go to stdout; progress, authorization and errors go to stderr. Choose either --json or --jsonl, with the latter for continuous samples.

CodeMeaning
0Success or a closed downstream pipe. Check report fields for actual availability.
1Operation, validation or permission failure.
2Invalid command or arguments.
3Backend failed to start or is unreachable.
124Request timeout.
130Query interrupted.

completion bash, zsh, fish and powershell print completion scripts. --no-color gives plain text. AI should read JSON and exit codes rather than guess screen coordinates.

Export diagnostics

cor diagnose --output cor-diagnose.json
cor diagnose --offline --output cor-offline.json

Diagnostics never starts the backend or restores TUN. Export offline when the backend is unreachable. Keep the original account, --user, --data-dir and --resources. Nothing uploads automatically; review domains, IPs and logs before sharing.

See the CLI reference ↗ for all options, permissions and user isolation. Control keys belong to the local interface; do not share control.json.