CLI Options

Complete reference for all command-line flags and options available in the cdl and mineral-db commands.

cdl Command

cdl [COMMAND] [CDL_STRING] [OPTIONS]

Commands

Command Description Example
parse Parse a CDL expression and display the result cdl parse "cubic[m3m]:{111}"
validate Validate a CDL expression (exit code 0 = valid) cdl validate "cubic[m3m]:{111}"

Options

Option Description
--json Output parsed result as JSON (with parse command)
--list-systems List all 7 crystal systems with their default point groups
--list-point-groups List all 32 point groups organized by crystal system
--list-forms List all named forms with their Miller indices
--list-twins List all registered twin laws
--version Show cdl-parser version
--help Show help message

Parse Output

The parse command displays:

  • Crystal system and point group
  • Forms with Miller indices and scale values
  • Modifications (if any)
  • Twin specification (if any)
  • Reconstructed CDL string
$ cdl parse "cubic[m3m]:{111}@1.0 + {100}@1.3 | elongate(c:1.5)"
Parsed successfully!
  System: cubic
  Point Group: m3m
  Forms (2):
    {111} @ scale=1.0
    {100} @ scale=1.3
  Modifications (1):
    elongate(c:1.5)

Reconstructed: cubic[m3m]:{111}@1.0 + {100}@1.3 | elongate(c:1.5)

With --json, the output is a structured JSON object:

$ cdl parse "cubic[m3m]:{111}" --json
{
  "system": "cubic",
  "point_group": "m3m",
  "forms": [
    {
      "type": "form",
      "miller": {"h": 1, "k": 1, "l": 1},
      "scale": 1.0
    }
  ],
  "modifications": [],
  "twin": null,
  "phenomenon": null
}

mineral-db Command

mineral-db [OPTIONS]

Query Options

Option Description Example
--list [CATEGORY] List all presets, or filter by crystal system mineral-db --list cubic
--info NAME Show detailed info for a preset mineral-db --info diamond-octahedron
--search QUERY Search presets by name, mineral, or chemistry mineral-db --search beryl
--json NAME Output preset data as JSON mineral-db --json quartz
--categories List all preset categories with counts mineral-db --categories
--count Show total number of presets mineral-db --count

Synthetic and Simulant Options

Option Description Example
--synthetics [METHOD] List synthetic minerals, optionally filtered by growth method (flux, cvd, hpht, etc.) mineral-db --synthetics flux
--simulants [TARGET] List simulant minerals, optionally filtered by target mineral mineral-db --simulants diamond
--counterparts NAME Show all synthetics and simulants for a natural mineral mineral-db --counterparts diamond
--origin TYPE Filter --list by origin: natural, synthetic, simulant, composite mineral-db --list --origin synthetic

Other Options

Option Description
--version Show mineral-database version
--help Show help message

Examples

CDL Parser

# Parse simple octahedron
cdl parse "cubic[m3m]:{111}"

# Parse combination with JSON output
cdl parse "cubic[m3m]:{111}@1.0 + {100}@1.3" --json

# Validate a hexagonal expression
cdl validate "hexagonal[6/mmm]:{10-10} + {0001}"

# List all named forms
cdl --list-forms

# List twin laws
cdl --list-twins

Mineral Database

# List all cubic presets
mineral-db --list cubic

# Get detailed info
mineral-db --info ruby-hexagonal

# Search by chemistry
mineral-db --search "Al2O3"

# List all flux-grown synthetics
mineral-db --synthetics flux

# Find diamond counterparts
mineral-db --counterparts diamond

# List composites
mineral-db --list --origin composite

# Export as JSON for scripting
mineral-db --json diamond-octahedron | python -c "import sys,json; d=json.load(sys.stdin); print(d['cdl'])"