odict [OPTIONS] <COMMAND>
The ODict CLI is the primary tool for creating, compiling, and querying ODict dictionaries.
Option Description -q, --quietSilence any non-important output -h, --helpPrint help -V, --versionPrint version
Manage dictionary aliases.
Attempts to create a new dictionary alias, failing if one already exists with the given name.
odict alias add [OPTIONS] <NAME> <PATH>
Argument Required Description nameYes Name of the alias pathYes Dictionary path
Flag Description -r <RETRIES>, --retries <RETRIES>Number of times to retry loading the dictionary (remote-only) (default: 3)
Creates or updates an existing dictionary alias.
odict alias set [OPTIONS] <NAME> <PATH>
Argument Required Description nameYes Name of the alias pathYes Dictionary path
Flag Description -r <RETRIES>, --retries <RETRIES>Number of times to retry loading the dictionary (remote-only) (default: 3)
Deletes an alias with the given name if it exists.
odict alias delete <NAME>
Argument Required Description nameYes Name of the alias
Compiles a dictionary from ODXML.
odict compile [OPTIONS] <INPUT>
Argument Required Description inputYes Path to ODXML file
Flag Description -o <OUTPUT>Output path of compiled dictionary -q <QUALITY>Brotli compression level (between 0 and 11) (default: 8) -w <WINDOW_SIZE>Brotli large window size (between 0 and 22) (default: 22)
Downloads a dictionary from the remote registry.
odict download [OPTIONS] <DICTIONARY>
Argument Required Description dictionaryYes Dictionary to download (e.g., ‘wiktionary/eng’)
Flag Description -o <OUTPUT>, --output <OUTPUT>Directory to download the dictionary to (defaults to config directory) --no-cacheDisable caching (always download fresh copy) -r <RETRIES>, --retries <RETRIES>Number of times to retry loading the dictionary (remote-only) (default: 3)
Outputs a dictionary in a human-readable format.
odict dump [OPTIONS] <INPUT>
Argument Required Description inputYes Path to a compile dictionary
Flag Description -f <FORMAT>Format in which to dump the dictionary. (default: xml) -o <OUTPUT>Output path of the dump. Defaults to stdout. -r <RETRIES>, --retries <RETRIES>Number of times to retry loading the dictionary (remote-only) (default: 3)
Creates a full-text index of a compiled dictionary.
odict index [OPTIONS] <DICTIONARY>
Argument Required Description dictionaryYes Path to a compiled dictionary or an alias
Flag Description -d <DIRECTORY>Custom directory to store the index -fWhether to overwrite the index if it already exists -m <MEMORY>Memory arena per thread in bytes. Must be above 15MB (default: 15000000) -r <RETRIES>, --retries <RETRIES>Number of times to retry loading the dictionary (remote-only) (default: 3)
Prints the metadata info for a dictionary file.
odict info [OPTIONS] <DICTIONARY_PATH>
Argument Required Description dictionary_pathYes Path to a compiled dictionary
Flag Description -r <RETRIES>, --retries <RETRIES>Number of times to retry loading the dictionary (remote-only) (default: 3)
Lists all words defined in a dictionary.
odict lexicon [OPTIONS] <DICTIONARY>
Argument Required Description dictionaryYes Path to a compiled dictionary
Flag Description -r <RETRIES>, --retries <RETRIES>Number of times to retry loading the dictionary (remote-only) (default: 3)
Looks up an entry in a compiled dictionary without indexing.
odict lookup [OPTIONS] <DICTIONARY_PATH> <QUERIES>...
Argument Required Description dictionary_pathYes Path to a compiled dictionary queriesYes Words to look up
Flag Description -f <FORMAT>, --format <FORMAT>Output format of the entries (default: print) -F, --followFollow see_also redirects until finding an entry with etymologies -s <SPLIT>, --split <SPLIT>If a definition cannot be found, attempt to split the query into words of at least length S and look up each word separately. Can be relatively slow. (default: 0) -i, --insensitivePerform case-insensitive lookups -r <RETRIES>, --retries <RETRIES>Number of times to retry loading the dictionary (remote-only) (default: 3)
Merge entries from multiple dictionaries into a destination dictionary.
odict merge [OPTIONS] <DESTINATION> <SOURCES>...
Argument Required Description destinationYes Path of the dictionary to merge into (unless —output is specified) sourcesYes Paths of dictionaries to merge
Flag Description -o <OUTPUT>, --output <OUTPUT>Separate output path for the compiled dictionary -r <RETRIES>, --retries <RETRIES>Number of times to retry loading the dictionary (remote-only) (default: 3)
Scaffolds a new ODict XML dictionary.
odict new [OPTIONS] <FILE_NAME>
Argument Required Description file_nameYes Name of your new dictionary file
Flag Description -n <NAME>Name attribute of the dictionary element
Run a full-text query on a compiled dictionary.
odict search [OPTIONS] <DICTIONARY> <QUERY>
Argument Required Description dictionaryYes Path to a compiled dictionary or an alias queryYes Search query
Flag Description -f <FORMAT>, --format <FORMAT>Format in which to print the results (default: json) --indexCreates a new index if one doesn’t already exist -r <RETRIES>, --retries <RETRIES>Number of times to retry loading the dictionary (remote-only) (default: 3)
Start a local web server to serve one or several dictionaries.
odict serve [OPTIONS] [DICTIONARIES]...
Argument Required Description dictionariesNo Dictionary files or directories containing .odict files
Flag Description -p <PORT>Port to listen on (default: 5005) -c <CAPACITY>, --capacity <CAPACITY>Maximum number of dictionaries to keep in memory (default: 5) -l <LEVEL>, --level <LEVEL>Log level (trace, debug, info, warn, or error)
When running serve, the following REST endpoints become available. All return JSON.
Parameter Type Required Description qstring Yes Term or comma-separated terms to look up followboolean No Follow see cross-references splitnumber No Minimum character length for fallback splitting
Parameter Type Required Description qstring Yes Full-text search query limitnumber No Maximum number of results
Parameter Type Required Description qstring Yes Term or comma-separated terms to split followboolean No Follow see cross-references min_lengthnumber No Minimum character length for each segment
Parameter Type Required Description textstring Yes Text to tokenize followboolean No Follow see cross-references for matched tokens
Splits text into component dictionary words without attempting a whole-word lookup first.
odict split [OPTIONS] <DICTIONARY_PATH> <QUERIES>...
Argument Required Description dictionary_pathYes Path to a compiled dictionary queriesYes Text to split into dictionary words
Flag Description -f <FORMAT>, --format <FORMAT>Output format of the entries (default: print) -F, --followFollow see_also redirects until finding an entry with etymologies -m <MIN_LENGTH>, --min-length <MIN_LENGTH>Minimum character length of each split segment (default: 1) -i, --insensitivePerform case-insensitive lookups -r <RETRIES>, --retries <RETRIES>Number of times to retry loading the dictionary (remote-only) (default: 3)
Tokenize text and find dictionary entries for each token.
odict tokenize [OPTIONS] <DICTIONARY_PATH> <TEXT>
Argument Required Description dictionary_pathYes Path to a compiled dictionary textYes Text to tokenize
Flag Description -f <FORMAT>, --format <FORMAT>Output format of the entries (default: print) -F, --followFollow see_also redirects until finding an entry with etymologies -i, --insensitivePerform case-insensitive lookups when matching tokens -r <RETRIES>, --retries <RETRIES>Number of times to retry loading the dictionary (remote-only) (default: 3)