CLI Overview
The ODict CLI is the fastest way to create, inspect, combine, and query dictionaries from a terminal. Most workflows start with XML, compile it to a .odict file, and then use the compiled file for lookup, search, tokenization, or serving over HTTP.
What you can do
Section titled “What you can do”| Task | Command | Use it when |
|---|---|---|
| Create a starter XML file | odict new | You want a blank ODXML file with the dictionary name filled in. |
| Compile XML | odict compile | You are ready to turn ODXML into a compact .odict file. |
| Inspect a dictionary | odict info | You want basic metadata such as file version, size, and entry count. |
| List headwords | odict lexicon | You need every term defined in a dictionary. |
| Look up entries | odict lookup | You know the word and want an exact dictionary entry. |
| Split compound text | odict split | You want to break a term into known dictionary words without trying the whole term first. |
| Build a search index | odict index | You want full-text search across definitions. |
| Search definitions | odict search | You know the meaning or phrase, but not necessarily the headword. |
| Tokenize text | odict tokenize | You want language-aware tokens matched against dictionary entries. |
| Convert back to text | odict dump | You want XML or SQL output from a compiled dictionary. |
| Merge dictionaries | odict merge | You want to combine entries from multiple dictionaries. |
| Download dictionaries | odict download | You want a dictionary from the remote registry. |
| Manage aliases | odict alias | You want short names for local or downloaded dictionaries. |
| Serve over HTTP | odict serve | You want JSON lookup, search, split, or tokenization endpoints. |
Common workflow
Section titled “Common workflow”odict new animals -n "Animal Dictionary"odict compile animals.xmlodict lookup animals.odict catAdd search when you need discovery by definition text:
odict index animals.odictodict search animals.odict "domesticated mammal"Use dump when you want to inspect or transform a compiled dictionary:
odict dump animals.odict -f xmlodict dump animals.odict -f sqlite -o animals.sqlUse merge when you want to combine multiple compiled dictionaries:
odict merge base.odict extra.odict -o combined.odictPaths, aliases, and remote names
Section titled “Paths, aliases, and remote names”Most commands accept a local .odict path. Commands that load dictionaries can also use aliases or remote names, depending on the feature:
odict download wiktionary/engodict alias set eng ./eng.odictodict lookup eng helloRemote dictionary names use the form dictionary/language, such as wiktionary/eng.
Reference
Section titled “Reference”For every flag and argument, see the Command Reference. For guided workflows, see Downloading Dictionaries, Aliases and Loading, and Serving Dictionaries.