|
| 1 | +# CLI Reference |
| 2 | + |
| 3 | +All `divvun-runtime` commands. |
| 4 | + |
| 5 | +## init |
| 6 | + |
| 7 | +Initialize a new pipeline project. |
| 8 | + |
| 9 | +```bash |
| 10 | +divvun-runtime init [path] |
| 11 | +``` |
| 12 | + |
| 13 | +Creates `pipeline.ts` and generates type definitions in `.divvun-rt/`. |
| 14 | + |
| 15 | +## sync |
| 16 | + |
| 17 | +Generate TypeScript type definitions. |
| 18 | + |
| 19 | +```bash |
| 20 | +divvun-runtime sync [path] |
| 21 | +``` |
| 22 | + |
| 23 | +Run after changing Cargo features or updating Divvun Runtime. |
| 24 | + |
| 25 | +## bundle |
| 26 | + |
| 27 | +Create a `.drb` bundle for distribution. |
| 28 | + |
| 29 | +```bash |
| 30 | +divvun-runtime bundle [OPTIONS] |
| 31 | +``` |
| 32 | + |
| 33 | +**Options**: |
| 34 | +- `-a, --assets-path <PATH>` - Assets directory (default: `./assets`) |
| 35 | +- `-p, --pipeline-path <PATH>` - Pipeline file (default: `./pipeline.ts`) |
| 36 | +- `--skip-check` - Skip TypeScript type checking |
| 37 | + |
| 38 | +Automatically excludes dev pipelines (functions ending in `_dev`). |
| 39 | + |
| 40 | +## run |
| 41 | + |
| 42 | +Execute a pipeline. |
| 43 | + |
| 44 | +```bash |
| 45 | +divvun-runtime run [OPTIONS] <path> [input] |
| 46 | +``` |
| 47 | + |
| 48 | +**Path**: Can be `.drb` bundle, `.ts` pipeline file, or directory |
| 49 | + |
| 50 | +**Options**: |
| 51 | +- `-p, --path <PATH>` - Alternative way to specify path |
| 52 | +- `-P, --pipeline <NAME>` - Select specific pipeline |
| 53 | +- `-c, --config <KEY=VALUE>` - Runtime configuration |
| 54 | +- `-o, --output-path <PATH>` - Write output to file |
| 55 | +- `-C, --command <CMD>` - Run command on output |
| 56 | +- `--skip-check` - Skip type checking |
| 57 | + |
| 58 | +**Examples**: |
| 59 | +```bash |
| 60 | +# Run from TypeScript |
| 61 | +divvun-runtime run ./pipeline.ts "text" |
| 62 | + |
| 63 | +# Run specific pipeline |
| 64 | +divvun-runtime run --pipeline spell-only ./pipeline.ts "text" |
| 65 | + |
| 66 | +# Run from bundle |
| 67 | +divvun-runtime run bundle.drb "text" |
| 68 | + |
| 69 | +# With configuration |
| 70 | +divvun-runtime run -c 'suggest={"locales":["fo"]}' bundle.drb "text" |
| 71 | + |
| 72 | +# Save output |
| 73 | +divvun-runtime run -o output.wav bundle.drb "text" |
| 74 | +``` |
| 75 | + |
| 76 | +## list |
| 77 | + |
| 78 | +List pipelines in a bundle or project. |
| 79 | + |
| 80 | +```bash |
| 81 | +divvun-runtime list <path> |
| 82 | +``` |
| 83 | + |
| 84 | +Shows all available pipelines and marks default and dev pipelines. |
| 85 | + |
| 86 | +**Example**: |
| 87 | +```bash |
| 88 | +divvun-runtime list bundle.drb |
| 89 | +``` |
| 90 | + |
| 91 | +Output: |
| 92 | +``` |
| 93 | +Bundle bundle.drb |
| 94 | +Pipelines 2 available |
| 95 | +
|
| 96 | +• grammar-checker (default) |
| 97 | +• spell-only |
| 98 | +``` |
| 99 | + |
| 100 | +## Configuration Syntax |
| 101 | + |
| 102 | +Runtime configuration passed with `-c` flag: |
| 103 | + |
| 104 | +**String**: |
| 105 | +```bash |
| 106 | +-c 'cmd-id="value"' |
| 107 | +``` |
| 108 | + |
| 109 | +**JSON object**: |
| 110 | +```bash |
| 111 | +-c 'cmd-id={"key":"value","num":42}' |
| 112 | +``` |
| 113 | + |
| 114 | +**Array**: |
| 115 | +```bash |
| 116 | +-c 'cmd-id=["val1","val2"]' |
| 117 | +``` |
| 118 | + |
| 119 | +**Multiple configs**: |
| 120 | +```bash |
| 121 | +-c 'cmd1="val1"' -c 'cmd2={"key":"val2"}' |
| 122 | +``` |
| 123 | + |
| 124 | +Common configurations: |
| 125 | +```bash |
| 126 | +# Locale selection |
| 127 | +-c 'suggest={"locales":["fo","en"]}' |
| 128 | + |
| 129 | +# Ignore error types |
| 130 | +-c 'suggest={"ignore":["typo"]}' |
| 131 | + |
| 132 | +# UTF-16 encoding |
| 133 | +-c 'suggest={"encoding":"utf-16"}' |
| 134 | + |
| 135 | +# TTS speaker override |
| 136 | +-c 'tts-cmd={"speaker":1}' |
| 137 | +``` |
0 commit comments