ModSync/For guide authors/Command line
Command line
The modsync command uses the same engine as the desktop app. It is handy for checking guides, scripting installs and authoring. Run modsync --help, or modsync <command> --help, for every option.
Getting the command
The default build includes the desktop app and the command line. For a command-line-only binary:
cargo build --release --no-default-features
./target/release/modsync --help
From a source checkout you can also run any command as cargo run -- <command>.
Commands at a glance
| Command | What it does |
|---|---|
gui | Opens the built-in ModSync window, optionally with a guide and folders filled in. |
list | Lists the components in a guide. |
validate | Checks a guide against your folders without changing anything. |
install | Validates, snapshots, then installs. |
restore | Puts the folders back after an unfinished install. |
completion-summary | Reads the saved result of the last install. |
conflicts | Reports game files written by more than one component. |
convert | Converts between guide formats and drafts instructions from Markdown. |
merge | Merges two guides. |
download | Downloads one archive over HTTPS and checks it. |
download-plan | Shows which filenames a component would take from a download page. |
fetch-downloads | Fetches the downloads for the selected components of a guide. |
torrent-seed, torrent-download | Share or fetch one exact archive by BitTorrent. |
profile | Creates, lists, captures, applies and activates saved profiles. |
builds | Lists, adds, removes and fetches mod builds, including the KOTOR Community builds. |
import-archive | Turns a loose mod archive into a one-mod guide you can install. |
detect-games | Finds KOTOR installs on this computer. |
mod-info | Shows a DeadlyStream or Nexus Mods page's description and screenshots. |
deadlystream-sign-in, deadlystream-status, deadlystream-sign-out | Keep a DeadlyStream sign-in for downloads, check it, or forget it. |
Validate and install
modsync list KOTOR1_Full.toml
modsync validate --input KOTOR1_Full.toml --game-dir /path/to/game --source-dir /path/to/mods
modsync install --input KOTOR1_Full.toml --game-dir /path/to/game --source-dir /path/to/mods
--input is the guide, --game-dir the game folder and --source-dir the folder with the downloaded archives. Add --json to validate for a machine-readable report.
Choosing components
- By default every top-level component is selected, as in ModSync.
--use-file-selectionuses the guide'sIsSelectedvalues instead. The desktop can save your selections as a TOML file that this reads.--select NAME_OR_GUID, repeated or with several values, picks specific components.--option GUID, repeated, turns on options. The guide's option defaults still apply.
When the selection changes to satisfy dependencies or your game version, a Selection: line says what was added or removed. Incompatible selections stop validation.
More install options
--scratch-dir <folder>,--max-expanded-bytes <bytes>- Choose an existing folder outside both install folders for temporary archive storage, and set an optional size budget per archive.
--pause-file <file>- While the file exists, the run holds at the next safe point, between downloads or between components. Delete it to carry on.
--install-progress-json- Writes one JSON progress object per line to standard output. Only
installaccepts it, and it cannot be combined with--json. --direct-markdown- Installs from a prose Markdown guide. See Drafting from a Markdown guide.
--managed,--no-managed- Managed deployment is off unless you pass
--managedtogether with--component-checkpoints.--no-managedis accepted for a classic install.
Patchers and programs
Steps that run a patcher or another program need --allow-processes. The built-in OdyPatcher library is used by default. To use a patcher program instead:
modsync install --input guide.toml --game-dir /path/to/game --source-dir /path/to/mods \
--allow-processes --patcher /path/to/odypatcher
Pick HoloPatcher or KPatcher with --patcher-engine holo-patcher or --patcher-engine k-patcher. The patch files are staged in a private copy, so the mod's original configuration is left alone. If a patch fails, its error and warning lines and the end of its log are printed before the error.
Programs run directly, without a shell, with your user permissions. Windows programs need a Windows host.
Restore and results
modsync restore --game-dir /path/to/game --source-dir /path/to/mods
modsync completion-summary --game-dir /path/to/game --source-dir /path/to/mods --json
restore only works on an unfinished install, and checks the snapshot before and after restoring. See Safety and recovery.
File conflicts
modsync conflicts --input guide.toml --source-dir /path/to/mods --game-dir /path/to/game
The JSON report lists each game file, the components that write it in install order, the last writer, and a conflict count per component. It accepts the same selection and archive options as validate, and changes neither folder. It cannot predict what outside programs will write.
Converting guides
modsync convert instructions.toml instructions.json
modsync convert --input guide.toml --output guide.xml --format xml
modsync convert --stdin --format yaml < guide.json
Conversion writes standard ModSync instruction files in any of the supported formats. Markdown drafting options are covered in Instruction files.
Downloads
modsync download https://example.org/mod.zip /path/to/mods/mod.zip --sha256 EXPECTED_HASH
Direct HTTPS downloads of ZIP, 7z, RAR, TAR and GZip files are checked before saving. A web page, a damaged archive, an unsafe file name or a checksum mismatch fails, and an existing file is never overwritten. Deadlystream and Nexus Mods pages and MEGA links stay browser downloads.
modsync download-plan guide.toml --component <GUID> \
--url https://example.com/mod --source-dir /path/to/mods \
--filename first.zip --filename alternative.zip
download-plan reports which of the offered filenames the component would use. It downloads nothing and is not a readiness check.
Builds and sign-in
modsync builds list
guide=$(modsync builds fetch --key KEY_FROM_LIST)
modsync fetch-downloads --input "$guide" --source-dir /path/to/mods --game-dir /path/to/game
builds keeps the community builds and any links you add, with a saved copy of each. To download DeadlyStream files that need an account, sign in once with the password in MODSYNC_DEADLYSTREAM_PASSWORD and --save; only the signed-in session is kept. See Builds and accounts.
modsync deadlystream-sign-in --username YOUR_NAME --save
modsync import-archive ~/Downloads/SomeMod.7z --source-dir /path/to/mods --output somemod.toml
BitTorrent sharing
A guide maintainer can share one exact archive:
modsync torrent-seed <archive> --tracker <http-announce-url>
It prints JSON with the magnet link, the SHA-256 and torrentInfo, then seeds until Ctrl+C. The guide records all three (Magnet, ContentHashSHA256, TorrentInfo). A player fetches it with:
modsync torrent-download '<magnet-uri>' <output> --sha256 <digest> --torrent-info <base64>
The torrent must hold one archive. It is downloaded to temporary storage, must match the SHA-256, is checked as an archive, and never overwrites an existing file.
Privacy. By default peer traffic goes through a SOCKS5 proxy, so peers see the proxy's address rather than yours, but the proxy operator can see your traffic. Choose one with --peer-proxy socks5://IP:PORT, or let ModSync try a public list. With no working proxy the command fails without connecting to peers. --no-proxy connects directly, and peers then see your IP address.
To share under an identity the guide already records, use --authored-magnet '<magnet>' --torrent-info <base64>. Sharing stops after 24 hours or an upload ratio of 1.0 (--share-hours, --share-ratio), and uploads are capped at 100 KiB/s (--upload-kibps).
Profiles
Profiles store the guide path, the folders and your selections, as JSON.
modsync profile --action create --name "Full Build"
modsync profile --action list --json
modsync profile --action capture --name "Full Build" \
--input guide.toml --game-dir /path/to/game --source-dir /path/to/mods
modsync profile --action apply --name "Full Build" --input guide.toml --output selected-guide.toml
modsync profile --action activate --name "Full Build"
show and delete take --name; clone and rename take --from and --to. Use a profile directly to validate or install:
modsync validate --profile "Full Build"
modsync install --active-profile
Explicit --input, --game-dir, --source-dir, --select and --option flags override the profile. Profiles live in a ModSync folder in your system's settings location unless you pass --settings-dir.