Command Reference
The FG Character Extractor is a simple command-line tool with minimal options, designed to be easy to use while providing powerful character extraction capabilities.Basic Syntax
Path to the Fantasy Grounds campaign database file. If not specified, the tool looks for
db.xml in the current directory.Command Behavior
When you runfg-char-extract, the tool:
Opens the database file
Opens the specified
db.xml file (or db.xml in the current directory if no file is specified)Parses character data
Scans for the
<charsheet> or <charsheets> section and extracts all character entriesCalculates skill totals
Automatically computes skill totals based on ability bonuses and proficiency values:
Exit Codes
The tool uses standard Unix exit codes:| Exit Code | Meaning | Description |
|---|---|---|
0 | Success | All characters extracted successfully |
1 | Error | An error occurred (see stderr for details) |
Usage Examples
Default Usage
Extract characters fromdb.xml in the current directory:
Specify File Path
Extract characters from a specific file:Windows
Relative Paths
Use relative paths from your current location:Output
The tool provides progress information via structured logging:Example output
The tool uses Go’s
slog package for structured logging, which outputs in a human-readable format by default.Error Handling
If an error occurs, the tool will:- Log the error to stderr using structured logging
- Exit with code
1
Common Errors
File not found
File not found
Permission denied
Permission denied
Invalid XML
Invalid XML
Write failure
Write failure
Source Code Reference
The command-line argument parsing is handled inmain.go:
main.go:13-17
main.go:19-22
Next Steps
Output Format
Learn about the structure of extracted XML files
Usage Examples
See real-world usage scenarios and patterns