Skip to content

Call the CLI bananasplit in its own output when run by that name - #50

Merged
Diogomartf merged 1 commit into
mainfrom
bananasplit-name
Oct 27, 2026
Merged

Diogomartf merged 1 commit into
mainfrom
bananasplit-name

Conversation

@Diogomartf

Copy link
Copy Markdown
Contributor

Run as `bananasplit`, the CLI now uses that name throughout its own output: help, examples, `version`, and its messages and errors. For example, `bananasplit --help` shows `bananasplit [--json | --raw]`. Run as `banana`, nothing changes.

How it knows the name

  • Compiled binary (install.sh, Homebrew): reads `process.argv0`, which keeps the name typed even through the symlink.
  • Windows: the `bananasplit.cmd` shim now sets `BANANA_INVOKED_AS=bananasplit`. `uninstall` still recognises the shim v0.5.0 installed.
  • npm/Bun: the `bananasplit` bin is now its own entry file, `src/bananasplit.ts`, because a package install can't tell the name any other way.

What gets renamed

  • Only the CLI's own text, through `renameCommand()`: a `banana` that opens a line, sits in backticks, or follows "for".
  • API data is never rewritten, so an expense called "banana bread" stays one.
  • `skill install --print` and the skill's name (`banana`) stay as they are.
  • API error bodies stay as the server sent them.

Also

  • The release workflow's `bananasplit --help` checks now expect the `bananasplit` usage line, and the formula's test checks both names.
  • The README opens with "Run banana or bananasplit from any directory:".
  • `AGENTS.md` explains how the name is detected.

Tested: `bun test` (326 pass) and `bun run typecheck`. I built a compiled binary and ran it through a symlink: no `banana` command remains in `bananasplit --help`, and `banana --help` is unchanged. The release workflow runs the Windows shim on this PR.

Help, examples, version, and the CLI's messages and errors use the name the
CLI was started by. Compiled binaries read it from argv0, the Windows shim
passes it in BANANA_INVOKED_AS, and the package's bananasplit bin is its own
entry file. API data and the skill's name are left alone.

README opens with both names.
@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The change affects the CLI’s displayed name and Windows alias recognition.

The PR appears safe to merge, with non-blocking fixes needed for incomplete name changes and altered names in errors.

Fix All in Claude CodeFindings

  1. P2 Colored examples keep old name ▶
  2. P2 Doctor fixes keep old name ▶
  3. P2 Follow-up commands keep old name ▶
  4. P2 Errors change actual group names ▶
Fix with agent prompt
### Issue 1
src/cli.ts:351
On a color terminal, `bananasplit --help` still shows `banana` in its examples. `colorizeHelp()` puts a color escape before each example, so `renameCommand()` no longer sees `banana` at the start of the line. Rename the plain help text before adding color.

```suggestion
      stdout(colorizeHelp(renameCommand(command.text, name)));
```

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 2
src/shared.ts:69
`bananasplit doctor` still suggests `banana login` and `banana skill install`. `formatChecks()` puts `→ ` before these commands, but `renameCommand()` only accepts line-start whitespace, a backtick, or `for `. Pass the chosen name into these suggestions, or support their actual format.

### Issue 3
src/cli.ts:336-339
Keeping every request result outside `say()` also leaves the CLI's own follow-up commands unchanged. For example, `bananasplit recurring list` always prints `banana recurring get`, and paged group lists suggest `banana groups list`. Pass the chosen name to the presenters for their hints while leaving returned names and titles untouched.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 4
src/cli.ts:712
Renaming the whole error message can change names supplied by the user or returned by the API. If a group lookup for `Dinner for banana` matches several groups, the error now reports `Dinner for bananasplit` and can also change the listed group names. Rename command suggestions when building them, rather than rewriting the complete error.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR detects the invoked command name and uses it for CLI-owned output.

  • The CLI calls itself bananasplit when it is run under that name.
  • Uninstall recognizes both versions of the Windows alias.

Reviews (1) · Last reviewed commit: "Call the CLI bananasplit in its own outp..." · Reviewed by Greptile

Comment thread src/cli.ts
const command = parseCommand(output.args);
if (command.kind === "help") {
stdout(colorizeHelp(command.text));
say(colorizeHelp(command.text));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Colored examples keep old name

On a color terminal, bananasplit --help still shows banana in its examples. colorizeHelp() puts a color escape before each example, so renameCommand() no longer sees banana at the start of the line. Rename the plain help text before adding color.

Suggested change
say(colorizeHelp(command.text));
stdout(colorizeHelp(renameCommand(command.text, name)));
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli.ts
Line: 351

Comment:
**Colored examples keep old name**

On a color terminal, `bananasplit --help` still shows `banana` in its examples. `colorizeHelp()` puts a color escape before each example, so `renameCommand()` no longer sees `banana` at the start of the line. Rename the plain help text before adding color.

```suggestion
      stdout(colorizeHelp(renameCommand(command.text, name)));
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Cursor Fix in Codex

Comment thread src/shared.ts
export function renameCommand(text: string, name: string) {
return name === "banana"
? text
: text.replace(/(^[ \t]*|`|for )banana(?![\w-])/gm, `$1${name}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Doctor fixes keep old name

bananasplit doctor still suggests banana login and banana skill install. formatChecks() puts → before these commands, but renameCommand() only accepts line-start whitespace, a backtick, or for . Pass the chosen name into these suggestions, or support their actual format.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/shared.ts
Line: 69

Comment:
**Doctor fixes keep old name**

`bananasplit doctor` still suggests `banana login` and `banana skill install`. `formatChecks()` puts `→ ` before these commands, but `renameCommand()` only accepts line-start whitespace, a backtick, or `for `. Pass the chosen name into these suggestions, or support their actual format.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Cursor Fix in Codex

Comment thread src/cli.ts
Comment on lines +336 to +339
// The CLI's own messages, under the name it was run as. Responses go to
// stdout untouched.
const name = runtime.programName ?? "banana";
const say = (text: string) => stdout(renameCommand(text, name));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Follow-up commands keep old name

Keeping every request result outside say() also leaves the CLI's own follow-up commands unchanged. For example, bananasplit recurring list always prints banana recurring get, and paged group lists suggest banana groups list. Pass the chosen name to the presenters for their hints while leaving returned names and titles untouched.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli.ts
Line: 336-339

Comment:
**Follow-up commands keep old name**

Keeping every request result outside `say()` also leaves the CLI's own follow-up commands unchanged. For example, `bananasplit recurring list` always prints `banana recurring get`, and paged group lists suggest `banana groups list`. Pass the chosen name to the presenters for their hints while leaving returned names and titles untouched.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Cursor Fix in Codex

Comment thread src/cli.ts
} catch (error) {
const failure = serializeFailure(error, outputMode);
stderr(failure.output);
if (failure.authored) warn(failure.output);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Errors change actual group names

Renaming the whole error message can change names supplied by the user or returned by the API. If a group lookup for Dinner for banana matches several groups, the error now reports Dinner for bananasplit and can also change the listed group names. Rename command suggestions when building them, rather than rewriting the complete error.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli.ts
Line: 712

Comment:
**Errors change actual group names**

Renaming the whole error message can change names supplied by the user or returned by the API. If a group lookup for `Dinner for banana` matches several groups, the error now reports `Dinner for bananasplit` and can also change the listed group names. Rename command suggestions when building them, rather than rewriting the complete error.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Cursor Fix in Codex

@Diogomartf
Diogomartf merged commit cb435eb into main Oct 27, 2026
16 checks passed
@Diogomartf
Diogomartf deleted the bananasplit-name branch October 27, 2026 18:40
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