Skip to content

feat(nix): install completions#947

Open
betaboon wants to merge 1 commit into
Fission-AI:mainfrom
betaboon:feat-nix-flake-completion
Open

feat(nix): install completions#947
betaboon wants to merge 1 commit into
Fission-AI:mainfrom
betaboon:feat-nix-flake-completion

Conversation

@betaboon

@betaboon betaboon commented Apr 10, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features

    • Shell completion for Bash, Fish, and Zsh is now available and will be automatically installed on supported platforms.
  • Chores

    • Telemetry is disabled by default during installation to prevent automatic data reporting.

@betaboon betaboon requested a review from TabishB as a code owner April 10, 2026 17:47

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai

coderabbitai Bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

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: da17a8ef-b462-4987-8627-cbc281dbea82

📥 Commits

Reviewing files that changed from the base of the PR and between 4cad923 and 253838a.

📒 Files selected for processing (1)
  • flake.nix
🚧 Files skipped from review as they are similar to previous changes (1)
  • flake.nix

📝 Walkthrough

Walkthrough

The flake.nix adds installShellFiles to nativeBuildInputs and a conditional postInstall hook that, when the build can run the host platform, exports OPENSPEC_TELEMETRY=0 and generates/installs Bash, Fish, and Zsh completions for the openspec CLI.

Changes

Cohort / File(s) Summary
Build Configuration
flake.nix
Added installShellFiles to nativeBuildInputs and introduced a conditional postInstall hook that exports OPENSPEC_TELEMETRY=0 and generates/installs shell completions for openspec (Bash, Fish, Zsh). No other phases or public interfaces changed.

Sequence Diagram(s)

sequenceDiagram
    participant Builder as Builder (nix build)
    participant Host as Host Platform
    participant Openspec as `${out}/bin/openspec`
    participant Shells as Shell completion dirs

    Builder->>Host: Check canRun (buildPlatform == hostPlatform)
    alt can run on host
        Builder->>Host: export OPENSPEC_TELEMETRY=0
        Host->>Openspec: run "openspec --completion bash/fish/zsh"
        Openspec-->>Shells: write completion files to $out/.../share/{bash,fish,zsh}/completions
        Builder->>Shells: install completion files
    else cannot run
        Builder-->>Builder: skip postInstall completion generation
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • TabishB

Poem

🐰 I hopped through nix to plant a seed,
Completions sprout for those in need,
Bash, Fish, Zsh — all snugly dressed,
Telemetry quiet, installs at rest,
A tiny hop, the CLI's at speed.

🚥 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 shell completion installation to the Nix flake build process, which is the core objective of the changeset.
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.

@betaboon betaboon force-pushed the feat-nix-flake-completion branch from d98d602 to 4cad923 Compare April 17, 2026 08:39
@betaboon

Copy link
Copy Markdown
Author

@TabishB is there anything missing here? :)

@betaboon betaboon force-pushed the feat-nix-flake-completion branch from 669f581 to 253838a Compare April 22, 2026 06:36
@TabishB

TabishB commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

@betaboon we've made completion installation opt-in recently. would be good to make it standard across the board.

Mainly because of this issue: #948
ref PR: #949

@betaboon

Copy link
Copy Markdown
Author

it's rather unusual in nixpkgs to make the installation of completions optional.
The upstream package-definition for OpenSpec also just installs the completions.

The problem described in #948 is pretty much ruled out in nix/nixos.

some additional detail:
the postinstall is not used here, just the openspec completion generate command and the output is written to $out/share/bash-completions etc.

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.

2 participants