Skip to main content
Version: Latest - 1.0.2

cngpac commit

Commit a staged changenote using its title as the git commit message.

Usage​

cngpac commit [options]

Options​

OptionDescription
--pushPush to origin after committing

How It Works​

  1. Scans the git index for staged files matching .changenotes/*.md
  2. Verifies there are no unstaged changenote files (exits with an error if found)
  3. Parses the changenote to extract its title
  4. Creates a git commit with the title as the commit message
  5. Optionally pushes to origin with upstream tracking

Validation Rules​

ConditionBehavior
No staged changenotesError: "No staged changenote files found"
Unstaged changenotes existError: "Stage or discard them before committing"
Multiple staged changenotesWarning: 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