# 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 make build ``` This produces a single `ssm` (or `ssm.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 ssm subscription add # refresh a subscription (with optional backup) ssm subscription refresh [--backup] # delete a subscription ssm subscription rm # rename a subscription ssm subscription rename # update subscription URL ssm subscription set-url # show the URL for a subscription ssm subscription get-url # activate a subscription ssm subscription activate # list all subscriptions ssm subscription list # show storage information ssm subscription storage ``` ### Hook Management ```bash # initialize hooks directory with template scripts ssm hook init # show hooks directory location and list all scripts ssm hook list # edit a hook script with system editor ssm hook edit # remove a hook script ssm hook rm ``` ### Core Configuration Management ```bash # import configuration from file ssm config import [--config-file ] # export configuration to file ssm config export [--config-file ] # edit configuration with system editor ssm config edit [--config-file ] # reset configuration to default values ssm config reset [--config-file ] # show current configuration ssm config show [--config-file ] # apply subscription to generate final config (with advanced options) ssm config apply \ [--config-file ] \ [--output-file ] \ [--subscription ] ``` **Options** (available on every `ssm 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 ssm core update [--version ] [--force] ``` ### Service Management ```bash ssm service install [--name ] [--description ] ssm service uninstall [--name ] ssm service start [--name ] ssm service stop [--name ] ssm service restart [--name ] ssm service reload [--name ] # reload config via mihomo's API, no restart ssm service status [--name ] ``` `install`/`uninstall`/`start`/`stop`/`restart` need root/admin privileges: - **Linux / macOS**: just run the command directly — `ssm` re-execs itself under `sudo` automatically, prompting for your password if needed. - **Windows**: run from an elevated/Administrator shell — `ssm.exe service install`. ## Development ```bash make build # build ssm for the current platform make test # go test ./... make vet # go vet ./... make fmt # check formatting (gofmt -l) make help # list all targets ``` ### Releasing ```bash make release VERSION=v1.0.0 ``` Cross-compiles for linux/amd64, darwin/arm64, and windows/amd64, and packages each into `dist/` as a `.tar.gz`/`.zip` alongside a `checksums.txt`. Pushing a `vX.Y.Z` tag runs the same thing via `.drone.yml` and publishes the artifacts as a Gitea release. ## License MIT License - see LICENSE file for details.