Skip to main content

sentrix code commit

Generate or create a git commit from the currently staged snapshot for an active plans directory. Sentrix never auto-stages files.

sentrix code commit

Generate a Conventional Commit message for the currently staged snapshot in an active plans directory and optionally create the git commit. Sentrix uses the target requirements document to determine the commit scope, asks the configured AI coding agent to draft the message, validates the output, appends a canonical Implements: section, and then creates the git commit unless you opt into preview-only output. Sentrix never auto-stages files, so the currently staged snapshot determines the commit contents.

Usage#

bash
sentrix code commit [--message-only] <target>

Arguments and Options#

Argument/FlagTypeRequiredDefaultDescription
targetpathYesPath to an active plans directory containing 00-requirements.md. File targets are not accepted.
--dry-run / -nboolNofalseGlobal flag. Generate and validate the commit message but do not create a git commit. Returns the full output envelope (message, metadata, dry-run indicator).
--message-onlyboolNofalsePrint only the final assembled commit message to stdout and skip git commit. Warnings stay on stderr so stdout remains pipe-friendly for use with other tooling.

Preconditions#

The command is intentionally strict about the git snapshot it will commit:

  • The target must be an active plans directory under plans/<app>/....
  • Targets in plans/backlog/, plans/archive/, and plans/initiatives/ are rejected.
  • The directory must contain 00-requirements.md.

Commit Format#

The generated commit message follows Conventional Commits. The first line matches:

<type>(<scope>): <short description>

<longer description>

Implements:
- <requirements file>
- <plan files>

Supported types: feat, fix, chore, refactor, docs, test, perf, ci, build.

The scope is automatically set to the app name from the target requirements.

Output Modes#

Default behavior#

Without extra flags, sentrix code commit creates the git commit and returns the final message plus the created commit SHA.

--dry-run#

--dry-run is a global flag (-n) that generates and validates the commit message but does not create a git commit. The full output envelope is returned — including the commit message, agent name, and a dry-run indicator — so you can preview exactly what would happen before committing.

--message-only#

--message-only prints only the final assembled commit message on stdout and skips git commit. No metadata or envelope is included. Warnings stay on stderr so stdout remains pipe-friendly, making this ideal for piping the message into other tools (e.g., git commit -m "$(sentrix --format text code commit --message-only ...)").

Combining --dry-run and --message-only#

You can pass both flags together. The result is a pipe-friendly message on stdout with no git commit created and no extra metadata — useful when you want to inspect the raw message without side effects.

Examples#

Stage the exact snapshot you want to record, then create the git commit for an active plans directory:

bash
git add <paths>
sentrix code commit plans/website/2026-02/feature-guided-tour/

Preview the final message and metadata without creating a commit:

bash
sentrix --format text --dry-run code commit plans/website/2026-02/feature-guided-tour/

Print only the final message for piping into another command:

bash
sentrix --format text code commit --message-only plans/website/2026-02/feature-guided-tour/