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;