Skip to content

Conversation

@jstirnaman
Copy link
Contributor

@jstirnaman jstirnaman commented Nov 1, 2025

…e your own documentation tutorial

Improvements to docs CLI UX for both Claude Code and external tool integration:

New docs CLI command:

  • Add scripts/docs-cli.js - main CLI with subcommand routing
  • Add bin field to package.json for docs command
  • Usage: docs create and docs edit (cleaner than yarn commands)

Smart piping detection:

  • Auto-detect when stdout is piped (!process.stdout.isTTY)

  • When piping: automatically output prompt text (no flag needed)

  • When interactive: output prompt file path

  • --print-prompt flag now optional (auto-enabled when piping)

  • Redesign of the docs CLI tools for creating and editing content

  • Cleaner interface works better for piping output to agents and downstream utilities

  • Updates README.md and other authoring docs

This repository includes a docs CLI tool for common documentation workflows:

npx docs edit https://docs.influxdata.com/influxdb3/core/admin/

npx docs placeholders content/influxdb3/core/admin/upgrade.md

npx docs --help

Specify products:

  • stdin now requires --products flag with product keys
  • --products now accepts keys from products.yml (influxdb3_core, telegraf, etc.)

Examples:

npx docs create drafts/new-feature.md --products influxdb3_core,influxdb3_enterprise

Run test cases:

npx docs test

…e your own documentation tutorial

chore(scripts): docs:create and docs:edit scripts for content creation and editing

Major improvements to docs:create UX for both Claude Code and external tool integration:

**New `docs` CLI command:**
- Add scripts/docs-cli.js - main CLI with subcommand routing
- Add bin field to package.json for `docs` command
- Usage: `docs create` and `docs edit` (cleaner than yarn commands)

**Smart piping detection:**
- Auto-detect when stdout is piped (\!process.stdout.isTTY)
- When piping: automatically output prompt text (no flag needed)
- When interactive: output prompt file path
- --print-prompt flag now optional (auto-enabled when piping)

**Specify products:**
- simplify link following behavior - treat relative paths as local files, all HTTP/HTTPS as external
- stdin now requires --products flag with product keys
- --products now accepts keys from products.yml (influxdb3_core, telegraf, etc.)

Examples:
  --products influxdb3_core
  --products influxdb3_core,influxdb3_enterprise
  --products telegraf

**Usage examples:**
  # Inside Claude Code - automatic execution
  docs create drafts/new-feature.md

  # Pipe to external AI - prompt auto-detected
  docs create FILE --products X | claude -p
  docs create FILE --products X | copilot -p

  # Pipe from stdin
  echo 'content' | docs create --products X | claude -p

Benefits:
- Cleaner syntax (no yarn --silent needed)
- No manual --print-prompt flag when piping
- Consistent with industry tools (git, npm, etc.)
- Backward compatible with yarn commands

WIP: docs:create usage examples

- Redesign of the docs CLI tools for creating and editing content
- Cleaner interface works better for piping output to agents and downstream utilities
- Updates README.md and other authoring docs

This repository includes a `docs` CLI tool for common documentation workflows:

```sh
npx docs create drafts/new-feature.md --products influxdb3_core

npx docs edit https://docs.influxdata.com/influxdb3/core/admin/

npx docs placeholders content/influxdb3/core/admin/upgrade.md

npx docs --help
```

**Run test cases:**

```sh
npx docs test
```
@jstirnaman jstirnaman changed the title chore(docs): Add content/create.md tutorial page for the How to creat… chore(docs): Redesign docs CLI tools for creating and editing content, add content/create.md tutorial page for the How to creat… Nov 1, 2025
@jstirnaman jstirnaman requested a review from sanderson November 1, 2025 22:41
Copy link
Collaborator

@sanderson sanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! I few minor nits about escaping, but feel free to ignore them.

#### Include specific files from the same directory

> [!Caution]
> \[!Caution]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be escaped?

- Avoid: "your token", "the token", "an authorization token"
3. **Database names**:
- Recommended: "the name of the database to [action]"
- Recommended: "the name of the database to \[action]"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't need escaping.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't need escaping.

The GitHub format linter escapes them to prevent interpretation as duplicate links that don't have a defined target URL. To prevent the escaping in content files, I had to remove the linter altogether - couldn't configure the behavior.

_The `placeholders` attribute supercedes the deprecated `code-placeholders` shortcode._
*The `placeholders` attribute supercedes the deprecated `code-placeholders` shortcode.*

#### Automated placeholder syntax
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool! Love this.

@jstirnaman jstirnaman merged commit e8a48e3 into master Nov 3, 2025
2 checks passed
@jstirnaman jstirnaman deleted the jts-create-docs branch November 3, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants