steam-shortcuts
A portable Python library and command-line tool for adding non-Steam shortcuts to a local Steam profile without GUI automation.
It edits only Steam's per-user binary userdata/<steam-id>/config/shortcuts.vdf, never localconfig.vdf. Before replacing an existing shortcut file it creates a timestamped sibling backup, uses an atomic replacement, then rereads the VDF and verifies the exact shortcut it added.
Steam must be fully closed before using add. The tool refuses to write if it detects the main steam or steam.exe process. It will not murder Steam for you; that is a feature, not a missing feature.
Status and support
- Windows is the primary acceptance target for Windows executable paths.
- Steam discovery supports Windows registry/default locations, common Linux locations (including Flatpak), and macOS.
- If a Steam root has multiple numeric profiles,
--steam-idis required. The tool never guesses an account. - Archive mode safely supports already-installed game directories in
.tar,.tar.gz/.tgz,.tar.bz2, and.tar.xzfiles. - The tool does not add artwork, modify Steam Cloud or
localconfig.vdf, restart Steam, launch games, configure Proton, or drive the Steam UI.
Install
Install the CLI into an isolated pipx environment:
pipx install steam-shortcuts
steam-shortcuts --help
Use it as a library in another Python project:
python -m pip install steam-shortcuts
Command-line use
First, inspect the local Steam installation and profiles:
steam-shortcuts detect --json
steam-shortcuts list --steam-id 123456789 --json
Add a Windows executable. Quote the shell argument normally; do not add the internal Steam quotes yourself:
steam-shortcuts add \
--steam-id 123456789 \
--name "My Game" \
--exe "D:\Games\My Game\Game.exe" \
--start-dir "D:\Games\My Game" \
--args "--windowed" \
--tag "Local" \
--json
Use --dry-run first whenever you are doing something unusual. It validates Steam discovery, profile selection, the executable, duplicates, and the planned fields without writing a VDF or backup:
steam-shortcuts add \
--steam-id 123456789 \
--name "My Game" \
--exe "D:\Games\My Game\Game.exe" \
--dry-run --json
For portable or nonstandard installs, give the Steam root — the directory that contains userdata, not the VDF file itself:
steam-shortcuts add \
--steam-root "E:\PortableSteam" \
--steam-id 123456789 \
--name "My Game" \
--exe "D:\Games\My Game\Game.exe"
A successful JSON result includes status, profile_id, shortcuts_path, a 32-bit shortcut ID, steam://rungameid/..., and backup_path. Rerunning the exact name/executable combination returns already_exists and creates no backup. Reusing an executable under a different display name is deliberately a conflict rather than a surprise duplicate.
Restart Steam normally after a successful add so it reloads shortcuts.vdf; then the item should appear in the library.
Archive mode (Steam Deck / local installs)
Archive mode is for a tar containing an already-installed game directory. It never runs setup.exe, does not unpack FreeArc .bin installer payloads, and does not execute Wine, Proton, 7z, or another installer. Supported inputs are standard tar formats: .tar, .tar.gz / .tgz, .tar.bz2, and .tar.xz.
Use a new directory on the Deck's local storage as the extraction destination. Start with a dry run; it inspects archive metadata and Steam's VDF but does not extract files or write a shortcut:
cd "$HOME/Games"
steam-shortcuts add \
--name "My Game" \
--archive "$HOME/media-nas/My Game.tar" \
--extract-to "$HOME/Games/My Game" \
--exe-relative "My Game/Game.exe" \
--dry-run --json
Run the same command without --dry-run after reviewing the JSON plan:
steam-shortcuts add \
--name "My Game" \
--archive "$HOME/media-nas/My Game.tar" \
--extract-to "$HOME/Games/My Game" \
--exe-relative "My Game/Game.exe" \
--json
--extract-to must not already exist; the archive is extracted through a private staging directory and is never merged over an existing game. When omitted, the destination defaults to <current-working-directory>/<archive-stem>, so running the command from ~/Games with Game.tar extracts to ~/Games/Game. Use an explicit local destination when the archive itself lives on a NAS.
--exe-relative is relative to the archive root and always uses / separators. It is required when more than one non-installer .exe exists. If exactly one eligible .exe exists, the tool chooses it and reports selection: "single_candidate"; common installer names such as setup.exe, install.exe, and unins*.exe are never selected automatically. Ambiguous archives fail before extraction and print the candidate paths plus the --exe-relative recovery option.
When every archive member is inside one top-level directory, archive mode removes that wrapper while extracting. For example, Decktamer/Decktamer.exe inside Decktamer.tar, with --extract-to "$HOME/Games/Decktamer", becomes $HOME/Games/Decktamer/Decktamer.exe, not $HOME/Games/Decktamer/Decktamer/Decktamer.exe. JSON reports that decision as archive_root: "Decktamer". Archives with root-level regular files keep their original layout and report archive_root: null.
After Steam restarts, configure a Proton compatibility version in Steam if the selected executable is a Windows game. Registering a Windows executable does not magically make it a Linux game. Shocking, I know.
Python API
from pathlib import Path, PurePosixPath
from steam_shortcuts import add_shortcut, add_shortcut_from_archive
result = add_shortcut(
name="My Game",
executable=Path(r"D:\Games\My Game\Game.exe"),
start_dir=Path(r"D:\Games\My Game"),
launch_options="--windowed",
tags=("Local",),
steam_id="123456789", # omit only when exactly one profile exists
)
print(result.status, result.run_game_url, result.backup_path)
archive_result = add_shortcut_from_archive(
name="My Game",
archive=Path("/home/deck/media-nas/My Game.tar"),
extract_to=Path("/home/deck/Games/My Game"),
executable_relative=PurePosixPath("My Game/Game.exe"),
steam_id="123456789",
)
print(archive_result.shortcut.status, archive_result.inspection.executable)
The API and CLI run on the same local user account that owns the Steam profile. They do not communicate with a Steam account, web API, or remote computer.
Recovery
For an existing VDF, every successful mutation creates a sibling backup named like:
shortcuts.vdf.bak.20261112T020000Z
If Steam rejects or does not show an added shortcut:
- Fully exit Steam.
- Preserve the current
shortcuts.vdffor investigation instead of deleting it. - Replace it with the timestamped
.bak.*file from the same directory. - Start Steam and verify the prior library state.
A malformed VDF is rejected without overwriting it. Keep that file and its error message; it is evidence, not clutter.
Development
python -m venv .venv
.venv/bin/python -m pip install -e ".[dev]"
.venv/bin/python -m pytest -q
.venv/bin/ruff check .
.venv/bin/mypy src
.venv/bin/python -m build
See docs/acceptance-test.md for the real Steam-client validation procedure.
Public releases
Public releases are created by pushing a semantic version tag such as v0.2.1. The release workflow rebuilds the package, runs tests, linting, and type checks, then publishes with PyPI Trusted Publishing through GitHub OIDC. It intentionally contains no long-lived PyPI API token.
Before tagging a new release, verify the PyPI Trusted Publisher matches project steam-shortcuts, GitHub owner msrodrigobr, repository steam-shortcuts, workflow filename publish.yml, and the protected GitHub environment pypi.
Metadata
Release files for steam-shortcuts 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| steam_shortcuts-0.2.1.tar.gz | 29.2 kB | Without provenance | Details for steam_shortcuts-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| steam_shortcuts-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for steam_shortcuts-0.2.1-py3-none-any.whl |
Total release size: 51.9 kB
Release files / steam_shortcuts-0.2.1.tar.gz
| Download URL | steam_shortcuts-0.2.1.tar.gz |
|---|---|
| Size | 29.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d04f767bfa1867fb2a8444c80598c5e6d0dd1e1ca4c7936f85828feeeb8d7f2
|
|
BLAKE2b-256 checksum How to use checksums |
deec5e93517ee33a59d14bc3f546426be64a0b04654841facb995b1897b68720
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.9
|
Release files / steam_shortcuts-0.2.1-py3-none-any.whl
| Download URL | steam_shortcuts-0.2.1-py3-none-any.whl |
|---|---|
| Size | 22.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b06fa4ca0759c2d2733990f3c3915bd65b89ff5208a878bc976c30ff0e6cd30a
|
|
BLAKE2b-256 checksum How to use checksums |
71e42c0a9cf7af1e2d27145f37824477e3a08853e60634a0218a264edc088727
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.9
|
Security for steam-shortcuts 0.2.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.