worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

Manual commit message

Open viicslen opened this issue 8 months ago • 3 comments

It would be good to have an option where instead of using LLM commit messages or falling back to a deterministic message, it would ask the user to input the commit message.

My current issues with the current implementation is

  • LLM commit messages although small, they still consume usage
  • Fallback messages do not follow team guidelines for messages when using something like commit lint

viicslen avatar Mar 12 '26 16:03 viicslen

Thanks for the suggestion! I searched the codebase and confirmed there is no existing option for manually providing commit messages. Currently, wt step commit either generates a message via a configured LLM command or falls back to a deterministic message like "Changes to N files" — there's no --message flag or interactive prompt.

The closest related functionality:

  • --show-prompt on wt step commit outputs the rendered LLM prompt to stdout, which can be piped to other tools — but it doesn't help with manual input.
  • commit.generation.command in config lets you set an arbitrary shell command, so in theory you could point it at something like cat or a script that opens $EDITOR, but that's a workaround rather than a proper feature.

A --message flag (similar to git commit -m) would be a straightforward addition that addresses both concerns (avoiding LLM usage costs and following team commit message conventions).

I'll leave it for a maintainer to evaluate and prioritize.

worktrunk-bot avatar Mar 12 '26 17:03 worktrunk-bot

thanks for the suggestion @viicslen

commit.generation.command in config lets you set an arbitrary shell command, so in theory you could point it at something like cat or a script that opens $EDITOR, but that's a workaround rather than a proper feature.

this sounds pretty good! @worktrunk-bot could we add an example to the "tips & practices" of this? one for changing the config and another using env vars as part of an an alias?

max-sixty avatar Mar 12 '26 19:03 max-sixty

Added a "Manual commit messages" section to tips & patterns in #1469 with two recipes:

Config-based — set commit.generation.command to read from the terminal:

[commit.generation]
command = "cat > /dev/null && exec < /dev/tty && IFS= read -rp 'Commit message: ' msg && printf '%s' \"$msg\""

Env var alias — override per-command without changing the default LLM config:

# Pass a fixed message via env var
wtcm() { WORKTRUNK_COMMIT__GENERATION__COMMAND="echo $1" wt step commit; }
# Usage: wtcm "fix: resolve auth timeout"

worktrunk-bot avatar Mar 12 '26 19:03 worktrunk-bot