Skip to content

CLI Interface Manual

Phil25 edited this page Jan 21, 2023 · 4 revisions

ERDB can be installed with pip and called from the CLI via python -m erdb or just erdb. This page overviews this CLI interface by copypasta of every subcommand with --help option specified. I try to keep this updated with the master branch.

erdb

usage: erdb [-h]
            {generate,gen,find-values,vals,calculate-ar,ar,changelog,source,map,icons,serve-api,api,generate-wiki,wiki}
            ...

Interface for ERDB operations.

options:
  -h, --help            show this help message and exit

subcommands:
  {generate,gen,find-values,vals,calculate-ar,ar,changelog,source,map,icons,serve-api,api,generate-wiki,wiki}
    generate (gen)      Generate JSON data for specified tables.
    find-values (vals)  Find all possible values of a field per param name.
    calculate-ar (ar)   Calculate attack power of an armament
    changelog           Create a changelog of ERDB-detectable differences
                        between specified versions.
    source              Extract gamedata from an UXM-unpacked ELDEN RING
                        installation (Windows only).
    map                 Extract world map image from an UXM-unpacked ELDEN
                        RING installation (Windows only).
    icons               Extract item images from an UXM-unpacked ELDEN RING
                        installation (Windows only).
    serve-api (api)     Begin serving the API web server.
    generate-wiki (wiki)
                        Generate a static Wikipedia website.

erdb generate

usage: erdb generate [-h] [--gamedata GAMEDATA [GAMEDATA ...]] [--minimize]
                     [--out OUT]
                     {all,ammo,armaments,armor,ashes-of-war,bolstering-materials,correction-attack,correction-graph,crafting-materials,gestures,info,keys,reinforcements,shop,spells,spirit-ashes,talismans,tools}
                     [{all,ammo,armaments,armor,ashes-of-war,bolstering-materials,correction-attack,correction-graph,crafting-materials,gestures,info,keys,reinforcements,shop,spells,spirit-ashes,talismans,tools} ...]

Parse extracted gamedata into a well-structured JSON output. The
resulting data will be written to `{table}.json` files in a folder
named after the `--out` argument, or cwd if not provided. This is a
manual way of generating data, many other subcommands do this
automatically.

positional arguments:
  {all,ammo,armaments,armor,ashes-of-war,bolstering-materials,correction-attack,correction-graph,crafting-materials,gestures,info,keys,reinforcements,shop,spells,spirit-ashes,talismans,tools}
                        Specify any or all tables.

options:
  -h, --help            show this help message and exit
  --gamedata GAMEDATA [GAMEDATA ...], -g GAMEDATA [GAMEDATA ...]
                        Game version range to source the data from.
  --minimize            Output minimized text file when generating data.
  --out OUT, -o OUT     Optional output file path.

[EXAMPLE] Generate Armor data only for version 1.07.0
$ erdb gen armor --gamedata only 1.07.0

[EXAMPLE] Generate Talisman and Tool data for versions between 1.04.1 and 1.07.1 (including)
$ erdb gen talismans tools --gamedata from 1.04.1 until 1.07.1

[EXAMPLE] Generate all data for all versions from 1.06.0 (including), minimize the JSON output
$ erdb gen all --gamedata until 1.06.0 --minimize

erdb find-values

usage: erdb find-values [-h] [--limit NUM]
                        [--gamedata GAMEDATA [GAMEDATA ...]]
                        param field

Search for all possible values of a particular property in the
specified game param. Unique values will be listed on each line, with
example item/row names, or only their IDs if the name is blank. Useful
for figuring out which properties are important and how the rows are
grouped in relation to them.

positional arguments:
  param                 Name of the parameter table, ex. SpEffectParam
  field                 Name of the field of the table, ex. slashDamageCutRate

options:
  -h, --help            show this help message and exit
  --limit NUM, -l NUM   Limit of examples shown for each value (default 8).
  --gamedata GAMEDATA [GAMEDATA ...], -g GAMEDATA [GAMEDATA ...]
                        Game version range to source the data from.

[EXAMPLE] Show unique values for "sortGroupId" property of "EquipParamGoods"
$ erdb vals EquipParamGoods sortGroupId

[EXAMPLE] Show weapon categories in "EquipParamWeapon", with up to 20 examples per category
$ erdb vals EquipParamWeapon weaponCategory --limit 20

erdb calculate-ar

usage: erdb calculate-ar [-h] --data-path DATA_PATH
                         attribs armament affinity level

Calculate attack power and status effects of an armament of any
affinity or level combination using the generated data. Provide the
path to the data output directory from `erdb generate` via
`--data-path`. Somber weapon levels are as-is, you must know the
maximum level of the given weapon or wether the affinity is
interchangable. Providing a level higher than maxiumum or an invalid
affinity will result in an error.

positional arguments:
  attribs               Player attributes in format "str,dex,int,fth,arc".
  armament              Name of the armament.
  affinity              Affinity of the armament.
  level                 Upgrade level of the armament.

options:
  -h, --help            show this help message and exit
  --data-path DATA_PATH
                        Location of the generated data.

[EXAMPLE] Get AR and status effects for Poison Claymore +25 at 25 str, 30 dex, 10 int, 10 fth, 20 arc
$ erdb ar 25,30,10,10,20 Claymore Poison 25 --data-path /path/to/generated/data/1.07.1/

[EXAMPLE] Get AR for Standard Axe of Godfrey +8 at 50 str, 20 dex, 10 int, 10 fth, 10 arc
$ erdb ar 50,20,10,10,10 "Axe of Godfrey" Standard 8 --data-path ./1.06.0

erdb changelog

usage: erdb changelog [-h] [--from-version FROM_VERSION]
                      [--formatter {markdown,discord,text}] [--out OUT]
                      version

Compare two generated data and create a human-readable list of
updates. ERDB automatically finds the previous version from the one
requested, but that can be overridden with an optional
`--from-version` argument. Different formatters are available, using
which the output will be written to stdout, or a specific file if
`--out` is provided.

positional arguments:
  version               Version to generate the changelog of.

options:
  -h, --help            show this help message and exit
  --from-version FROM_VERSION
                        Optional starting version of the changelog, previous
                        if not specified.
  --formatter {markdown,discord,text}, -f {markdown,discord,text}
                        Format to output the changelog in.
  --out OUT, -o OUT     Optional output path.

[EXAMPLE] Generate changelog from version 1.06.0 to 1.07.0 and write it to CHANGELOG.md using markdown format
$ erdb changelog 1.07.0 --formatter markdown --out CHANGELOG.md

[EXAMPLE] Print changelog from version 1.05.0 to 1.07.1 in a text format to stdout
$ erdb changelog 1.07.1 --from-version 1.05.0 --formatter text

erdb source

usage: erdb source [-h] [--version VERSION] --game-dir GAME_DIR
                   [--ignore-checksum | --no-ignore-checksum]
                   [--keep-cache | --no-keep-cache]

Parse an UXM-unpacked installation of ELDEN RING and collect data to
ERDB package resources. In order to extract the files beyond UXM,
third-party tools will be downloaded, verified and executed. The
version of the game is automatically detected but can be overridden
for any purpose, ex. modded version. This version can then be used in
other ERDB subcommands, like generating tables or calculating AR.

options:
  -h, --help            show this help message and exit
  --version VERSION, -v VERSION
                        Version directory storing the extracted files,
                        overrides autodetection.
  --game-dir GAME_DIR   Path to ELDEN RING's "Game" directory, where the
                        binary is located.
  --ignore-checksum, --no-ignore-checksum
                        Ignore MD5 verification of thirdparty tools.
  --keep-cache, --no-keep-cache
                        Keep the unpacked files, if any.

[EXAMPLE] Source a game folder and autodetect its version
$ erdb source --game-dir "/path/to/ELDEN RING/Game"

[EXAMPLE] Source a game folder, specifying custom version and keep whatever was additionally extracted
$ erdb source --game-dir "/path/to/ELDEN RING/Game" --keep-cache --version 1.99.0

erdb map

usage: erdb map [-h] [--lod LOD] [--underground | --no-underground] --game-dir
                GAME_DIR [--ignore-checksum | --no-ignore-checksum]
                [--keep-cache | --no-keep-cache] [--out OUT]

Parse an UXM-unpacked installation of ELDEN RING and extract the world
map tiles. Tiles are combined into an image and written to the
specified file or directory using the `--out` argument. Provide a file
extension to automatically convert it to that format.

options:
  -h, --help            show this help message and exit
  --lod LOD, -l LOD     Level of detail of the map, 0 is highest.
  --underground, --no-underground
                        Specifies whether to extract the underground map
                        instead of the overworld.
  --game-dir GAME_DIR   Path to ELDEN RING's "Game" directory, where the
                        binary is located.
  --ignore-checksum, --no-ignore-checksum
                        Ignore MD5 verification of thirdparty tools.
  --keep-cache, --no-keep-cache
                        Keep the unpacked files, if any.
  --out OUT, -o OUT     Optional output path.

[EXAMPLE] Write the full quality map to er_map.jpeg
$ erdb map --game-dir "/path/to/ELDEN RING/Game" -o er_map.jpeg

[EXAMPLE] Write the LOD 2 quality map of underground to a default filename and extension
$ erdb map --game-dir "/path/to/ELDEN RING/Game" --lod 2 --underground

erdb icons

usage: erdb icons [-h] [--size [1-1024]] [--file-format FILE_FORMAT]
                  --game-dir GAME_DIR
                  [--ignore-checksum | --no-ignore-checksum]
                  [--keep-cache | --no-keep-cache] [--out OUT]
                  {all,spells,keys,ammo,spirit-ashes,tools,talismans,armor,bolstering-materials,crafting-materials,gestures,shop,armaments,ashes-of-war,info}
                  [{all,spells,keys,ammo,spirit-ashes,tools,talismans,armor,bolstering-materials,crafting-materials,gestures,shop,armaments,ashes-of-war,info} ...]

Parse an UXM-unpacked installation of ELDEN RING and extract the item
icons. Accepts list of tables similar to `erdb generate` but only ones
that actually are in-game items. Item icons are output in directories
with the same name as their respective table, parented by the `--out`
argument, or cwd if not provided. `--file-format` can be used to name
them in a custom way and provide a specific extension to automatically
format images to.

positional arguments:
  {all,spells,keys,ammo,spirit-ashes,tools,talismans,armor,bolstering-materials,crafting-materials,gestures,shop,armaments,ashes-of-war,info}
                        Specify item types to export images for.

options:
  -h, --help            show this help message and exit
  --size [1-1024], -s [1-1024]
                        Size in pixels of images to be exported, resized from
                        maximum quality in game files (1024x1024).
  --file-format FILE_FORMAT, -f FILE_FORMAT
                        Specify the formatting for file names, including
                        extension. Available fields: {icon_id}, {name},
                        {table}. NOTE: multiple items can share {icon_id},
                        therefore {name} alone is not exhaustive and only one
                        will be used.
  --game-dir GAME_DIR   Path to ELDEN RING's "Game" directory, where the
                        binary is located.
  --ignore-checksum, --no-ignore-checksum
                        Ignore MD5 verification of thirdparty tools.
  --keep-cache, --no-keep-cache
                        Keep the unpacked files, if any.
  --out OUT, -o OUT     Optional output in standard URI syntax, can be a
                        regular file/directory path.

[EXAMPLE] Extract icons for tools and keys in specific file names and as ICO format
$ erdb icons tools keys --game-dir "/path/to/ELDEN RING/Game" --file-format "{icon_id} - {name}.ico"

[EXAMPLE] Extract all icons in small file size
$ erdb icons all --game-dir "/path/to/ELDEN RING/Game" --size 128

[EXAMPLE] Extract all icons and upload them to a Cloudflare image hosting instance
$ erdb icons all --game-dir "/path/to/ELDEN RING/Game" --out "https://account_id:api_token@" --file-format "icons/{table}/{icon_id}"

erdb serve-api

usage: erdb serve-api [-h] --port PORT [--bind BIND]
                      [--precache | --no-precache]

Start a web server providing a REST API for every table and for all
available game versions. Data is served from memory, and is generated
lazily unless `--precache` is provided. The full documentation is
available under `/v{api_version}/docs` or `/v{api_version}/redoc`
endpoints. Higher level endpoints, `/docs` and `/redoc` outline all
API versions there are thus far.

options:
  -h, --help            show this help message and exit
  --port PORT, -p PORT  Port number to listen on.
  --bind BIND, -b BIND  Address to bind the server on.
  --precache, --no-precache
                        Pregenerate all data instead of lazy loading.

[EXAMPLE] Serve the REST API on port 8080 and pracache all the tables
$ erdb serve-api --port 8080 --precache

erdb generate-wiki

usage: erdb generate-wiki [-h] [--uikit-version UIKIT_VERSION]
                          [--pyscript-version PYSCRIPT_VERSION] --data-path
                          DATA_PATH [--minimize] [--out OUT]

Fetch generated ERDB data and create static Wikipedia pages using
predefined Jinja2 templates. Powered using the UIkit3 CSS framework
and pyscript library, which are automatically downloaded if not found
at the destination. Use `--ukit-version` and `--pyscript-version` to
override which version will be downloaded instead of an internally
defined one.

options:
  -h, --help            show this help message and exit
  --uikit-version UIKIT_VERSION
                        UIkit version to override, defaults to internal,
                        frozen-on value.
  --pyscript-version PYSCRIPT_VERSION
                        pyscript version to override, defaults to internal,
                        frozen-on value.
  --data-path DATA_PATH
                        Location of the ERDB-generated data.
  --minimize            Output minimized text file when generating data.
  --out OUT, -o OUT     Optional output file path.

[EXAMPLE] Generate wiki pages for 1.08.1 data at a specified location
$ erdb generate-wiki --data-path ./1.08.1/ --out ../wiki-location/

[EXAMPLE] Generate wiki pages for 1.08.1 using explicitly-provided version of UIkit and pyscript
$ erdb generate-wiki --data-path ./1.08.1/ --uikit-version 3.15.18 --pyscript-version 2022.12.1