lucalin233/proxy/references
Claude Code and agent skill by lucalin233/proxy
- community
Checking that the SKILL.md file is still in the repository.
Control and troubleshoot the Surge proxy app through surge-cli. Use whenever a task involves Surge in any way — checking or changing its state (outbound mode, policy groups, profiles, modules, features), diagnosing network problems on a machine running Surge (DNS, routing decisions, proxy connectivity, Tailscale/WireGuard tunnels, gateway-mode clients), reading Surge logs, inspecting requests and traffic, adding temporary rules, running scripts, measuring performance, or writing and packaging a Surge plugin. Prefer surge-cli over GUI instructions or profile file edits for any Surge operation that the CLI can perform.
Install
npx vskill@latest install lucalin233/proxy/referencesSKILL.md
Surge CLI Operations
surge-cli is a full-featured control and diagnostics interface for Surge. It can answer most questions about a running Surge instance directly — prefer asking the CLI over guessing, reading profile files, or telling the user to click through the GUI.
Connecting
- Resolve the executable:
surge-cliinPATH, else
/Applications/Surge.app/Contents/Applications/surge-cli.
- Use the default rendered output — it is the supported interface for agents.
Pass --raw only when a documented field is missing from the rendered form.
- For a remote instance add
--remote host:port(IPv6:[addr]:port).
Supply the password via --password-stdin, SURGE_CLI_PASSWORD, or the terminal prompt — never in argv.
- The CLI is self-documenting:
surge-cli -hshows the command groups and
surge-cli help <command> (for example help rule match, help dump) shows detailed usage. Use it when unsure about syntax before falling back to the reference file.
surge-cli --check <path>validates a profile file without a running Surge.
For editor integration, surge-cli lsp provides offline stdio diagnostics; unknown [General] keys are reported as warnings. It is a persistent LSP server, not a one-shot validation command.
Picking the Right Command
Match the question to the command family; full semantics are in the Command Reference.
| Question / task | Commands | ||||||
|---|---|---|---|---|---|---|---|
| What is Surge's current state? | status, version, environment | ||||||
| Is the network itself healthy? | dump summary (passive snapshot; run it first), then `test v4-router\ | dns\ | encrypted-dns\ | external-ip\ | nat-type` for active probes | ||
| How would Surge route this request? | `rule match <host\ | url>; use rule explain` when the question is "why" — it walks every policy-group hop with its decision reason | |||||
| Is this proxy/policy working? | test-policy, test-policy-udp, test-group, test-policy-bandwidth; http probe <url> [policy] for a real end-to-end request | ||||||
| What is wrong with a Tailscale/WireGuard tunnel? | proxy-runtime-status "<policy-name>" (name from dump policy; a line-hash also works) — it exposes handshakes, DERP, Exit Node, and peer paths that nothing else shows | ||||||
| What is Surge resolving this to? | dns lookup <domain>, dns trace for the resolver log, geoip <ip> for GEOIP/IP-ASN database checks, flush dns | ||||||
| What happened just now? | log memory 500 (all levels, recent), log file 1000 (longer history), log watch (follow live), logbook, script-log | ||||||
| What connections/traffic exist? | `dump active\ | recent\ | request\ | traffic\ | traffic-stat\ | traffic-stat-host, watch request, watch speed, kill <id>` | |
| Change routing behavior now | mode set, global-policy set, policy-group set, rule temp add, set | ||||||
| Manage configuration | `profile list\ | current\ | diff\ | check\ | switch, module enable\ | disable, feature set, managed-profile update, external-resource update, reload` | |
| Gateway-mode client problems (macOS) | `device list\ | show, vmnet status\ | arp\ | ndp\ | ra, reconnect-device` | ||
| Memory / performance concerns | dump performance, dump rule-usage, benchmark rule-matching, benchmark encryption | ||||||
| Run or debug scripts | `script list\ | run\ | evaluate` | ||||
| Plugins | plugin ... — see Plugin Authoring Guide |
Daily Management
Task-oriented commands cover routine operations — use them instead of raw set key-paths whenever one exists, because they validate input and return the resulting state rather than a bare success:
feature set system-proxy / enhanced-mode wait for the actual state transition and fail if it does not complete. An invalid profile check sets a non-zero exit status, which makes it usable in automation.
Mutating State Safely
- Collect context before changing anything:
environment,dump policy,
dump profile as relevant. Re-run the same read command afterwards to verify the effect.
- For raw environment updates,
setaccepts multiplekey=valuepairs in one
command; use minimal key-path deltas. <nil> and (null) assign null. Key definitions are in section 4 of the Command Reference.
- For debugging sessions, prefer temporary rules over profile edits: they
take effect immediately, precede all profile rules, and vanish when Surge stops, so nothing needs cleanup.
Diagnostics Workflow
Start passive, then narrow down; do not jump straight to broad log searches.
statusanddump summary— profile, mode, warnings, interfaces, DNS.- Reproduce the routing decision offline with
rule match/rule explain,
and verify its inputs with dns lookup / geoip when a rule depends on resolution or IP databases.
- Test the selected policy (
test-policy,http probe). - For per-proxy internals — especially Tailscale and WireGuard —
proxy-runtime-status is the primary tool; collect it before log analysis.
- Only then use
log memory/log watchfor details, ordiagnosticsfor
the streaming self-check.
For gateway-mode (macOS) client connectivity, inspect the virtual interface directly: vmnet arp / vmnet ndp for neighbor resolution, vmnet ra for IPv6 RA takeover state, and device show <mac> for the client's records.
Streaming Commands
test-policy-bandwidth, benchmark encryption, test-ponte, diagnostics, log watch, and watch ... stream output: process incremental chunks, respect completion markers (hasMore=false or a command-specific completion payload), and never assume a single response frame. A subscribed watch may stay idle indefinitely; other stages time out after 60 seconds without progress.
Platform and Version Gates
- macOS-only:
profile list|check, alldeviceoperations,vmnet,
set-dhcp-device, managed-profile, update-profile, plugin (online subcommands), unattended-upgrade.
- Newer commands require a matching Controller protocol version on the Surge
side (rule/dns/http probe/security ban ≥20; geoip, dump performance|rule-usage|virtual-ip, benchmark rule-matching ≥22; vmnet ≥23; plugin ≥24). An older core answers Unknown command; check surge-cli version when targeting a remote or outdated instance.
Plugin Development
To write, test, or package a Surge plugin (JavaScript extensions; currently the ap-controller type), follow the Plugin Authoring Guide. The development loop is plugin load-unpacked → plugin parameters → plugin configure (runs the plugin's own validation) → check the device panel; plugin validate and plugin pack work offline without a running Surge.
Reference
- Command Reference — full command catalog,
subcommand semantics, environment key definitions, response envelope.
- Plugin Authoring Guide — package layout,
manifest schema, JavaScript API, testing, distribution.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsurge/skill/references/upstream-SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lucalin233/proxy/references)