From 4155e673546371c24aedec2c60dc988d324a9923 Mon Sep 17 00:00:00 2001 From: Tibsfox Date: Sat, 28 Feb 2026 04:48:22 -0800 Subject: [PATCH] fix(cli): preserve multi-word commit messages in CLI router The commit case in the CLI router reads only args[1] for the message, which captures just the first word when the shell strips quotes before passing arguments to Node.js. This silently truncates every multi-word commit message (e.g. "docs(40): create phase plan" becomes "docs(40):"). Collect all positional args between the command name and the first flag (--files, --amend), then join them. Works correctly whether the shell preserves quotes (single arg) or strips them (multiple args). Closes #733 Co-Authored-By: Claude Opus 4.6 --- get-shit-done/bin/gsd-tools.cjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/get-shit-done/bin/gsd-tools.cjs b/get-shit-done/bin/gsd-tools.cjs index fa404eb49..48cb9cf56 100755 --- a/get-shit-done/bin/gsd-tools.cjs +++ b/get-shit-done/bin/gsd-tools.cjs @@ -259,9 +259,13 @@ async function main() { case 'commit': { const amend = args.includes('--amend'); - const message = args[1]; - // Parse --files flag (collect args after --files, stopping at other flags) const filesIndex = args.indexOf('--files'); + // Collect all positional args between command name and first flag, + // then join them — handles both quoted ("multi word msg") and + // unquoted (multi word msg) invocations from different shells + const endIndex = filesIndex !== -1 ? filesIndex : args.length; + const messageArgs = args.slice(1, endIndex).filter(a => !a.startsWith('--')); + const message = messageArgs.join(' ') || undefined; const files = filesIndex !== -1 ? args.slice(filesIndex + 1).filter(a => !a.startsWith('--')) : []; commands.cmdCommit(cwd, message, files, raw, amend); break;