Skip to content

banished-cli ​

Command-line tools for the game data of Banished. It has three commands: export-audio, nexus for mods from Nexus Mods, and banishedinfo for mods from banishedinfo.com.

export-audio ​

Decodes every sound of the game (every SoundBuffer resource, including the streamed music) to an MP3 file, and writes an index of them.

bash
cargo run -p banished-cli --release -- export-audio [WINDATA] [OUT]
ArgumentDefaultMeaning
WINDATAgame-data/original/WinDataThe folder with the game's .pkg files
OUTgame-data/derived/audioWhere the MP3 files and index.json go

It needs FFmpeg on the PATH, with the LAME MP3 encoder. The game's sounds are xWMA, which FFmpeg can decode. The command writes each sound as an xWMA file, and FFmpeg converts it to MP3 at 128 kbit/s.

The output keeps the folders of the game: for example, Audio\Animal\Chicken_version0 becomes OUT/Audio/Animal/Chicken_version0.mp3. index.json lists every sound:

FieldMeaning
resourceThe entry in the package
fileThe MP3 file, relative to OUT
sourceThe original file name, for example Audio\Animal\Chicken0.wav
secondsThe length
looping, streamedWhether the sound loops, and whether it is streamed (music)
channels, sample_rateThe format

The command stops with exit code 1 if any sound failed, and with exit code 2 if the arguments are wrong.

tools/extract-assets.sh runs this command when FFmpeg is installed. The game and the viewer do not need the MP3 files: they decode the sounds themselves with banished-wma. The files are for listening outside the game, and for comparison tests.

Git ignores game-data/. Never commit the exported sounds.

nexus ​

Search the Banished mods on Nexus Mods and install them into a WinData folder. This is not part of the original game, and it needs your own Nexus Mods API key for anything but searching (BANISHED_NEXUS_API_KEY, or NexusApiKey= in the game's settings file).

bash
cargo run --release -p banished-cli -- nexus search terrain
cargo run --release -p banished-cli -- nexus install 19 --to path/to/WinData
CommandEffect
nexus search TEXT [--sort downloads|endorsements|updated|name] [--page N]List matching mods
nexus files MOD_IDList a mod's files; * marks the main file
nexus whoamiShow the account the key belongs to, and whether it has Premium
nexus install MOD_ID [FILE_ID] [--to WINDATA]Download and install the mod's main file, or the file given (direct downloads need Premium)
nexus install 'nxm://…' [--to WINDATA]Install from a Mod Manager Download link on the website

--to defaults to game-data/original/WinData. The user guide's Mods from Nexus Mods explains the key, Premium and nxm:// links. The library is banished-nexus.

banishedinfo ​

List, search and install the Banished mods on banishedinfo.com. This is not part of the original game. No account is needed, and requests go to the site only when you run a command.

bash
cargo run --release -p banished-cli -- banishedinfo list --sort downloads
cargo run --release -p banished-cli -- banishedinfo install 34 --to path/to/WinData
CommandEffect
banishedinfo list [--sort featured|downloads|trending|recent] [--section NAME] [--page N]List the site's mods, 20 to a page
banishedinfo search TEXTSearch the mods
banishedinfo versions MOD_IDList a mod's versions, newest first
banishedinfo install MOD_ID [VERSION] [--to WINDATA]Download and install a version (the newest by default)

MOD_ID is the number in the mod's address. The sections are audio, buildings, gameplay, maps, textures, translations and translated-mods. --to defaults to game-data/original/WinData. The Mods section of the user guide explains the rest, under "Mods from banishedinfo.com". The library is banished-banishedinfo.

Un-Banished 0.4.0-99617f9 is free software under the MIT or Apache-2.0 licence. It is not affiliated with or endorsed by Shining Rock Software.