docs-v2/scripts
Jason Stirnaman 19f1b19d72 feat: add `docs create` CLI with smart piping detection
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)

**Updated help text:**
- Show `docs create` syntax first, yarn as alternative
- Simplify examples with new CLI
- Document smart piping behavior
- Focus on two main workflows: Claude Code vs external agents

**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
2025-11-01 14:18:25 -05:00
..
lib refactor: simplify link following behavior - treat relative paths as local files, all HTTP/HTTPS as external 2025-10-31 15:05:17 -05:00
schemas chore(scripts): docs:create and docs:edit scripts for content creation and editing 2025-10-27 23:43:08 -04:00
templates chore(scripts): docs:create and docs:edit scripts for content creation and editing 2025-10-27 23:43:08 -04:00
README-add-placeholders.md chore(scripts): docs:create and docs:edit scripts for content creation and editing 2025-10-27 23:43:08 -04:00
add-placeholders.js chore(scripts): docs:create and docs:edit scripts for content creation and editing 2025-10-27 23:43:08 -04:00
docs-cli.js feat: add `docs create` CLI with smart piping detection 2025-11-01 14:18:25 -05:00
docs-create.js feat: add `docs create` CLI with smart piping detection 2025-11-01 14:18:25 -05:00
docs-edit.js chore(scripts): docs:create and docs:edit scripts for content creation and editing 2025-10-27 23:43:08 -04:00