Skip to main content

Sing-Box CLI

🎤 Cross-platform sing-box service manager.

help

Install

uv

Windows

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Linux

curl -LsSf https://astral.sh/uv/install.sh | sh

sing-box-cli

Install

# windows
uv tool install sing-box-cli
# linux
uv tool install sing-box-cli
sbc install

On Linux, sbc install installs both sbc and sing-box-cli into /usr/local/bin, requesting sudo only to write those system launchers. It replaces the old manual symlinks and can be run again safely. Use --bin-dir PATH to select another existing executable directory. Unrelated files are preserved.

The system launchers use Python -B, so commands such as sudo sbc service enable do not create root-owned __pycache__ files in your uv environment. Run the install command as your normal user after installing the tool. Do not run uv tool install, uv tool upgrade, or uv run with sudo.

Install with specific sing-box version

uv tool install sing-box-cli --with sing-box-bin==x.y.z

Upgrade

uv tool upgrade sing-box-cli

Linux launchers continue to use the same environment after a normal uv upgrade. Run sbc install again if you move or change the installation environment.

After upgrading on Windows, run the following in an administrator PowerShell:

sbc service enable
sbc service status

This refreshes the installed service paths and migrates existing NSSM installations to the native Go service host, keeping the same sing-box-service name and account. An existing running service is stopped and restarted when its executable paths change. If that update fails, the old service target is restored and the error is reported.

The native host and core are copied into versioned directories under %ProgramFiles%/sing-box-cli/sing-box-service. The running service does not depend on uv's environment, so future uv upgrades do not overwrite its running executables. Configuration files stay in their existing location. Windows services run at boot; closing the terminal does not stop them. Linux continues to use the existing systemd service.

No Go installation is required when installing a published wheel. Go is needed only to build a wheel from source; the required version is in windows-service/go.mod. Architecture support follows sing-box-bin: Windows distributes the amd64 core and service helper; Linux distributes amd64 and arm64 cores. No additional CPU architectures are introduced by the service helper.

Logs

The service uses the user's sing-box configuration without changing its log level. Set log.level to info or warn in that configuration to reduce generated logs. sbc logs --log-level debug selects the logs to view; it cannot recover debug entries that the core did not generate. For diagnostics, explicitly change the core's log level and restart, then restore it when finished.

The native Windows host writes only warnings/errors to the Windows Application event log (source sing-box-service-native). Core stdout/stderr is kept as a bounded diagnostic tail for failures, without an additional debug log file. To persist core logs, use sing-box's log.output configuration; streaming sbc logs continues to use the core API. Old versioned executables are retained for rollback. After disabling the service, its directory under Program Files may be removed manually; user configuration is separate.

Run

Windows in Admin powershell

sbc --help

Linux

sudo sbc --help

Serve private GitHub configurations

Set GH_TOKEN (or GITHUB_TOKEN) with Contents: read access to your private repository, then run as your normal user:

sbc config serve add https://github.com/owner/private-configs --domain sub.example.com
sbc config serve list
sbc config serve start
sbc config serve stop

list prints URLs for valid root .json configurations. The server reads GitHub through its API without cloning; start runs in the background at 127.0.0.1:8080 by default. Use --host and --port for another listening address.

Point Traefik at the server using this example. Clients continue to use the existing update command:

sbc config update https://sub.example.com/alice.json --restart

See configuration server details for settings, logs and limits.

Metadata

Release files for sing-box-cli 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sing-box-cli 0.1.4
File Size Uploaded
sing_box_cli-0.1.4.tar.gz 48.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sing-box-cli 0.1.4
File Interpreter ABI Platform
sing_box_cli-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / sing_box_cli-0.1.4.tar.gz

Download URL sing_box_cli-0.1.4.tar.gz
Size 48.1 kB
Tags Source
SHA-256 checksum
How to use checksums
913fd72d062bab8ee691b283c272f0a8b44436f70293b2dd0292bad3f52a940d
BLAKE2b-256 checksum
How to use checksums
66b6c3fc6c5ef65d68500e926c4f10eeedebf6f15e58cd8eb36a86d92df3fd53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / sing_box_cli-0.1.4-py3-none-any.whl

Download URL sing_box_cli-0.1.4-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
d6dd9c78e90b1e6e08e70c6fe70c831315d0c7549ae51e87d33c90216cdd6ccc
BLAKE2b-256 checksum
How to use checksums
8cdb0a4d7f0de47d12bd70edfa488600da21c88923e8c4ea4bbf06d500171135
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.59

2 release files

0.0.58

2 release files

0.0.56

2 release files

0.0.55

2 release files

0.0.53

2 release files

0.0.52

2 release files

0.0.51

2 release files

0.0.48

2 release files

0.0.46

2 release files

0.0.42

2 release files

0.0.41

2 release files

0.0.40

2 release files

0.0.37

2 release files

0.0.36

2 release files

0.0.35

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.31

2 release files

0.0.30

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page