Skip to content

Commit 6767059

Browse files
committed
Add docs
1 parent 094a775 commit 6767059

File tree

16 files changed

+2283
-0
lines changed

16 files changed

+2283
-0
lines changed

docs/docs/bundles.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Bundles
2+
3+
Bundles (`.drb` files) package pipelines with their assets for distribution.
4+
5+
## Creating a Bundle
6+
7+
```bash
8+
divvun-runtime bundle [OPTIONS]
9+
```
10+
11+
Options:
12+
- `-a, --assets-path <PATH>` - Assets directory (default: `./assets`)
13+
- `-p, --pipeline-path <PATH>` - Pipeline file (default: `./pipeline.ts`)
14+
- `--skip-check` - Skip TypeScript type checking
15+
16+
Example:
17+
```bash
18+
cd my-project
19+
divvun-runtime bundle
20+
```
21+
22+
Creates `bundle.drb` with all pipelines and assets.
23+
24+
## Bundle Contents
25+
26+
A bundle contains:
27+
28+
- Compiled pipeline code
29+
- Assets directory (models, data files)
30+
- Metadata (pipeline names, default pipeline)
31+
32+
Pipelines ending in `_dev` are automatically excluded from bundles. See [Pipelines](./pipelines.md#dev-pipelines) for details.
33+
34+
## Using Bundles
35+
36+
### Run a Bundle
37+
38+
```bash
39+
divvun-runtime run bundle.drb "input text"
40+
```
41+
42+
### List Pipelines
43+
44+
```bash
45+
divvun-runtime list bundle.drb
46+
```
47+
48+
Output:
49+
```
50+
Bundle bundle.drb
51+
Pipelines 2 available
52+
53+
• grammar-checker (default)
54+
• spell-only
55+
```
56+
57+
### Select Pipeline
58+
59+
```bash
60+
divvun-runtime run --pipeline spell-only bundle.drb "text"
61+
```
62+
63+
## Distribution
64+
65+
Distribute the `.drb` file:
66+
67+
- Single file contains everything
68+
- No external dependencies
69+
- Cross-platform compatible
70+
71+
Users run without installing project:
72+
```bash
73+
divvun-runtime run your-bundle.drb "input"
74+
```

docs/docs/cli.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
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

Comments
 (0)