CommitChain CLI
@commitchain/cli — AI-Powered Decentralized Contribution Tool. Submit verifiable code contributions on-chain with AI analysis and IPFS proof.
Overview
CommitChain CLI is a developer tool that allows you to submit code contributions directly from your local Git repository to the CommitChain protocol.
It extracts your git diff, analyzes code using AI (Gemini), uploads contribution data to IPFS (Pinata), and records proof + reputation on Polygon blockchain. This creates a tamper-proof, AI-verified contribution history tied to your wallet.
AI Analysis
Gemini evaluates code quality, security, and impact
IPFS Storage
Immutable proof stored permanently via Pinata
On-Chain Record
Proof + reputation on Polygon blockchain
How It Works
Local Git Repo
Extract diff from your latest commits
CommitChain CLI
commitchain submit
AI Analysis
Gemini evaluates quality, impact, security
IPFS Storage
Pinata CID — permanent proof
Blockchain Recording
Recorded on Polygon Amoy
Dashboard
Profile + Leaderboard
Installation
Install the CLI globally via npm:
Requirements
Before using CommitChain CLI, ensure you have:
Basic Usage
Submit a Contribution
Example:
This will: extract git diff → analyze with AI → upload to IPFS → record on-chain → update reputation.
CLI Output Explained
Command Reference
commitchain submit
Submit a new contribution to the protocol.
| Flag | Type | Required | Description |
|---|---|---|---|
| --title | string | Yes | Title/description of the contribution |
| --private-key | string | Yes | User wallet private key for signing tx |
commitchain --help
Show all available commands and usage instructions.
AI Analysis System (Gemini)
CommitChain uses AI to automatically evaluate contributions.
This AI report is stored permanently on IPFS and linked on-chain.
IPFS Storage (Proof Layer)
Each submission uploads a JSON payload to IPFS containing:
{
"title": "Fix login bug",
"diff": "...git diff...",
"aiReport": {
"summary": "...",
"impact": 7,
"quality": 8
},
"timestamp": 123456789
}Returned CID example: QmRT52SACuDLvMJ5cEXATmfhhiVYQFZiGpY6YDFFS69Hnc
This CID acts as permanent proof of contribution.
Blockchain Integration (Polygon Amoy)
After IPFS upload, the CLI:
submitContribution(title, cid)Stored On-Chain
User Profile & Dashboard
After submitting contributions, users can:
Security Notice
Private Key Usage
The --private-key flag is used ONLY to sign blockchain transactions locally. It is never stored by CommitChain servers.
Best Practices
Recommended (future): commitchain submit --metamask for secure wallet signing
Error Handling
Common Errors & Fixes
"No git diff found"
Invalid private key
Ensure: starts with 0x, correct length (64 hex chars)
Network / RPC error
Check: Internet connection, Polygon Amoy RPC availability
Supported Environment
| Feature | Support |
|---|---|
| Git Repositories | Yes |
| GitHub Projects | Recommended |
| Local Repos | Supported |
| Monorepos | Partial |
| Private Repos | Yes |
Architecture Summary
CLI (Node.js) ├── simple-git → Extract diff ├── Gemini API → AI analysis ├── Pinata API → IPFS upload └── ethers.js → Blockchain tx (Polygon)
Frontend Role: Wallet connect, Profile view, Leaderboard, Public contribution feed
Roadmap
commitchain history→ View past contributionscommitchain reputation→ Check on-chain reputationWhy CommitChain CLI?
License
MIT License © CommitChain
Support
For issues, feature requests, or bugs: GitHub Issues, Website (commitchain.xyz)
Ready to Start Building?
Submit your first contribution and start earning on-chain reputation.
Launch Dashboard