cngpac commit
Commit a staged changenote using its title as the git commit message.
Usage
cngpac commit [options]
Options
| Option | Description |
|---|---|
--push | Push to origin after committing |
How It Works
- Scans the git index for staged files matching
.changenotes/*.md - Verifies there are no unstaged changenote files (exits with an error if found)
- Parses the changenote to extract its title
- Creates a git commit with the title as the commit message
- Optionally pushes to origin with upstream tracking
Validation Rules
| Condition | Behavior |
|---|---|
| No staged changenotes | Error: "No staged changenote files found" |
| Unstaged changenotes exist | Error: "Stage or discard them before committing" |
| Multiple staged changenotes | Warning: uses the first one |
Examples
Commit only
cngpac commit
◇ Commiting → ".changenotes/brave-coral-fox.md"
◇ Committed → feat: add dark mode support → feature/dark-mode
Commit and push
cngpac commit --push
◇ Commiting → ".changenotes/brave-coral-fox.md"
◇ Committed → feat: add dark mode support → feature/dark-mode
◇ Pushing → feature/dark-mode → origin/feature/dark-mode
◇ Pushed → feature/dark-mode → origin/feature/dark-mode