Skip to content

Commit 018f332

Browse files
refactor: improve manual commit workflow and UX
• Skip file preview when all required fields provided via CLI • Preserve and display original command for manual commits • Fix optional body prompt triggering in direct commit path • Add --body option to commit command with help text • Improve error handling for unquoted CLI arguments • Refactor commit action into two paths: direct (complete) and interactive (incomplete)
1 parent 4b71dcc commit 018f332

File tree

4 files changed

+364
-93
lines changed

4 files changed

+364
-93
lines changed

src/cli/commands/commit.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,17 @@ export const commitCommand = new Command("commit")
1717
.option("-t, --type <type>", "Commit type (feat, fix, etc.)")
1818
.option("-s, --scope <scope>", "Commit scope")
1919
.option("-m, --message <message>", "Commit subject")
20+
.option("-b, --body <body>", "Commit body/description")
2021
.option("--no-verify", "Bypass git hooks")
22+
.addHelpText(
23+
"after",
24+
`
25+
Examples:
26+
$ lab commit Create commit interactively
27+
$ lab commit -t feat -m "add feature" Quick commit with type and message
28+
$ lab commit -t feat -s api -m "add endpoint" -b "Implements REST endpoint"
29+
30+
Note: Messages and body with spaces must be quoted.
31+
`,
32+
)
2133
.action(commitAction);

0 commit comments

Comments
 (0)