|
| 1 | +# CLI Reference |
| 2 | + |
| 3 | +<details> |
| 4 | +slug: docs/cli-reference |
| 5 | +published: 03/15/2026 |
| 6 | +author: Gopher Guides |
| 7 | +seo_description: Hype documentation — CLI Reference. Learn how to use this feature in the Hype dynamic Markdown engine. |
| 8 | +tags: docs, cli-reference, hype |
| 9 | +</details> |
| 10 | + |
| 11 | + |
| 12 | +Hype provides several commands for working with dynamic markdown documents. |
| 13 | + |
| 14 | +## Commands Overview |
| 15 | + |
| 16 | +| Command | Description | |
| 17 | +|---------|-------------| |
| 18 | +| `export` | Export documents to different formats (markdown, HTML) | |
| 19 | +| `preview` | Start a live preview server with auto-reload | |
| 20 | +| `marked` | Integration with Marked 2 app | |
| 21 | +| `slides` | Web-based presentation server | |
| 22 | +| `blog` | Static blog generator | |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## export |
| 27 | + |
| 28 | +Export hype documents to markdown or HTML. |
| 29 | + |
| 30 | +```bash |
| 31 | +hype export [options] |
| 32 | +``` |
| 33 | + |
| 34 | +### Options |
| 35 | + |
| 36 | +| Flag | Default | Description | |
| 37 | +|------|---------|-------------| |
| 38 | +| `-f` | `hype.md` | Input file to process | |
| 39 | +| `-format` | `markdown` | Output format: `markdown` or `html` | |
| 40 | +| `-o` | stdout | Output file path | |
| 41 | +| `-theme` | `github` | Theme for HTML export | |
| 42 | +| `-css` | | Path to custom CSS file | |
| 43 | +| `-no-css` | `false` | Output raw HTML without styling | |
| 44 | +| `-themes` | | List available themes and exit | |
| 45 | +| `-timeout` | `30s` | Execution timeout | |
| 46 | +| `-v` | `false` | Verbose output | |
| 47 | + |
| 48 | +### Examples |
| 49 | + |
| 50 | +```bash |
| 51 | +# Export to markdown (default) |
| 52 | +hype export -f hype.md > README.md |
| 53 | + |
| 54 | +# Export to HTML |
| 55 | +hype export -f docs.md -format html > docs.html |
| 56 | + |
| 57 | +# Export with a theme |
| 58 | +hype export -f docs.md -format html -theme solarized-dark |
| 59 | + |
| 60 | +# Export with custom CSS |
| 61 | +hype export -f docs.md -format html -css ./styles.css |
| 62 | + |
| 63 | +# Export raw HTML (no styling) |
| 64 | +hype export -f docs.md -format html -no-css |
| 65 | + |
| 66 | +# List available themes |
| 67 | +hype export -themes |
| 68 | + |
| 69 | +# Output directly to file |
| 70 | +hype export -f hype.md -format markdown -o README.md |
| 71 | +``` |
| 72 | + |
| 73 | +--- |
| 74 | + |
| 75 | +## preview |
| 76 | + |
| 77 | +Start a live preview server with file watching and auto-reload. |
| 78 | + |
| 79 | +```bash |
| 80 | +hype preview [options] |
| 81 | +``` |
| 82 | + |
| 83 | +### Options |
| 84 | + |
| 85 | +| Flag | Alias | Default | Description | |
| 86 | +|------|-------|---------|-------------| |
| 87 | +| `-f` | | `hype.md` | Source file to preview | |
| 88 | +| `-port` | | `3000` | Server port | |
| 89 | +| `-w` | `-watch` | | Additional directories to watch (repeatable) | |
| 90 | +| `-e` | `-ext` | | File extensions to watch (comma-separated) | |
| 91 | +| `-i` | `-include` | | Glob patterns to include (repeatable) | |
| 92 | +| `-x` | `-exclude` | | Glob patterns to exclude (repeatable) | |
| 93 | +| `-d` | `-debounce` | `300ms` | Debounce delay before rebuild | |
| 94 | +| `-v` | `-verbose` | `false` | Verbose output | |
| 95 | +| `-open` | | `false` | Auto-open browser on start | |
| 96 | +| `-theme` | | `github` | Preview theme | |
| 97 | +| `-css` | | | Custom CSS file path | |
| 98 | +| `-themes` | | | List available themes | |
| 99 | +| `-timeout` | | `0` | Execution timeout | |
| 100 | + |
| 101 | +### Examples |
| 102 | + |
| 103 | +```bash |
| 104 | +# Basic preview |
| 105 | +hype preview -f hype.md |
| 106 | + |
| 107 | +# Open browser automatically |
| 108 | +hype preview -f hype.md -open |
| 109 | + |
| 110 | +# Watch additional directories |
| 111 | +hype preview -f hype.md -w ./src -w ./images |
| 112 | + |
| 113 | +# Filter by extension |
| 114 | +hype preview -f hype.md -e md,go,html |
| 115 | + |
| 116 | +# Use a dark theme |
| 117 | +hype preview -f hype.md -theme solarized-dark |
| 118 | +``` |
| 119 | + |
| 120 | +--- |
| 121 | + |
| 122 | +## marked |
| 123 | + |
| 124 | +Integration with [Marked 2](https://marked2app.com/) for macOS. |
| 125 | + |
| 126 | +```bash |
| 127 | +hype marked [options] |
| 128 | +``` |
| 129 | + |
| 130 | +### Options |
| 131 | + |
| 132 | +| Flag | Default | Description | |
| 133 | +|------|---------|-------------| |
| 134 | +| `-f` | | Input file (uses `MARKED_PATH` if not set) | |
| 135 | +| `-p` | `false` | Parse only (no execution) | |
| 136 | +| `-timeout` | `5s` | Execution timeout | |
| 137 | +| `-context` | | Context folder path | |
| 138 | +| `-section` | `0` | Target section number | |
| 139 | +| `-v` | `false` | Verbose output | |
| 140 | + |
| 141 | +### Environment Variables |
| 142 | + |
| 143 | +- `MARKED_PATH` - Set by Marked 2 to the current file path |
| 144 | +- `MARKED_ORIGIN` - Set by Marked 2 to the file's directory |
| 145 | + |
| 146 | +--- |
| 147 | + |
| 148 | +## slides |
| 149 | + |
| 150 | +Web-based presentation server. |
| 151 | + |
| 152 | +```bash |
| 153 | +hype slides [options] [file] |
| 154 | +``` |
| 155 | + |
| 156 | +### Options |
| 157 | + |
| 158 | +| Flag | Default | Description | |
| 159 | +|------|---------|-------------| |
| 160 | +| `-port` | `3000` | Server port | |
| 161 | + |
| 162 | +### Examples |
| 163 | + |
| 164 | +```bash |
| 165 | +# Start slides server |
| 166 | +hype slides presentation.md |
| 167 | + |
| 168 | +# Use a different port |
| 169 | +hype slides -port 8080 presentation.md |
| 170 | +``` |
| 171 | + |
| 172 | +--- |
| 173 | + |
| 174 | +## blog |
| 175 | + |
| 176 | +Static blog generator with theming support. |
| 177 | + |
| 178 | +```bash |
| 179 | +hype blog <command> [options] |
| 180 | +``` |
| 181 | + |
| 182 | +### Subcommands |
| 183 | + |
| 184 | +| Command | Description | |
| 185 | +|---------|-------------| |
| 186 | +| `init <name>` | Create a new blog project | |
| 187 | +| `build` | Build static site to `public/` | |
| 188 | +| `serve` | Start local preview server | |
| 189 | +| `new <slug>` | Create a new article | |
| 190 | +| `theme` | Manage themes (add, list, remove) | |
| 191 | + |
| 192 | +### Options |
| 193 | + |
| 194 | +| Flag | Default | Description | |
| 195 | +|------|---------|-------------| |
| 196 | +| `-timeout` | `30s` | Execution timeout | |
| 197 | +| `-v` | `false` | Verbose output | |
| 198 | + |
| 199 | +### Examples |
| 200 | + |
| 201 | +```bash |
| 202 | +# Create a new blog |
| 203 | +hype blog init mysite |
| 204 | + |
| 205 | +# Create with a theme |
| 206 | +hype blog init mysite --theme developer |
| 207 | + |
| 208 | +# Build the site |
| 209 | +hype blog build |
| 210 | + |
| 211 | +# Start preview server |
| 212 | +hype blog serve |
| 213 | + |
| 214 | +# Create a new article |
| 215 | +hype blog new hello-world |
| 216 | + |
| 217 | +# List available themes |
| 218 | +hype blog theme list |
| 219 | + |
| 220 | +# Add a theme |
| 221 | +hype blog theme add suspended |
| 222 | +``` |
| 223 | + |
| 224 | +--- |
| 225 | + |
| 226 | +## Common Options |
| 227 | + |
| 228 | +These options are available across most commands: |
| 229 | + |
| 230 | +| Flag | Description | |
| 231 | +|------|-------------| |
| 232 | +| `-f` | Input file path | |
| 233 | +| `-timeout` | Execution timeout for code blocks | |
| 234 | +| `-v` | Enable verbose/debug output | |
| 235 | + |
| 236 | +--- |
| 237 | + |
| 238 | +## Exit Codes |
| 239 | + |
| 240 | +| Code | Meaning | |
| 241 | +|------|---------| |
| 242 | +| `0` | Success | |
| 243 | +| `1` | General error | |
| 244 | + |
| 245 | +--- |
| 246 | + |
| 247 | +## Getting Help |
| 248 | + |
| 249 | +```bash |
| 250 | +# Show available commands |
| 251 | +hype |
| 252 | + |
| 253 | +# Show help for a specific command |
| 254 | +hype export --help |
| 255 | +hype preview --help |
| 256 | +hype blog --help |
| 257 | +``` |
0 commit comments