|
18 | 18 | | Install | `CYPRESS_INSTALL_BINARY=0 yarn install` | ~4s | Skip Cypress for CI | |
19 | 19 | | Build | `npx hugo --quiet` | ~75s | NEVER CANCEL | |
20 | 20 | | Dev Server | `npx hugo server` | ~92s | Port 1313 | |
| 21 | +| Create Docs | `docs create <draft> --products <keys>` | varies | AI-assisted scaffolding | |
| 22 | +| Create & Open | `docs create <draft> --products <keys> --open` | instant | Non-blocking (background) | |
| 23 | +| Create & Wait | `docs create <draft> --products <keys> --open --wait` | varies | Blocking (interactive) | |
| 24 | +| Edit Docs | `docs edit <url>` | instant | Non-blocking (background) | |
| 25 | +| Edit Docs (wait) | `docs edit <url> --wait` | varies | Blocking (interactive) | |
| 26 | +| List Files | `docs edit <url> --list` | instant | Show files without opening | |
21 | 27 | | Test All | `yarn test:codeblocks:all` | 15-45m | NEVER CANCEL | |
22 | 28 | | Lint | `yarn lint` | ~1m | Pre-commit checks | |
23 | 29 |
|
| 30 | +## CLI Tools |
| 31 | + |
| 32 | +### docs create - Create Documentation Files |
| 33 | + |
| 34 | +Scaffolds new documentation pages with AI-assisted analysis. **Optionally opens created files in editor.** |
| 35 | + |
| 36 | +**Examples:** |
| 37 | +```bash |
| 38 | +# Create from draft (no editor) |
| 39 | +docs create drafts/new-feature.md --products influxdb3_core |
| 40 | + |
| 41 | +# Create and open files (non-blocking, exits immediately) |
| 42 | +docs create drafts/new-feature.md --products influxdb3_core --open |
| 43 | + |
| 44 | +# Create and open, wait for editor (blocking, interactive) |
| 45 | +docs create drafts/new-feature.md --products influxdb3_core --open --wait |
| 46 | + |
| 47 | +# Use specific editor |
| 48 | +docs create drafts/new-feature.md --products influxdb3_core --open --editor nano |
| 49 | + |
| 50 | +# Create at specific URL location |
| 51 | +docs create --url /influxdb3/core/admin/new/ --from-draft drafts/feature.md |
| 52 | +``` |
| 53 | + |
| 54 | +**Options:** |
| 55 | +- `--open` - Open created files in editor after creation (non-blocking by default) |
| 56 | +- `--wait` - Wait for editor to close (use with `--open`) |
| 57 | +- `--editor <cmd>` - Specify editor command (use with `--open`) |
| 58 | +- `--products <keys>` - Comma-separated product keys (required) |
| 59 | +- `--dry-run` - Show what would be created without creating files |
| 60 | +- `--yes` - Skip confirmation prompt |
| 61 | + |
| 62 | +### docs edit - Edit Documentation Files |
| 63 | + |
| 64 | +Opens documentation files in your editor. **Non-blocking by default** (agent-friendly). |
| 65 | + |
| 66 | +**Examples:** |
| 67 | +```bash |
| 68 | +# Quick edit (exits immediately, editor in background) |
| 69 | +docs edit https://docs.influxdata.com/influxdb3/core/admin/databases/ |
| 70 | +docs edit /influxdb3/core/admin/databases/ |
| 71 | + |
| 72 | +# Interactive edit (waits for editor to close) |
| 73 | +docs edit /influxdb3/core/admin/databases/ --wait |
| 74 | + |
| 75 | +# List files without opening |
| 76 | +docs edit /influxdb3/core/admin/databases/ --list |
| 77 | + |
| 78 | +# Use specific editor |
| 79 | +docs edit /influxdb3/core/admin/databases/ --editor nano |
| 80 | +``` |
| 81 | + |
| 82 | +**Options:** |
| 83 | +- `--list` - List files without opening editor |
| 84 | +- `--wait` - Wait for editor to close (blocking mode) |
| 85 | +- `--editor <cmd>` - Specify editor command |
| 86 | + |
| 87 | +### Editor Configuration |
| 88 | + |
| 89 | +Both `docs create --open` and `docs edit` use the same editor resolution: |
| 90 | + |
| 91 | +**Priority order:** |
| 92 | +1. `--editor` flag |
| 93 | +2. `DOCS_EDITOR` environment variable |
| 94 | +3. `VISUAL` environment variable |
| 95 | +4. `EDITOR` environment variable |
| 96 | +5. System default (vim, nano, etc.) |
| 97 | + |
| 98 | +**Examples:** |
| 99 | +```bash |
| 100 | +export EDITOR=vim # For all CLI tools |
| 101 | +export DOCS_EDITOR=nano # Specifically for docs CLI |
| 102 | +export DOCS_EDITOR="code --wait" # VS Code with wait flag |
| 103 | +``` |
| 104 | + |
| 105 | +**Important for AI Agents:** |
| 106 | +- Both commands are **non-blocking by default** (exit immediately) |
| 107 | +- This prevents agents and automation from hanging |
| 108 | +- Use `--wait` flag only when you need blocking behavior |
| 109 | +- For `docs create`, omit `--open` to skip editor entirely |
| 110 | + |
24 | 111 | ## Working Effectively |
25 | 112 |
|
26 | 113 | ### Collaboration approach |
|
0 commit comments