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

@HowardYan888 HowardYan888 commented May 8, 2026

Copy link
Copy Markdown
Contributor

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
    • Reworked CLI completion script generation section for clearer, step-by-step guidance.
    • Added a “Generate script for manual installation” label to clarify intent.
    • Split examples into platform-specific subsections (Unix/macOS bash and Windows PowerShell) with appropriate output redirection commands.
    • Moved uninstall guidance to follow the generate block for better flow.

@HowardYan888
HowardYan888 requested a review from TabishB as a code owner May 8, 2026 03:18
@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

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: 4fe6c029-7f84-4daf-b15d-77af9b547c6e

📥 Commits

Reviewing files that changed from the base of the PR and between 933e35b and 88f6ad1.

📒 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

Poem

A rabbit hops through docs with care, 🐰
Platform examples tidy, split with flair,
Bash for Unix, PowerShell for Win,
Install scripts ready—let the setup 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 'docs(cli): add Windows PowerShell completion example' accurately captures the main change—adding Windows PowerShell documentation for shell completion.
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.

@coderabbitai coderabbitai Bot left a comment

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.

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
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
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.
@HowardYan888
HowardYan888 force-pushed the fix-cli-completion-windows-docs branch from 933e35b to 88f6ad1 Compare June 4, 2026 06:31
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