Skip to content

Commit 8f981ea

Browse files
authored
Merge branch 'master' into docs-v2-issue563
2 parents 143efd5 + 925a26e commit 8f981ea

File tree

371 files changed

+1435
-451
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

371 files changed

+1435
-451
lines changed

.claude/skills/docs-cli-workflow/SKILL.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ Which do you prefer?
8383
```
8484
I can use the docs CLI to find the source files for this page:
8585
86-
npx docs edit <url>
86+
docs edit <url-or-path>
8787
8888
**Why**: [1-2 sentences explaining the benefit]
8989
9090
Options:
91-
1. **Use CLI** - I'll find and open the relevant files
91+
1. **Use CLI** - I'll find and list the relevant files (non-blocking)
9292
2. **I know the file** - Tell me the path and I'll edit directly
9393
9494
Which do you prefer?
@@ -122,14 +122,43 @@ No additional guidance needed—the CLI manages product selection, file generati
122122
# Create new documentation from a draft
123123
npx docs create <draft-path> --products <product-key>
124124

125+
# Create and open files in editor (non-blocking)
126+
npx docs create <draft-path> --products <product-key> --open
127+
128+
# Create and open, wait for editor (blocking)
129+
npx docs create <draft-path> --products <product-key> --open --wait
130+
125131
# Create at specific URL location
126132
npx docs create --url <url> --from-draft <draft-path>
127133

128-
# Find and open files for an existing page
129-
npx docs edit <url>
130-
npx docs edit --list <url> # List files without opening
134+
# Find and list files for an existing page (non-blocking, agent-friendly)
135+
docs edit <url-or-path>
136+
docs edit <url-or-path> --list # List files without opening editor
137+
138+
# Interactive editing (blocks until editor closes)
139+
docs edit <url-or-path> --wait
140+
141+
# Use specific editor
142+
docs edit <url-or-path> --editor nano
143+
144+
# Examples (both full URL and path work)
145+
docs edit https://docs.influxdata.com/influxdb3/core/admin/databases/
146+
docs edit /influxdb3/core/admin/databases/
131147
```
132148

149+
**Editor Selection** (checked in order):
150+
1. `--editor` flag
151+
2. `DOCS_EDITOR` environment variable
152+
3. `VISUAL` environment variable
153+
4. `EDITOR` environment variable
154+
5. System default
155+
156+
**Important for AI Agents**:
157+
- Both `docs edit` and `docs create --open` commands are non-blocking by default (launch editor in background and exit immediately)
158+
- This prevents agents from hanging while waiting for user editing
159+
- Use `--wait` only when you need to block until editing is complete
160+
- For `docs create`, omit `--open` to skip editor entirely (files are created and CLI exits)
161+
133162
For full CLI documentation, run `npx docs --help`.
134163

135164
## Related Skills

.github/copilot-instructions.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,96 @@
1818
| Install | `CYPRESS_INSTALL_BINARY=0 yarn install` | ~4s | Skip Cypress for CI |
1919
| Build | `npx hugo --quiet` | ~75s | NEVER CANCEL |
2020
| 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 |
2127
| Test All | `yarn test:codeblocks:all` | 15-45m | NEVER CANCEL |
2228
| Lint | `yarn lint` | ~1m | Pre-commit checks |
2329

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+
24111
## Working Effectively
25112

26113
### Collaboration approach

.github/instructions/content.instructions.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,43 @@ applyTo: "content/**/*.md"
88
**Shortcodes reference**: [DOCS-SHORTCODES.md](../../DOCS-SHORTCODES.md)
99
**Working examples**: [content/example.md](../../content/example.md)
1010

11+
## CLI Tools for Content Workflow
12+
13+
### Creating New Content
14+
15+
Use `docs create` for AI-assisted scaffolding:
16+
17+
```bash
18+
# Create from draft
19+
docs create drafts/feature.md --products influxdb3_core
20+
21+
# Create and open files in editor (non-blocking)
22+
docs create drafts/feature.md --products influxdb3_core --open
23+
24+
# Create and open, wait for editor (blocking)
25+
docs create drafts/feature.md --products influxdb3_core --open --wait
26+
```
27+
28+
### Editing Existing Content
29+
30+
Use `docs edit` to quickly find and open content files:
31+
32+
```bash
33+
# Find and list files (no editor)
34+
docs edit /influxdb3/core/admin/databases/ --list
35+
36+
# Open in editor (non-blocking, exits immediately)
37+
docs edit /influxdb3/core/admin/databases/
38+
39+
# Open and wait for editor (blocking, interactive)
40+
docs edit /influxdb3/core/admin/databases/ --wait
41+
42+
# Use specific editor
43+
docs edit /influxdb3/core/admin/databases/ --editor nano
44+
```
45+
46+
**Note:** Both commands are non-blocking by default (agent-friendly). Use `--wait` for interactive editing sessions.
47+
1148
## Required for All Content Files
1249

1350
Every content file needs:

README.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,24 @@ This repository includes a `docs` CLI tool for common documentation workflows:
2323
# Create new documentation from a draft
2424
npx docs create drafts/new-feature.md --products influxdb3_core
2525

26-
# Edit existing documentation from a URL
26+
# Create and open files in editor (non-blocking)
27+
npx docs create drafts/new-feature.md --products influxdb3_core --open
28+
29+
# Create and open, wait for editor (blocking)
30+
npx docs create drafts/new-feature.md --products influxdb3_core --open --wait
31+
32+
# Edit existing documentation (supports full URLs or paths)
2733
npx docs edit https://docs.influxdata.com/influxdb3/core/admin/
34+
npx docs edit /influxdb3/core/admin/
35+
36+
# Edit and wait for editor to close (blocking)
37+
npx docs edit /influxdb3/core/admin/ --wait
38+
39+
# List files without opening
40+
npx docs edit /influxdb3/core/admin/ --list
41+
42+
# Use a specific editor
43+
npx docs edit /influxdb3/core/admin/ --editor nano
2844

2945
# Add placeholder syntax to code blocks
3046
npx docs placeholders content/influxdb3/core/admin/upgrade.md
@@ -35,6 +51,47 @@ npx docs --help
3551

3652
The `docs` command is automatically configured when you run `yarn install`.
3753

54+
### Editor Configuration
55+
56+
The `docs edit` and `docs create --open` commands open documentation files in your preferred editor. By default, they launch the editor in the background and exit immediately (agent-friendly). Use the `--wait` flag for interactive editing sessions.
57+
58+
**Setting Your Editor:**
59+
60+
The CLI selects an editor in this priority order:
61+
62+
1. `--editor` flag
63+
2. `DOCS_EDITOR` environment variable
64+
3. `VISUAL` environment variable
65+
4. `EDITOR` environment variable
66+
5. System default (vim, nano, etc.)
67+
68+
**Examples:**
69+
70+
```sh
71+
# Set editor for all commands
72+
export EDITOR=vim
73+
74+
# Set editor specifically for docs CLI
75+
export DOCS_EDITOR=nano
76+
77+
# Use VS Code with built-in wait flag
78+
export DOCS_EDITOR="code --wait"
79+
```
80+
81+
**For Automated Workflows:**
82+
83+
The default non-blocking behavior prevents AI agents and automation scripts from hanging:
84+
85+
```sh
86+
# In a script or CI pipeline
87+
docs edit /some/url # Returns immediately
88+
echo "Editor launched" # This runs right away
89+
90+
# If you need to wait (interactive editing)
91+
docs edit /some/url --wait # Blocks until editor closes
92+
echo "Editor closed" # This waits for editor to close
93+
```
94+
3895
## Documentation
3996

4097
Comprehensive reference documentation for contributors:

content/telegraf/v1/aggregator-plugins/basicstats/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ introduced: "v1.5.0"
1010
os_support: "freebsd, linux, macos, solaris, windows"
1111
related:
1212
- /telegraf/v1/configure_plugins/
13-
- https://github.com/influxdata/telegraf/tree/v1.37.0/plugins/aggregators/basicstats/README.md, Basic Statistics Plugin Source
13+
- https://github.com/influxdata/telegraf/tree/v1.37.1/plugins/aggregators/basicstats/README.md, Basic Statistics Plugin Source
1414
---
1515

1616
# Basic Statistics Aggregator Plugin

content/telegraf/v1/aggregator-plugins/derivative/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ introduced: "v1.18.0"
1010
os_support: "freebsd, linux, macos, solaris, windows"
1111
related:
1212
- /telegraf/v1/configure_plugins/
13-
- https://github.com/influxdata/telegraf/tree/v1.37.0/plugins/aggregators/derivative/README.md, Derivative Plugin Source
13+
- https://github.com/influxdata/telegraf/tree/v1.37.1/plugins/aggregators/derivative/README.md, Derivative Plugin Source
1414
---
1515

1616
# Derivative Aggregator Plugin

content/telegraf/v1/aggregator-plugins/final/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ introduced: "v1.11.0"
1010
os_support: "freebsd, linux, macos, solaris, windows"
1111
related:
1212
- /telegraf/v1/configure_plugins/
13-
- https://github.com/influxdata/telegraf/tree/v1.37.0/plugins/aggregators/final/README.md, Final Plugin Source
13+
- https://github.com/influxdata/telegraf/tree/v1.37.1/plugins/aggregators/final/README.md, Final Plugin Source
1414
---
1515

1616
# Final Aggregator Plugin

content/telegraf/v1/aggregator-plugins/histogram/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ introduced: "v1.4.0"
1010
os_support: "freebsd, linux, macos, solaris, windows"
1111
related:
1212
- /telegraf/v1/configure_plugins/
13-
- https://github.com/influxdata/telegraf/tree/v1.37.0/plugins/aggregators/histogram/README.md, Histogram Plugin Source
13+
- https://github.com/influxdata/telegraf/tree/v1.37.1/plugins/aggregators/histogram/README.md, Histogram Plugin Source
1414
---
1515

1616
# Histogram Aggregator Plugin

content/telegraf/v1/aggregator-plugins/merge/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ introduced: "v1.13.0"
1010
os_support: "freebsd, linux, macos, solaris, windows"
1111
related:
1212
- /telegraf/v1/configure_plugins/
13-
- https://github.com/influxdata/telegraf/tree/v1.37.0/plugins/aggregators/merge/README.md, Merge Plugin Source
13+
- https://github.com/influxdata/telegraf/tree/v1.37.1/plugins/aggregators/merge/README.md, Merge Plugin Source
1414
---
1515

1616
# Merge Aggregator Plugin

content/telegraf/v1/aggregator-plugins/minmax/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ introduced: "v1.1.0"
1010
os_support: "freebsd, linux, macos, solaris, windows"
1111
related:
1212
- /telegraf/v1/configure_plugins/
13-
- https://github.com/influxdata/telegraf/tree/v1.37.0/plugins/aggregators/minmax/README.md, Minimum-Maximum Plugin Source
13+
- https://github.com/influxdata/telegraf/tree/v1.37.1/plugins/aggregators/minmax/README.md, Minimum-Maximum Plugin Source
1414
---
1515

1616
# Minimum-Maximum Aggregator Plugin

0 commit comments

Comments
 (0)