Skip to content

feat(fish): add ocd alias for open-composer CLI - #242

Merged
shunkakinoki merged 2 commits into
mainfrom
feat/fish-ocd-alias
Sep 28, 2025
Merged

feat(fish): add ocd alias for open-composer CLI#242
shunkakinoki merged 2 commits into
mainfrom
feat/fish-ocd-alias

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Sep 28, 2025

Copy link
Copy Markdown
Owner

Adds a fish shell alias 'ocd' to run the open-composer CLI via bun.\n\n- File: home-manager/programs/fish/default.nix\n- Alias: ocd = "bun run ~/ghq/github.com/shunkakinoki/open-composer/apps/cli/src/index.ts"\n\nThis streamlines launching open-composer from the terminal.

Summary by CodeRabbit

  • New Features
    • Introduces a new Fish shell alias, ocd, providing a quick terminal shortcut to run the associated command. This reduces typing and speeds up access in interactive Fish sessions by default, without altering or removing any existing aliases or behaviors.

@coderabbitai

coderabbitai Bot commented Sep 28, 2025

Copy link
Copy Markdown

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a new Fish shell alias ocd that runs a Bun command invoking the Open Composer CLI (index.ts) from a local path. No other aliases or configurations are modified.

Changes

Cohort / File(s) Change Summary
Fish shell aliases
home-manager/programs/fish/default.nix
Added alias ocd mapping to a Bun command that executes the Open Composer CLI (index.ts) from a local path.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

I twitch my nose at a shiny new key,
ocd hops fast—one alias for me!
With Bun at the ready, I bound and compile,
Local paths whisper, “run for a while.”
Thump goes my foot—commands neatly spun,
Carrots in cache, and builds on the run. 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly and accurately describes the primary change in the pull request by indicating that a new Fish shell alias named “ocd” is being added to invoke the Open Composer CLI, and it uses conventional emoji scope notation (feat(fish)) without extraneous details.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/fish-ocd-alias

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2c6d858 and 95b34a8.

📒 Files selected for processing (1)
  • home-manager/programs/fish/default.nix (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • home-manager/programs/fish/default.nix
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: docker-build-push (linux/amd64, -amd64, amd64)
  • GitHub Check: nix-nixos
  • GitHub Check: nix-darwin
  • GitHub Check: nix-linux
  • GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
  • GitHub Check: e2e-run (MacOS, macos-latest)
  • GitHub Check: e2e-run (NixOS, ubuntu-latest)

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

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @shunkakinoki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the developer workflow by adding a new alias, ocd, to the Fish shell configuration. This alias provides a quick and convenient way to launch the open-composer CLI tool, reducing the need to type out the full command and improving efficiency for users of the Fish shell.

Highlights

  • New Fish Shell Alias: Introduced a new alias ocd in the Fish shell configuration, which executes bun run ~/ghq/github.com/shunkakinoki/open-composer/apps/cli/src/index.ts.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request adds a fish shell alias ocd for the open-composer CLI. My review focuses on improving the maintainability and portability of this Nix configuration. The current implementation uses a tilde (~) to reference the home directory, which is not a best practice in Nix. I've suggested replacing it with the config.home.homeDirectory variable to make the configuration more explicit and robust.

Comment thread home-manager/programs/fish/default.nix Outdated
shellAliases = {
neofetch = "fastfetch";

ocd = "bun run ~/ghq/github.com/shunkakinoki/open-composer/apps/cli/src/index.ts";

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.

medium

Using ~ for the home directory path is generally discouraged in Nix configurations because it relies on shell expansion and makes the configuration less portable. To adhere more closely to Nix best practices, it's better to use the ${config.home.homeDirectory} variable provided by home-manager. This makes the path explicit and self-contained within the Nix evaluation, improving the robustness of your configuration.

      ocd = "bun run ${config.home.homeDirectory}/ghq/github.com/shunkakinoki/open-composer/apps/cli/src/index.ts";

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 79b559d and 2c6d858.

📒 Files selected for processing (1)
  • home-manager/programs/fish/default.nix (1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.nix

📄 CodeRabbit inference engine (CLAUDE.md)

Format all Nix files with nixfmt

**/*.nix: Nix: Use 2 spaces for indentation
Nix: Keep line length under 100 characters
Nix: Sort attribute sets alphabetically
Nix: Use consistent spacing around operators
Nix: Format lists and sets consistently

Follow the Nix expression language style guide

Files:

  • home-manager/programs/fish/default.nix
**/default.nix

📄 CodeRabbit inference engine (CLAUDE.md)

Use default.nix files for module exports

Files:

  • home-manager/programs/fish/default.nix
home-manager/**

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Keep home-manager configurations under home-manager/

Files:

  • home-manager/programs/fish/default.nix
home-manager/programs/*/default.nix

📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)

home-manager/programs/*/default.nix: Program configurations must be located in home-manager/programs// with configuration in default.nix
Program configurations should prefer Home Manager’s built-in modules when available
Program configurations should include all necessary dependencies
Program configurations should follow the provided template (programs..enable, package, and settings attrset)

Files:

  • home-manager/programs/fish/default.nix
home-manager/**/*.nix

📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)

Use proper indentation and formatting in Nix files

Files:

  • home-manager/programs/fish/default.nix
home-manager/programs/**/default.nix

📄 CodeRabbit inference engine (.cursor/rules/nix.mdc)

Program configurations in home-manager/programs should be organized by program name (one directory per program with a default.nix)

Files:

  • home-manager/programs/fish/default.nix
home-manager/programs/**/*.nix

📄 CodeRabbit inference engine (.cursor/rules/nix.mdc)

home-manager/programs/**/*.nix: Program configurations should include all necessary dependencies
Use home.packages for package installations in program configurations
Use programs. options provided by Home Manager when available

Files:

  • home-manager/programs/fish/default.nix
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: nix-nixos
  • GitHub Check: e2e-run (MacOS, macos-latest)
  • GitHub Check: e2e-run (NixOS, ubuntu-latest)
  • GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
  • GitHub Check: nix-linux
  • GitHub Check: nix-darwin
  • GitHub Check: docker-build-push (linux/amd64, -amd64, amd64)

Comment thread home-manager/programs/fish/default.nix Outdated
Comment on lines +29 to +30

ocd = "bun run ~/ghq/github.com/shunkakinoki/open-composer/apps/cli/src/index.ts";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

Make path expansion robust: use $HOME instead of ~ in the alias (fish doesn’t tilde‑expand in double quotes).

If Home Manager emits this alias with quotes (it usually does), fish will not expand ~ inside the quoted string. Use $HOME to ensure the path resolves correctly. Also, bun index.ts is equivalent to bun run index.ts; either form works.

Apply this minimal change:

-      ocd = "bun run ~/ghq/github.com/shunkakinoki/open-composer/apps/cli/src/index.ts";
+      ocd = "bun $HOME/ghq/github.com/shunkakinoki/open-composer/apps/cli/src/index.ts";

Fish quoting reference (double quotes only expand variables/command substitutions; not tilde). Bun accepts both “bun run file.ts” and “bun file.ts”. (fishshell.com)

Verification scripts:

Nit: run nixfmt to normalize whitespace (the blank line before ocd will be adjusted). As per coding guidelines.


🏁 Script executed:

#!/usr/bin/env bash
# 1) Confirm Bun is managed somewhere in Home Manager (per coding guidelines: include necessary dependencies)
rg -nP --type=nix -C2 '\b(pkgs\.bun|home\.packages.*bun|programs\.bun)\b' || echo "No explicit Bun package found in Home Manager configs."

# 2) Sanity-check the exact alias target path appears anywhere else (optional)
rg -n 'open-composer/apps/cli/src/index.ts' || echo "Target path not referenced elsewhere (ensure it exists on disk)."

Length of output: 185


Use $HOME for path expansion and add Bun to Home Manager

  • Update the alias in home-manager/programs/fish/default.nix:
    -      ocd = "bun run ~/ghq/github.com/shunkakinoki/open-composer/apps/cli/src/index.ts";
    +      ocd = "bun run $HOME/ghq/github.com/shunkakinoki/open-composer/apps/cli/src/index.ts";
  • Add pkgs.bun to your home.packages so bun is available.
  • Verify that ~/ghq/github.com/shunkakinoki/open-composer/apps/cli/src/index.ts exists on disk.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ocd = "bun run ~/ghq/github.com/shunkakinoki/open-composer/apps/cli/src/index.ts";
ocd = "bun run $HOME/ghq/github.com/shunkakinoki/open-composer/apps/cli/src/index.ts";
🤖 Prompt for AI Agents
In home-manager/programs/fish/default.nix around lines 29 to 30, the fish alias
uses a literal tilde which doesn't expand in all contexts and Bun may not be
installed; change the alias to use $HOME for a reliable home-directory expansion
(e.g. use $HOME/ghq/.../index.ts) and ensure bun is available by adding pkgs.bun
to your home.packages in your Home Manager configuration; also verify that the
target file
$HOME/ghq/github.com/shunkakinoki/open-composer/apps/cli/src/index.ts actually
exists on disk and adjust the path if needed.

@shunkakinoki
shunkakinoki merged commit 258edca into main Sep 28, 2025
20 checks passed
@shunkakinoki
shunkakinoki deleted the feat/fish-ocd-alias branch September 28, 2025 22:03
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