|
3 | 3 | `workshop-sync` is a command line tool for keeping a game server or client addon folder aligned |
4 | 4 | with one or more Steam Workshop collections. |
5 | 5 |
|
6 | | -The CLI expects one or more Workshop collection IDs, an addon output directory, and a Steam Web API |
7 | | -key. The API key can be passed with `--api-key` or provided through the `STEAM_WEB_API_KEY` |
8 | | -environment variable. Steam Web API keys can be created at |
9 | | -[steamcommunity.com/dev/apikey](https://steamcommunity.com/dev/apikey). |
| 6 | +## Prebuilt binaries |
10 | 7 |
|
11 | | -It reads the collections, resolves their child addons, downloads missing or outdated `.vpk` files, |
12 | | -and can remove old managed files that are no longer part of the requested collections. |
| 8 | +Prebuilt binaries for Linux, Windows, and macOS are available from the |
| 9 | +[continuous release](https://github.com/rihi/workshop-sync/releases/tag/continuous). This prerelease |
| 10 | +is rebuilt from the latest commit on `main`, so its files are replaced after every successful build. |
13 | 11 |
|
14 | | -```bash |
15 | | -cargo run -- --addons-dir ./addons --api-key <steam-web-api-key> 123456789 |
16 | | -``` |
17 | | - |
18 | | -Multiple collections can be synced in one run: |
| 12 | +Download the archive for your platform, extract it, and run `workshop-sync` (`workshop-sync.exe` on |
| 13 | +Windows). |
19 | 14 |
|
20 | | -```bash |
21 | | -cargo run -- -a ./addons -k <steam-web-api-key> 123456789 987654321 |
22 | | -``` |
| 15 | +## Usage |
23 | 16 |
|
24 | | -The tool stores managed addon files with names like: |
25 | | - |
26 | | -```text |
27 | | -workshopsync_<publishedfileid>_<hcontent_file>.vpk |
28 | | -``` |
29 | | - |
30 | | -On each run, it compares the requested Workshop addons with the managed files already in the addon |
31 | | -directory. Missing addons are downloaded, outdated addons are replaced, and files that no longer |
32 | | -belong to the requested collections are reported as stale. |
33 | | - |
34 | | -Stale files are only removed when `--delete-stale` is passed: |
| 17 | +Pass an addon directory, a [Steam Web API key](https://steamcommunity.com/dev/apikey), and one or |
| 18 | +more Workshop collection IDs: |
35 | 19 |
|
36 | 20 | ```bash |
37 | | -cargo run -- --addons-dir ./addons --api-key <steam-web-api-key> --delete-stale 123456789 |
| 21 | +workshop-sync --addons-dir ./addons --api-key <steam-web-api-key> --delete-stale 123456789 987654321 |
38 | 22 | ``` |
39 | 23 |
|
40 | | -Use `--dry-run` to print the sync plan without downloading, replacing, or deleting files: |
| 24 | +The command installs or updates addons from the specified collections and |
| 25 | +removes previously managed addons that are no longer included, effectively keeping the addon |
| 26 | +directory in sync with those collections. |
41 | 27 |
|
42 | | -```bash |
43 | | -cargo run -- --addons-dir ./addons --api-key <steam-web-api-key> --dry-run 123456789 |
44 | | -``` |
| 28 | +The API key can also be provided through the `STEAM_WEB_API_KEY` environment variable. |
45 | 29 |
|
46 | | -Downloads run concurrently. The default concurrency is 4 and can be changed with `--concurrency`. |
| 30 | +Useful options: |
47 | 31 |
|
48 | | -If a download fails after making progress, it is retried. `--max-stalled-retries` controls how many |
49 | | -failures without file growth are allowed before giving up on that addon. Logging uses the tracing |
50 | | -filter from `--log-level` or `RUST_LOG`, with `info` as the default. |
| 32 | +- `--dry-run` prints the planned changes without modifying files. |
| 33 | +- `--delete-stale` removes managed addons that are no longer in the collections. |
| 34 | +- `--concurrency <number>` sets the number of concurrent downloads (default: `4`). |
| 35 | +- `--max-stalled-retries <number>` limits retries for downloads that stop making progress. |
| 36 | +- `--log-level <filter>` sets the tracing filter and defaults to `info`. |
51 | 37 |
|
52 | | -Use `--help` to see all the available arguments: |
| 38 | +Run the built-in help for the complete argument list: |
53 | 39 |
|
54 | 40 | ```bash |
55 | | -cargo run -- --help |
| 41 | +workshop-sync --help |
56 | 42 | ``` |
0 commit comments