Skip to main content

Commit Editor

PyPI Python License CI

An opinionated, terminal-based text editor for git commit messages, built with Textual.

  • Title length warning: Characters beyond position 50 on the first line are highlighted in red
  • Auto-wrap body text: Lines in the commit body (line 3+) are automatically wrapped at 72 characters (except for long strings that can't be wrapped, such as URLs)
  • White space: Trailing white space is automatically stripped when a file is saved; an empty newline is inserted at the end of the file if not present.
  • Signed-off-by toggle: Quickly add or remove a Signed-off-by trailer with a keyboard shortcut
  • Issue ID validation: Optionally enforce that commit titles start with an issue ID (e.g. PROJ-123:)
  • Status bar: Shows current cursor position (line/column) and title length with warnings

Installation

# Using uv
uv tool install commit-editor

# Using pip
pip install commit-editor

Requirements

  • Python 3.11 or later
  • Git (for Signed-off-by functionality)

Usage

Configure commit-editor as your default git commit message editor:

git config --global core.editor commit-editor

When you run git commit, the editor will open automatically.

commit-editor can also be used as a standalone tool with:

commit-editor path/to/file.txt

Keyboard Shortcuts

Shortcut Action
Ctrl+S Save the file
Ctrl+Q Quit
Ctrl+O Toggle Signed-off-by trailer

Additional key bindings are noted in the Textual TextArea documentation.

Configuration

Issue ID Validation

You can require commit titles to start with an issue ID by setting a regex pattern:

# Per-repository
git config commit-editor.issue-pattern 'PROJ-\d+'

# Global
git config --global commit-editor.issue-pattern 'PROJ-\d+'

The pattern is matched against the start of the title and must be followed by a colon (:). For example, with the pattern PROJ-\d+:

  • valid: PROJ-123: fix login bug
  • invalid: fix login bug

Commit Message Format

This editor enforces the widely-accepted git commit message conventions:

  1. Title (line 1): Should be 50 characters or less; characters beyond 50 are highlighted in red as a warning.
  2. Blank line (line 2): Separates the title from the body.
  3. Body (line 3+): Should wrap at 72 characters; long lines are wrapped automatically as you type.

Future Improvements

  • Color theme support

License

MIT

Metadata

Release files for commit-editor 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for commit-editor 0.8.0
File Size Uploaded Provenance
commit_editor-0.8.0.tar.gz 10.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for commit-editor 0.8.0
File Interpreter ABI Platform
commit_editor-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / commit_editor-0.8.0.tar.gz

Download URL commit_editor-0.8.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4a053e3a8d840368b37b6353a15a590ba8f27773ba8ad710156b38e4e70d4924
BLAKE2b-256 checksum
How to use checksums
59993de2bc3bb3b4240ad4f24ac9a82923d203d9fe73e69fbb73d6f18ee86f8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / commit_editor-0.8.0-py3-none-any.whl

Download URL commit_editor-0.8.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18d258cf33fbe82534206296085b8fdca66a4023f3c3d2f2151ff2057c4e92f0
BLAKE2b-256 checksum
How to use checksums
d378aaacccec6cf7d900c7f5fce61d4b7fd45492bc8f97932dd8e0fe1566dadd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Security for commit-editor 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for commit_editor-0.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page