I Built an API That Reads Your Git Chaos & Writes Perfect Commits (+Catches Your Exposed API Keys)
Source: Dev.to
What I Built
The Problem That Drove Me to Build This
Commit messages matter—they’re the breadcrumbs that help us (and our teammates) understand what happened in our codebase. Writing good commit messages, however, is a hassle.
I found myself doing one of two things:
- Committing once or twice a day with lazy messages like “fix stuff” or “updates”.
- Spending way too much time crafting the “perfect” commit message for every small change.
Neither approach was sustainable. I needed something that could understand my changes and write meaningful commits for me.
Overview of GitSense API
GitSense API is a production‑ready developer toolkit that solves the commit‑message problem. Its workflow is simple:
- Initialize once – Register your project with the API.
- One command – Send your
git status, get back intelligent commit suggestions. - Copy and execute – Use the generated git commands directly.
Beyond commit messages, the API also acts as a personal security guard, scanning for exposed secrets and vulnerabilities before they hit your repository.
The Data Service It Provides
1) Smart Commit Intelligence
- Analyzes changed files and categorizes them by purpose (documentation, configuration, features, tooling).
- Generates semantic commit messages following conventional commit standards.
- Provides ready‑to‑execute git commands grouped by logical features.
2) Security Vulnerability Detection
- Scans file contents for exposed API keys (AWS, GitHub, OpenAI, Stripe, etc.).
- Detects hard‑coded passwords and database connection strings.
- Offers actionable remediation steps with specific commands.
3) Project Analytics
- Tracks commit patterns and repository analysis history.
- Maintains project metadata and suggestion history.
- Provides insights into your development workflow.
Real‑World Impact
Before GitSense
git add .
git commit -m "fix stuff" # 😅 We've all been there
After GitSense
# One API call gives you this:
git add HACKATHON_SUBMISSION.md
git commit -m 'feat: add hackathon submission documentation'
git add .vscode/settings.json
git commit -m 'chore: configure VS Code workspace settings'
git add docs/API.md
git commit -m 'docs: update project documentation'
Why This Matters
1) Individual Developers
- Saves 15–20 minutes per day on commit‑message crafting.
- Creates professional git history that impresses during code reviews.
- Prevents security disasters before they happen.
2) Development Teams
- Standardizes commit‑message format across the entire team.
- Makes git history useful for debugging and feature tracking.
- Reduces security vulnerabilities in shared repositories.
3) Project Maintainers
- Enables automatic changelog generation from semantic commits.
- Improves code‑review efficiency with descriptive commit messages.
- Provides an audit trail for security compliance.
GitSense API transforms git commits from a necessary chore into an automated, intelligent process that adds real value to your development workflow.
API Documentation
Base URL
Available Endpoints
POST /analyze-project– Initializes project analysis.POST /generate_smart_commits– Generates intelligent commit suggestions.GET /project_lookup– Retrieves project status and history.POST /Security_Analysis– Scans for security vulnerabilities.POST /generate_commit_suggestion– Basic commit message generation.
1. Initialize Project Analysis
Endpoint: POST https://x8ki-letl-twmt.n7.xano.io/api:78VRpQ6j/analyze-project
# Navigate to your project directory
cd /path/to/your/project
# Register project with GitSense API
curl -X POST "https://x8ki-letl-twmt.n7.xano.io/api:78VRpQ6j/analyze-project" \
-H "Content-Type: application/json" \
-d "{\"repo_path\": \"$(pwd)\"}"
Expected Response
{
"status": "created",
"project_id": 3,
"message": "New project created successfully.",
"repo_path": "/path/to/your/project"
}
2. Generate Smart Commit Messages
Endpoint: POST https://x8ki-letl-twmt.n7.xano.io/api:78VRpQ6j/generate_smart_commits
# From your project directory
cd /path/to/your/project
# Get intelligent commit suggestions (replace project_id with your actual ID)
curl -X POST "https://x8ki-letl-twmt.n7.xano.io/api:78VRpQ6j/generate_smart_commits" \
-H "Content-Type: application/json" \
-d "{\"project_id\": 3, \"git_status\": \"$(git status --porcelain)\"}"
Expected Response
{
"suggested_commits": [
{
"files": [".vscode/settings.json"],
"git_add": "git add .vscode/settings.json",
"git_commit": "git commit -m 'chore: configure VS Code workspace settings'",
"feature": "development_environment",
"type": "tooling"
},
{
"files": ["README.md", "docs/API.md"],
"git_add": "git add README.md docs/API.md",
"git_commit": "git commit -m 'docs: update project documentation'",
"feature": "documentation",
"type": "documentation"
}
],
"total_groups": 2,
"total_files": 6,
"analysis": "Files categorized by feature and purpose"
}
3. Check Project Status
Endpoint: GET https://x8ki-letl-twmt.n7.xano.io/api:78VRpQ6j/project_lookup
# Get project details and history
curl -X GET "https://x8ki-letl-twmt.n7.xano.io/api:78VRpQ6j/project_lookup?repo_path=$(pwd)" \
-H "Content-Type: application/json"
Expected Response
{
"project_id": 3,
"repo_path": "/path/to/your/project",
"last_analyzed": 1765775353612,
"commit_count": 0,
"recent_suggestions": [],
"status": "success"
}
4. Security Vulnerability Scan
Endpoint: POST https://x8ki-letl-twmt.n7.xano.io/api:78VRpQ6j/Security_Analysis
# Scan file contents for security issues
curl -X POST "https://x8ki-letl-twmt.n7.xano.io/api:78VRpQ6j/Security_Analysis" \
-H "Content-Type: application/json" \
-d "{\"project_id\": 3, \"file_contents\": \"$(cat .env 2>/dev/null || echo 'const apiKey = \\\"sk-test123\\\";')\"}"
Expected Response
{
"security_issues": ["Database Connection URL", "Hardcoded Password/Secret"],
"risk_level": "medium",
"suggestions": [
"Remove or use environment variables for Database Connection URL",
"Remove or use environment variables for Hardcoded Password/Secret"
],
"total_issues": 2,
"scan_timestamp": "2025-12-15T05:09:55.688Z"
}
5. Basic Commit Suggestion
Endpoint: POST https://x8ki-letl-twmt.n7.xano.io/api:78VRpQ6j/generate_commit_suggestion
(Further details omitted for brevity.)