> [!kanban]+ [[Obsidian TTRPG Tutorials]] / [[Plugin Tutorials]] / [[TTRPG-Convert-CLI]] / [[TTRPG-Convert-CLI Config File]]
> - [[Getting Started]]
> - ![[Pasted image 20230527003751.jpg|hsmall+wsmall+center]]
> - [[Plugin Tutorials]]
> - ![[Pasted image 20230527184201.jpg|hsmall+wsmall+center]]
> - [[Community Supported Games]]
> - ![[Pasted image 20230527001506.jpg|hsmall+wsmall+center]]
> - [[Obsidian TTRPG Tutorials/Templates/Templates\|Templates]]
> - ![[Pasted image 20230530220438.jpg|hsmall+wsmall+center]]
> - [[Community and Support]]
> - ![[Pasted image 20230527005303.jpg|hsmall+wsmall+center]]
> [!infobox]
> # ttrpg-convert-cli
> ![[TTRPG-Convert-CLI 5e-20240203092033415.webp|cover hsmall]]
>
> Links |
> ---|
> ⚙️[Github Site](https://github.com/ebullient/ttrpg-convert-cli) |
> 📄[Official Documentation](https://github.com/ebullient/ttrpg-convert-cli/blob/main/README.md)) |
> 🗺️[Source Map](https://github.com/ebullient/ttrpg-convert-cli/blob/main/docs/sourceMap.md#source-name-mapping-for-5etools)) |
> 🆘[Support](https://discord.com/channels/925322340995313686/1118630475313975367) 🐛[Raise Issue](https://github.com/ebullient/ttrpg-convert-cli/issues) |
> 🍵[Support Ebulient with Coffee](https://www.buymeacoffee.com/ebullient) |
>
> Tutorials |
> ---|
> Step1: [[TTRPG-Convert-CLI 5e\|Setup]] |
> **Step2: [[TTRPG-Convert-CLI Config File\|Config File Creation]]** |
> Step3: [[TTRPG-Convert-CLI Templates\|Templates]] |
> Step5: [[TTRPG-Convert-CLI Homebrew Content\|Homebrew Content]] |
> Step 6: [[TTRPG-Convert-CLI Custom Content\|Custom Content]] |
> Alternative: [TTRPG Convert CLI for MacOS](https://youtu.be/O66n448NG4M) |
This page walks through some example Config Files.
![](https://youtu.be/JX6_uV66Nsw)
A configuration file is used to tell the CLI tool what content you would like to use and how to configure the tool. It's easier in the long run to create a config file to maintain your configuration vs having to update your command line prompt every time you want to run the tool.
Official Documentation: https://github.com/ebullient/ttrpg-convert-cli/blob/main/docs/usage/configuration.md
To create a configuration file you basically need to create a new text document in your `bin` folder and name it `config-file-name.json`.
Edit the new document and paste the following in.
````
{
"from": [
"DMG",
"PHB",
"MM"
],
"paths": {
"compendium": "2-Mechanics/CLI/",
"rules": "2-Mechanics/CLI/rules"
}
}
````
This is a very basic config file that tells the CLI tool to include the content that is listed in the `from` section and to create the output using the folder structure in the `paths` section.
To run the CLI tool with a config file you need to add `-c config-file-name.json` into the command line prompt. Here is an example.
`ttrpg-convert.exe --index -o dm-5 -c config-file-name.json 5etools-mirror-2.github.io/data`
The `-c` tells the tool to use a config file.
The `config-file-name.json` needs to match the name of the \*.json file you created above.
Here is a more complex config file example.
```
{
"from": [
"DMG",
"PHB",
"LMoP",
"MM"
],
"paths": {
"compendium": "2-Mechanics/CLI/",
"rules": "2-Mechanics/CLI/rules"
},
"images": {
"copyRemote": true,
"internalRoot": "5etools-img"
},
"full-source": {
"adventure": [
"LMoP"
],
"book": [
"PHB",
"DMG",
"MM"
]
}
}
```
This example will also include Markdown versions of the books and adventures that are added.
Note: You need to include the sources in the `from` as well as the adventure/book in the appropriate sections.
You can modify this to include the sources that you own. You can find a list of sources [HERE](https://github.com/ebullient/ttrpg-convert-cli/blob/main/docs/sourceMap.md). Under the `from` section add a new line for each book that you own and enter the [Source Code](https://github.com/ebullient/ttrpg-convert-cli/blob/main/docs/sourceMap.md) to the line. Replicating the format of the sources listed above.
Example: If you want to include Lost Mines of Phandelver, you need to add `LMoP` to the from section and also to the adventure section.
> [!danger]+ Be Aware
> Note that the `paths` section uses a `-` instead of a `.`.
> Example: "2-Mechanics/CLI/" vs "2. Mechanics/"
> I found through testing that the "2. Mechanics/" results in broken links. As such I recommend using the naming convention of "2-Mechanics/" for your folders as this does not create any issues with linking.
##### Folder Path Configuration
The `paths` section defines the sub-folders that the content will be created in. If you would like to change the name of the folders then you should do it here. See example below.
````
"paths" : {
"compendium" : "/mechanics/",
"rules" : "/mechanics/rules/"
}
````
##### Templates
IMPORTANT: People always miss this step.
The default output for the CLI tool is NOT to use the [[Fantasy Statblocks]] plugin as the developer does not use that plugin. You need to make a change in your config file if you would like to use the Fantasy Statblock plugin. See [[TTRPG-Convert-CLI Templates]] for more details.
````
"template": {
"background" : "ttrpg-convert-cli/examples/templates/tools5e/images-background2md.txt",
"monster" : "ttrpg-convert-cli/examples/templates/tools5e/monster2md-yamlStatblock-body.txt",
"item" : "ttrpg-convert-cli/examples/templates/tools5e/images-item2md.txt",
"race" : "ttrpg-convert-cli/examples/templates/tools5e/images-race2md.txt",
"spell" : "ttrpg-convert-cli/examples/templates/tools5e/images-spell2md.txt"
},
````
##### Exclusions and Inclusions
There is more you can do with the config file such as excluding types of content or including specific content. You should check the [Official Read-Me](https://github.com/ebullient/ttrpg-convert-cli) for further details.
##### Books and Adventures
You can include Books and Adventures in the output by adding this to your config file.
You can add additional books and adventures by adding sources that you own to the appropriate lines.
````
"full-source" : {
"book" : [
"PHB",
"DMG",
"MTF"
],
"adventure" : [
"LMoP"
]
}
````
#### Dice Roller Plugin Support
You can enable/disable Dice Roller support by adding this to your config and changing the value from false to true.
````
"useDiceRoller" : false,
````
#### Example Config File
Here is an example template that I have used to create the notes for the content I own. You can use this as an example and modify it to meet your own requirements.
The config is called: `dm-sources.json` and saved in the `bin` folder.
The CLI is triggered with this command: `ttrpg-convert.exe --index -o dm -c dm-sources.json 5etools-mirror-2.github.io/data`
````
{
"from" : [
"PHB",
"DMG",
"MM"
],
"paths" : {
"compendium" : "/2-Mechanics/CLI/",
"rules" : "/2-Mechanics/CLI/rules/"
},
"template": {
"background" : "ttrpg-convert-cli/examples/templates/tools5e/images-background2md.txt",
"monster" : "ttrpg-convert-cli/examples/templates/tools5e/monster2md-yamlStatblock-body.txt",
"item" : "ttrpg-convert-cli/examples/templates/tools5e/images-item2md.txt",
"race" : "ttrpg-convert-cli/examples/templates/tools5e/images-race2md.txt",
"spell" : "ttrpg-convert-cli/examples/templates/tools5e/images-spell2md.txt"
},
"images": {
"copyInternal": true,
"internalRoot": "5etools-img"
},
"useDiceRoller" : false,
"tagPrefix" : "ttrpg-cli",
"full-source" : {
"adventure" : [
"LMoP"
],
"book" : [
"DMG",
"MM",
"PHB"
],
"homebrew": [
"homebrew/creature/Kobold Press; Tome of Beasts.json"
]
}
}
````