TSParams
A simple Python utility to reconstruct the tailscale up command arguments based on the current system preferences. It reads the output of tailscale debug prefs and generates the corresponding command string, handling specific logic for routes, DNS settings, and exit nodes.
Features
The script currently parses and handles the following Tailscale parameters:
| CLI Value | Default |
|---|---|
--accept-routes |
false |
--accept-dns=false |
true |
--advertise-routes |
[] |
--advertise-exit-node |
false |
Installation
Arch Linux (AUR)
The package is available in the Arch User Repository.
https://aur.archlinux.org/packages/tsparams
You can install it using your preferred AUR helper, for example:
yay -S tsparams
More installation methods to come.
Manual Installation
Since this is a Python script, it does not require compilation.
- Download the script
tsparams.py. - Rename it to
tsparams(optional, but recommended for command usage). - Make it executable:
chmod +x tsparams - Place it in a directory included in your
$PATHvariable.
System-wide installation:
sudo cp tsparams /usr/bin/tsparams
Local installation (recommended for non-root users):
mkdir -p ~/.local/bin
cp tsparams ~/.local/bin/tsparams
Ensure ~/.local/bin is in your PATH.
Building
This project is a pure Python script. No building or compilation steps are required. Simply ensure the file has execute permissions and is placed in a directory accessible by your shell. Refer to the Installation section for details.
Usage
Run the command directly. It will execute tailscale debug prefs internally, parse the JSON output, and print the reconstructed command string to stdout.
tsparams
Example Output:
If your current Tailscale preferences have CorpDNS set to false and are advertising the route 192.168.1.0/24, the output will look like this:
tailscale up --accept-dns=false --advertise-routes=192.168.1.0/24
If you are advertising an exit node (0.0.0.0/0) and a specific route:
tailscale up --advertise-exit-node --advertise-routes=192.168.1.0/24