Skip to content

docs(cli): add Windows PowerShell completion example#1070

Open
HowardYan888 wants to merge 2 commits into
Fission-AI:mainfrom
HowardYan888:fix-cli-completion-windows-docs
Open

docs(cli): add Windows PowerShell completion example#1070
HowardYan888 wants to merge 2 commits into
Fission-AI:mainfrom
HowardYan888:fix-cli-completion-windows-docs

Conversation

@HowardYan888
Copy link
Copy Markdown
Contributor

@HowardYan888 HowardYan888 commented May 8, 2026

Problem

The shell completion documentation only showed Unix/bash examples, making it unusable for Windows users.

Solution

Added platform-specific examples for both Unix/macOS (bash) and Windows (PowerShell).

Changes

  • Add Unix/macOS (bash) example with ~/.bash_completion.d path
  • Add Windows (PowerShell) example with $PROFILE path
  • Improve clarity with platform labels

Testing

  • No code changes, documentation only
  • No lint errors

Summary by CodeRabbit

  • Documentation
    • Reformatted CLI reference for completion script generation to improve readability.
    • Inserted a “Generate script for manual installation” label to clarify intent.
    • Reorganized single-line examples into distinct platform subsections (Unix/macOS bash and Windows PowerShell) so users can find platform-specific instructions more easily.

The shell completion documentation only showed Unix/bash examples,
making it unusable for Windows users. Added platform-specific examples
for both Unix/macOS (bash) and Windows (PowerShell).

Changes:
- Add Unix/macOS (bash) example with ~/.bash_completion.d path
- Add Windows (PowerShell) example with C:\Users\y00031947\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 path
- Improve clarity with platform labels

Fixes: Windows users cannot use shell completion manual installation
@HowardYan888 HowardYan888 requested a review from TabishB as a code owner May 8, 2026 03:18
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 85e5b972-1842-4b5d-b64b-22665a8a3add

📥 Commits

Reviewing files that changed from the base of the PR and between 4ca4cd8 and 8502097.

📒 Files selected for processing (1)
  • docs/cli.md
✅ Files skipped from review due to trivial changes (1)
  • docs/cli.md

📝 Walkthrough

Walkthrough

Reformats the CLI docs: adds a "Generate script for manual installation" heading and splits openspec completion generate examples into Unix/macOS (bash) and Windows (PowerShell) subsections; the following uninstall example is unchanged.

Changes

CLI Documentation Reorganization

Layer / File(s) Summary
Platform-Specific Completion Examples
docs/cli.md
Adds "Generate script for manual installation" heading and splits openspec completion generate examples into separate Unix/macOS (bash) and Windows (PowerShell) subsections. The Uninstall section remains unchanged following the reorganized generate section.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • TabishB
  • alfred-openspec

Poem

A rabbit hops through docs with care, 🐰
Platform examples neat and fair,
Bash for Unix, PowerShell for Win,
Install scripts ready—let joy begin! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding Windows PowerShell completion examples to the CLI documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/cli.md`:
- Around line 1046-1047: The docs currently show a PowerShell snippet that uses
the overwrite redirect operator (`>`). Update the Windows (PowerShell) example
so it appends rather than overwrites: replace the line "openspec completion
generate powershell > $PROFILE" with a safe append variant — either "openspec
completion generate powershell >> $PROFILE" or the explicit PowerShell-safe form
"openspec completion generate powershell | Out-File -Append $PROFILE" and
optionally note how to edit the profile (e.g., notepad $PROFILE) so users can
inspect before modifying.
- Around line 1043-1044: The example uses a non-standard path
(~/.bash_completion.d/openspec) that isn't auto-sourced by bash on most systems;
update the docs for the "openspec completion generate bash" example to either
direct users to append to the common single-file location (~/.bash_completion)
or add a short note and the sourcing snippet that instructs users to source
~/.bash_completion.d/* from their ~/.bashrc/~/.bash_profile so the generated
file is actually loaded.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 20e99fbe-67aa-4d85-8795-1d12e879baf5

📥 Commits

Reviewing files that changed from the base of the PR and between 053d8a5 and 4ca4cd8.

📒 Files selected for processing (1)
  • docs/cli.md

Comment thread docs/cli.md
Comment on lines +1043 to 1044
# Unix/macOS (bash)
openspec completion generate bash > ~/.bash_completion.d/openspec
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Verify the bash completion path works without additional setup.

The path ~/.bash_completion.d/openspec may not work automatically on most systems. The ~/.bash_completion.d/ directory is not typically auto-sourced by bash unless explicitly configured in ~/.bashrc or ~/.bash_profile.

Consider using ~/.bash_completion instead, or document that users must source the directory:

# Add to ~/.bashrc if using ~/.bash_completion.d/
for file in ~/.bash_completion.d/*; do
  [ -r "$file" ] && source "$file"
done

Alternatively, update the example to append to the standard single-file location:

# Unix/macOS (bash)
openspec completion generate bash >> ~/.bash_completion
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/cli.md` around lines 1043 - 1044, The example uses a non-standard path
(~/.bash_completion.d/openspec) that isn't auto-sourced by bash on most systems;
update the docs for the "openspec completion generate bash" example to either
direct users to append to the common single-file location (~/.bash_completion)
or add a short note and the sourcing snippet that instructs users to source
~/.bash_completion.d/* from their ~/.bashrc/~/.bash_profile so the generated
file is actually loaded.

Comment thread docs/cli.md Outdated
Critical fix: Using '>' operator would overwrite the user's PowerShell
profile, deleting existing configurations. Changed to '>>' to append
instead of overwrite, preserving user's existing settings.
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.

1 participant