Scientific Surfing

A Python package for surfing internet scientifically.

Features

  • Clash RSS Subscription Support: Download and transform clash rss subscription
  • Hook System: Customizable scripts for extending functionality
  • Core Configuration Management: Import, export, and manage core configurations
  • Binary Management: Automatic updates for core components

Installation

1. Clone into local

git clone ssh://git@gitea.epss.net.cn:2223/klesh/ss.git
cd ss
python -m venv .venv
./.venv/Scripts/activate
pip install -r requirements.txt

2. Add the root directory to system PATH

Quick Start

Subscription Management

# add a subscription
python -m ss subscription add <name> <clash-rss-subscription-url>

# refresh a subscription (with optional backup)
python -m ss subscription refresh <name> [--backup]

# delete a subscription
python -m ss subscription rm <name>

# rename a subscription
python -m ss subscription rename <name> <new-name>

# update subscription URL
python -m ss subscription set-url <name> <new-url>

# activate a subscription
python -m ss subscription activate <name>

# list all subscriptions
python -m ss subscription list

# show storage information
python -m ss subscription storage

Hook Management

# initialize hooks directory with template scripts
python -m ss hook init

# show hooks directory location and list all scripts
python -m ss hook list

# edit a hook script with system editor
python -m ss hook edit <script-name>

# remove a hook script
python -m ss hook rm <script-name>

Core Configuration Management

# import configuration from file
python -m ss core config import <file-path> [--config-file <config.yaml>]

# export configuration to file
python -m ss core config export <file-path> [--config-file <config.yaml>]

# edit configuration with system editor
python -m ss core config edit [--config-file <config.yaml>]

# reset configuration to default values
python -m ss core config reset [--config-file <config.yaml>]

# show current configuration
python -m ss core config show [--config-file <config.yaml>]

# apply subscription to generate final config (with advanced options)
python -m ss core config apply \
	[--config-file <config.yaml>] \
	[--output-file <output.yaml>] \
	[--subscription <subscription-name>]

Options:

  • --config-file <config.yaml>: Use a custom config file instead of the default.
  • --output-file <output.yaml>: Specify the output path for the generated config file.
  • --subscription <subscription-name>: Use a specific subscription (not just the active one) for config generation.

Core Management

# update scientific-surfing core components
python -m ss core update [--version <version>] [--force]

Service Management

Linux / macOS

sudo env SF_CONFIG_DIR=$HOME/basicfiles/cli/ss python3 -m ss core service install

Development

This project uses Poetry for dependency management:

poetry install
poetry run pytest

License

MIT License - see LICENSE file for details.

Description
Manage Clash Core (mihomo) via cli written in Python
Readme 395 KiB
Languages
Python 99.3%
JavaScript 0.7%