Skip to main content

sing-box-config-converter

Generate a sing-box client config from a server config, with optional QR code output.

Supported protocols: hysteria2, shadowsocks, trojan

Requirements

  • Python 3.10+
  • uv

Quick Start with uvx

No installation required — run directly with:

uvx sing-box-config-converter server.json

With QR code support:

uvx --with "sing-box-config-converter[qr]" sing-box-config-converter server.json

Installation

uv sync --extra qr

The --extra qr flag installs qrcode[pil] for QR code support. Omit it if you don't need QR output.

Usage

uv run sing-box-config-converter <server_config> [server_address] [options]

Arguments

Argument Description
server_config Path to the sing-box server config JSON
server_address Public IP or hostname for clients to connect to. If omitted, auto-detected from the current machine

Options

Option Default Description
-o, --output client.json Output path for the generated client config
--use-tun off Use TUN inbound instead of mixed (SOCKS+HTTP)
--mixed-port random Port for mixed (SOCKS+HTTP) inbound
--show-terminal-qr off Print QR code as ASCII art in the terminal
--qr-dir — Directory to save QR code as a PNG image

Examples

Generate a client config (server address auto-detected):

uv run sing-box-config-converter /etc/sing-box/config.json

Specify the server address explicitly:

uv run sing-box-config-converter /etc/sing-box/config.json 203.0.113.42

Use TUN mode and save a QR code image:

uv run sing-box-config-converter config.json 203.0.113.42 --use-tun --qr-dir ./qr

Print a QR code in the terminal:

uv run sing-box-config-converter config.json --show-terminal-qr

If --show-terminal-qr QR code is too large to fit in the terminal, try --qr-dir to save QR code as a PNG, and use imgcat to display it:

uvx imgcat qr_client_config.png

Output

The generated client config includes:

  • Outbounds — one per supported inbound in the server config; wrapped in a urltest selector when there are multiple
  • DNS — fakeip for remote, 223.5.5.5 for local/direct
  • Route — DNS hijack, private IP bypass, sniff
  • Inbound — mixed (SOCKS5+HTTP) on a local port, or tun with auto_route

Notes

  • QR codes encode the full client config JSON. Large configs may exceed QR capacity; consider sharing the config file directly if the QR is unreadable.

Metadata

Release files for sing-box-config-converter 1.2.0

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-config-converter 1.2.0
File Size Uploaded
sing_box_config_converter-1.2.0.tar.gz 19.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sing-box-config-converter 1.2.0
File Interpreter ABI Platform
sing_box_config_converter-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 43.5 kB

Release files / sing_box_config_converter-1.2.0.tar.gz

Download URL sing_box_config_converter-1.2.0.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e7105aa13409585962adc889944fecaf097ac58a01f1e432a58b8ca8bcb361e1
BLAKE2b-256 checksum
How to use checksums
efaf9aa2fc0605d007e016af245663953c959867ae31c0a108a91c5d11ac6681
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 24, 2026.

Transparency log

Release files / sing_box_config_converter-1.2.0-py3-none-any.whl

Download URL sing_box_config_converter-1.2.0-py3-none-any.whl
Size 23.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1b09175ebcf3f9ebb0770b46a4d3ca8d73726cefe105c4f6d34f9b6721d7af4
BLAKE2b-256 checksum
How to use checksums
d901c7447627109b97b3d31d4294eab76d127e954efac8b5edd98ce2cc0902c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.0

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