v1.0 • Open Source

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

01

Local Git Repo

Extract diff from your latest commits

02

CommitChain CLI

commitchain submit

03

AI Analysis

Gemini evaluates quality, impact, security

04

IPFS Storage

Pinata CID — permanent proof

05

Blockchain Recording

Recorded on Polygon Amoy

06

Dashboard

Profile + Leaderboard

Installation

Install the CLI globally via npm:

Install globally
$ npm install -g @commitchain/cli
Verify installation
$ commitchain --version

Requirements

Before using CommitChain CLI, ensure you have:

Node.js ≥ 18
Git installed and initialized in your project
A GitHub-connected repository (recommended)
MetaMask wallet private key (for signing transactions)
Internet connection (AI + IPFS + Blockchain)

Basic Usage

Submit a Contribution

Command
commitchain submit --title "Your change title" --private-key "YOUR_PRIVATE_KEY"

Example:

Example
commitchain submit --title "Refactored authentication logic" --private-key "0xabc123..."

This will: extract git diff → analyze with AI → upload to IPFS → record on-chain → update reputation.

CLI Output Explained

COMMITCHAIN_CLI // SUBMIT_OUTPUT
╔══════════════════════════════════════════╗ ║ CommitChain — Submit Contribution ║ ╚══════════════════════════════════════════╝ ▸ Step 1 — Extracting git diff Diff lines: 13 Title: First commit hehe :3 Branch: main ▸ Step 2 — Wallet Wallet: 0x8F1C...CE49 ▸ Step 3 — AI Analysis + IPFS Summary: Code improvement and minor refactor Impact: 5/10 Risk: low IPFS CID: QmXXXX... Gateway: https://gateway.pinata.cloud/ipfs/... ▸ Step 4 — Recording on-chain TX Hash: 0x... Contribution recorded successfully! Reputation +10 earned on-chain

Command Reference

01

commitchain submit

Submit a new contribution to the protocol.

Syntax
commitchain submit --title "<title>" --private-key "<wallet_private_key>"
FlagTypeRequiredDescription
--titlestringYesTitle/description of the contribution
--private-keystringYesUser wallet private key for signing tx
02

commitchain --help

Show all available commands and usage instructions.

Usage
$ commitchain --help

AI Analysis System (Gemini)

CommitChain uses AI to automatically evaluate contributions.

Summary of code changes
Impact score (0–10)
Code quality score
Security analysis
Complexity level
Risk assessment
Contribution type (feature, bugfix, chore, refactor)
Improvement suggestions

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:

IPFS_PAYLOAD.json
{
  "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:

Calls submitContribution(title, cid)
Records contribution immutably
Updates on-chain reputation (+10 per contribution)

Stored On-Chain

Wallet Address
Title
IPFS CID
Timestamp
Reputation

User Profile & Dashboard

After submitting contributions, users can:

Connect wallet on CommitChain website
View personal contribution history
Check AI scores
Track reputation level
View global leaderboard
Explore public decentralized feed
Launch Dashboard

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

Use a burner wallet for testing
Never expose main wallet private key
Do NOT commit private keys to GitHub

Recommended (future): commitchain submit --metamask for secure wallet signing

Error Handling

Common Errors & Fixes

"No git diff found"

Fix
git add . git commit -m "Your changes"

Invalid private key

Ensure: starts with 0x, correct length (64 hex chars)

Network / RPC error

Check: Internet connection, Polygon Amoy RPC availability

Supported Environment

FeatureSupport
Git RepositoriesYes
GitHub ProjectsRecommended
Local ReposSupported
MonoreposPartial
Private ReposYes

Architecture Summary

SYSTEM_ARCH
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 historyView past contributions
commitchain reputationCheck on-chain reputation
GitHub auto-linking (repo metadata)
MetaMask secure signing (no private key flag)
AI merge conflict auto-resolution
CI/CD integration (GitHub Actions)

Why CommitChain CLI?

On-chain verifiable contributions
AI-powered code analysis
Permanent IPFS proof storage
Decentralized reputation system
Developer-first CLI workflow

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