Skip to content

Run the app on bare hunk #116

@benvinegar

Description

@benvinegar

Problem

Running hunk with no subcommand currently prints the top-level help text instead of launching the app.

For interactive use, that makes the common path feel heavier than it should be. Users naturally expect bare hunk to open the default review UI.

Current behavior

This is currently intentional and covered by tests:

  • src/core/cli.ts
    • parseCli() returns { kind: "help" } when there is no command name
  • test/cli.test.ts
    • prints help when no subcommand is passed
  • test/startup.test.ts
    • returns help output without entering app startup

Desired behavior

When invoked interactively with no subcommand, hunk should launch the app instead of printing help.

A reasonable default would be equivalent to hunk diff.

Open questions

  • Outside a Git repo, should bare hunk:
    • show a friendly repo error,
    • fall back to help,
    • or offer a more guided message?
  • If stdin is piped, should the existing pager/patch detection still take precedence? (Probably yes.)
  • Should this only apply in interactive TTY mode, while non-interactive invocations keep the current help behavior?

Acceptance criteria

  • hunk in an interactive repo-backed shell launches the main app.
  • hunk --help still prints help.
  • Existing stdin-backed pager / patch startup behavior remains unchanged.
  • The behavior outside a repo is explicit and friendly.
  • Update CLI/startup tests to encode the new default.

Notes

This is a CLI ergonomics change, but it also affects documentation and onboarding. If shipped, README/help examples should make the new default path obvious.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions