# Scientific Surfing A CLI for surfing the internet scientifically, written in Go. ## Features - **Clash RSS Subscription Support**: Download and transform clash rss subscriptions - **Hook System**: Customizable scripts for extending functionality - **Core Configuration Management**: Import, export, and manage core configurations - **Binary Management**: Automatic updates for core (mihomo) components - **Service Management**: Install/start/stop/reload mihomo as a system service on Linux (systemd), macOS (launchd), and Windows (native Service Control Manager) ## Installation ### 1. Clone and build ```bash git clone ssh://git@gitea.epss.net.cn:2223/klesh/ss.git cd ss go build -o ss ./cmd/ss ``` This produces a single `ss` (or `ss.exe` on Windows) binary with no runtime dependencies — templates and hook scripts are embedded in the binary. ### 2. Add the binary to your system PATH ## Quick Start ### Subscription Management ```bash # add a subscription ss subscription add # refresh a subscription (with optional backup) ss subscription refresh [--backup] # delete a subscription ss subscription rm # rename a subscription ss subscription rename # update subscription URL ss subscription set-url # show the URL for a subscription ss subscription get-url # activate a subscription ss subscription activate # list all subscriptions ss subscription list # show storage information ss subscription storage ``` ### Hook Management ```bash # initialize hooks directory with template scripts ss hook init # show hooks directory location and list all scripts ss hook list # edit a hook script with system editor ss hook edit # remove a hook script ss hook rm ``` ### Core Configuration Management ```bash # import configuration from file ss config import [--config-file ] # export configuration to file ss config export [--config-file ] # edit configuration with system editor ss config edit [--config-file ] # reset configuration to default values ss config reset [--config-file ] # show current configuration ss config show [--config-file ] # apply subscription to generate final config (with advanced options) ss config apply \ [--config-file ] \ [--output-file ] \ [--subscription ] ``` **Options** (available on every `ss config` subcommand): - `--config-file `: Use a custom config file instead of the default. - `--output-file `: Specify the output path for the generated config file. - `--subscription `: Use a specific subscription (not just the active one) for config generation. ### Core Management ```bash # update mihomo core binary ss core update [--version ] [--force] ``` ### Service Management ```bash ss service install [--name ] [--description ] ss service uninstall [--name ] ss service start [--name ] ss service stop [--name ] ss service restart [--name ] ss service reload [--name ] # reload config via mihomo's API, no restart ss service status [--name ] ``` Linux / macOS (installing the service needs root): ```bash sudo env SF_CONFIG_DIR=$HOME/basicfiles/cli/ss ss service install ``` Windows (run from an elevated/Administrator shell): ```powershell $env:SF_CONFIG_DIR = "$HOME\basicfiles\cli\ss" ss.exe service install ``` ## Development ```bash go build ./... go vet ./... go test ./... ``` ## License MIT License - see LICENSE file for details.