CLI & DEVELOPER TOOLS · GIT AUTOMATION

cogit

Transforms raw code modifications into standardized, descriptive, semantic commit messages via local or cloud AI inference.

Runtime
Node.js 18+
Standard
Conventional Commits 1.0
Privacy
Local Secret Filter
Typical Latency
< 1.2s per diff

Executive TL;DR — Engineering Brief

cogit is an authorial command line tool crafted by Alex Santos that eliminates the friction of drafting manual or vague commit messages. Unlike naive generators that send entire diffs to an LLM, cogit performs upfront syntax inspection, sanitizes sensitive tokens (.env, certs), decomposes multi-scope changes, and outputs strictly formatted Conventional Commits.

DIAGRAM & WORKFLOW

Execution Pipeline & Architecture

Macro architecture illustrating how cogit parses diffs, isolates secrets, and interacts with developer terminal workflows.

DETAILED ENGINEERING

Core Technical Pillars

Design choices, architectural patterns, and engineering decisions implemented for extreme reliability and developer experience.

01

Syntactic Diff Parsing & Intelligent Chunking

Selective filtering of noisy lockfiles and multi-directory context segmentation

Git diffs often contain noise: package-lock files, minified bundles, or binary assets. cogit inspects modified paths and removes noise automatically from context. When changes span decoupled directories (e.g. frontend/ and backend/api), cogit recommends atomic commits to preserve a spotless Git log.

02

Strict Adherence to Conventional Commits

Deterministic semantic taxonomy tailored for CI/CD and release automation

The inference engine applies few-shot prompts to map intent into canonical semantic types: feat: for features, fix: for bug fixes, refactor: for non-functional restructurings, perf: for optimizations, and chore: for maintenance. This empowers Semantic Release pipelines and CHANGELOG generators to operate seamlessly.

03

Zero-Leakage Guardrails & Local-First Privacy

Guarantees that credentials, private keys, and passwords never reach external APIs

Before any network request, the diff undergoes high-sensitivity regex scanning detecting JWT tokens, AWS/OpenAI API keys, private certificates, and environment variables. If a secret is matched, cogit redacts the line or aborts with an explicit security alert in the terminal.

04

Interactive TUI & Selective Hunk Staging

Total developer ergonomics before finalizing the commit

cogit never executes blind commits. It renders suggestions in a vibrant, keyboard-friendly TUI, allowing developers to accept with a keystroke, regenerate with alternative options, edit in their preferred $EDITOR, or reject specific hunks.

CODE IN ACTION

Terminal — Installation & cogit Usage Flow

Real-world usage, terminal configuration, and technical integration commands.

Terminal Example SHELL
# 1. Install globally via npm or npx
npm install -g @alexlivre/cogit

# 2. Stage changes in your repository
git add src/auth/jwt.service.ts src/auth/types.ts

# 3. Run cogit for instant inspection
cogit

# Output in terminal:
# [cogit] Inspecting staged diff (2 files, +42 / -15 lines)...
# [cogit] Security scan: 0 secrets detected.
# 
# Generated suggestion:
# feat(auth): implement rotating refresh tokens with secure cookie storage
# 
# [Enter] Confirm commit  |  [e] Edit in $EDITOR  |  [r] Regenerate  |  [Esc] Cancel
QUESTIONS & ANSWERS

Technical Frequently Asked Questions

Key clarifications regarding licensing, compatibility, deployment, and security.

Does cogit upload my entire codebase to the cloud?

No. cogit only inspects staged git diffs (git add). Ignored files, binaries, and matched secrets are stripped locally before any request is dispatched.

Can I use local LLMs like Ollama or custom API keys?

Yes. cogit supports ~/.cogitrc and environment variables, allowing full configuration with local Ollama models (e.g. qwen2.5-coder, llama3) or cloud providers like OpenAI and Anthropic.

What if I want to adjust the generated message?

cogit keeps the engineer in control. Press 'e' to open your default editor (VS Code, Vim, Nano) with the message pre-filled for manual refinement.

Does cogit support corporate ticketing rules?

Yes. You can define custom branch and ticket prefixes (e.g., Jira PROJ-1234) in the configuration file.