GitHub-like version control system with AI-powered auto-updates and merge conflict resolution
Project description
CodeVault - AI-Powered Version Control System
A lightweight, GitHub-like version control system with AI-powered merge conflict resolution. Perfect for solo developers and small teams who want the power of version control without the complexity of Git.
โจ What's New in v1.1.0
๐ AI-Powered Merge Conflict Resolution - When two people edit the same file, CodeVault uses AI to intelligently merge both changes automatically!
No more cryptic conflict markers. No more manual merging. Just smart, automatic resolution that preserves functionality from both versions.
๐ Features
Core Version Control
- ๐ฆ Push: Store code snapshots with automatic change detection
- โฌ๏ธ Pull: Restore code from any previous commit
- ๐๏ธ Delete: Remove commits from history
- ๐ Log: View commit history with timestamps and insights
- ๐ท๏ธ Semantic Versioning: Auto-bumps version based on change type
AI Superpowers โจ
- ๐ค Auto-Commit Messages: AI analyzes your code and generates professional commit messages
- ๐ Smart Merge: Automatically resolves conflicts when multiple people edit the same file
- ๐ Code Insights: AI classifies changes (feat/fix/refactor) and risk level
- ๐ฏ Impact Analysis: Identifies which functions/modules were affected
Merge Conflict Resolution ๐
- Automatic Detection: Knows when your changes conflict with the latest version
- Three Strategies:
ai- AI intelligently merges both versions (recommended)local- Keep your changesremote- Keep their changes
- Safe Workflow: Automatic backups before merging
- Manual Fallback: Traditional conflict markers if AI can't resolve
๐ฆ Installation
pip install selfvcs
Setup API Key (for AI features)
Get a free API key from Groq Console
# Option 1: Environment variable
export GROQ_API_KEY="gsk_your_key_here"
# Option 2: Save to config (persistent)
codevault auth set gsk_your_key_here
๐ฏ Quick Start
Basic Usage
# Initialize repository
codevault init
# Push code with AI-generated message
codevault push myfile.py --auto-detect
# Or use manual message
codevault push myfile.py -m "Add new feature"
# View history
codevault log
# Restore old version
codevault pull abc12345
Handling Merge Conflicts
Scenario: You and a teammate both edited app.py
# Try to push - conflict detected!
codevault push app.py -m "My changes"
# โ Merge conflicts detected in 1 file(s)
# Check what's conflicting
codevault check-conflicts app.py
# Let AI resolve it automatically
codevault auto-merge app.py --strategy ai
# โ AI resolved: app.py
# Review the merged code
cat app.py
# Push the merge
codevault push app.py -m "Merged changes"
๐ Complete Command Reference
Repository Management
codevault init # Initialize repository
codevault status # Show repo status
codevault log -n 20 # Show last 20 commits
Version Control
codevault push <files> -m "msg" # Commit with message
codevault push <files> --auto-detect # AI generates message
codevault push <files> --force # Force push (skip conflict check)
codevault pull <commit-id> # Restore commit
codevault delete <commit-id> # Delete commit
Merge Conflicts ๐
codevault check-conflicts <files> # Check for conflicts
codevault auto-merge <files> --strategy ai # AI merge (default)
codevault auto-merge <files> --strategy local # Keep local changes
codevault auto-merge <files> --strategy remote # Keep remote changes
Insights & Analytics
codevault insight <commit-id> # View commit details
codevault changelog -n 50 # Generate changelog
Configuration
codevault auth set <api-key> # Set GROQ API key
๐ก Real-World Example
Problem: Two developers, same file
Developer A adds shipping logic:
def calculate_total(items):
total = sum(item.price * item.qty for item in items)
shipping = 5.99 if total < 50 else 0
return total + shipping
Developer B adds tax calculation:
def calculate_total(items):
total = sum(item.price * item.qty for item in items)
tax = total * 0.08
return total + tax
Solution: AI Auto-Merge
# Developer A tries to push
codevault push app.py -m "Add shipping"
# โ Merge conflicts detected
# AI resolves automatically
codevault auto-merge app.py --strategy ai
Result: AI merges BOTH features:
def calculate_total(items):
total = sum(item.price * item.qty for item in items)
tax = total * 0.08
shipping = 5.99 if total < 50 else 0
return total + tax + shipping
โ
Both shipping AND tax preserved!
โ
No manual editing needed!
โ
Code works correctly!
๐จ Use Cases
- Solo Developers: Track your code history without Git complexity
- Small Teams: Collaborate without merge headaches
- Learning: Understand version control concepts
- Prototyping: Quick versioning for experiments
- Code Reviews: AI-assisted merging of feedback
โ๏ธ How AI Merge Works
- Detection: Compares local file vs last commit, finds conflicts
- Analysis: AI (Llama 70B) examines both versions for:
- Function signatures and logic
- Code semantics and intent
- Style and formatting
- Resolution: Generates merged version that:
- Keeps functionality from both
- Removes duplicates
- Maintains consistency
- Safety: Creates backup, writes merge, allows review
๐ Safety Features
- Automatic Backups: Original files backed up before merge
- Conflict Detection: Won't let you overwrite accidentally
- Force Override: Available but requires explicit
--forceflag - Manual Fallback: Traditional markers if AI fails
- Semantic Versioning: Auto-tracks breaking vs non-breaking changes
๐ Best Practices
-
Check before pushing
codevault check-conflicts myfile.py
-
Review AI merges
- Check merged file
- Run tests
- Then commit
-
Small, frequent commits
- Easier to merge
- Better AI performance
-
Use auto-detect for messages
codevault push --auto-detect
-
Choose the right strategy
ai- When both changes matterlocal- When you know yours is rightremote- When their version is better
๐ง Advanced Configuration
Multiple Projects
Each project gets its own .codevault/ directory:
cd project1
codevault init
codevault push src/ -m "Project 1 changes"
cd ../project2
codevault init
codevault push app/ -m "Project 2 changes"
API Key Priority
CodeVault checks in this order:
GROQ_API_KEYenvironment variableCODEVAULT_GROQ_KEYenvironment variable~/.codevault/config.json(fromauth set)
Custom Workflow
from codevault import CodeVault
vault = CodeVault()
# Check conflicts programmatically
has_conflicts, conflicts = vault._detect_merge_conflicts(['app.py'])
if has_conflicts:
# Auto-resolve
result = vault.auto_merge(['app.py'], strategy='ai')
print(result)
๐ Repository Structure
your-project/
โโโ .codevault/
โ โโโ commits/ # All commit snapshots
โ โ โโโ abc12345/
โ โ โโโ commit.json
โ โ โโโ file.snapshot
โ โโโ merge/ # Backup files during merge
โ โโโ metadata.json # Repo metadata & history
โ โโโ index.json # Staging area
โโโ your files...
~/.codevault/
โโโ config.json # Global user config (API key)
โ FAQ
Q: Do I need Git?
A: No! CodeVault is standalone.
Q: Can I use it without the AI features?
A: Yes! All commands work without an API key. Just use --strategy local or --strategy remote for merges.
Q: Is my code sent to the cloud?
A: Only when using AI features (commit messages, merge). The code snippets sent to Groq are truncated (first ~4000 chars). All commits are stored locally.
Q: What if AI merge fails?
A: CodeVault falls back to traditional conflict markers for manual resolution.
Q: Can I use this in production?
A: CodeVault is great for personal projects and small teams. For large teams or critical production, we still recommend Git.
Q: How much does it cost?
A: CodeVault is free. Groq offers a generous free tier for the AI features.
๐ Troubleshooting
"GROQ_API_KEY not set"
export GROQ_API_KEY="your_key"
# or
codevault auth set your_key
"Merge conflicts detected"
# Check details
codevault check-conflicts file.py
# Auto-resolve
codevault auto-merge file.py --strategy ai
"AI failed, added markers"
File now has conflict markers - manually edit and push:
# Edit file to resolve
nano file.py
# Push resolved version
codevault push file.py -m "Manual merge"
๐ค Contributing
Issues and pull requests welcome!
- Fork the repo
- Create a feature branch
- Make your changes
- Add tests
- Submit PR
๐ License
MIT License - see LICENSE file
๐ Credits
- Groq for fast LLM inference
- Llama 3 for intelligent code understanding
- Inspired by Git's version control system
๐ Support
- ๐ Full Documentation
- ๐ Issue Tracker
- ๐ฌ Discussions
Made with โค๏ธ to make version control intelligent and accessible
Give it a โญ if you find it useful!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codevaultai-1.1.2.tar.gz.
File metadata
- Download URL: codevaultai-1.1.2.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b0e7c370fd058f69be8c7350f2b0bf9ff5583d4399139676d0ad5b3fe8aca52
|
|
| MD5 |
d008b6fc321a18edb9236cc3c5b6f622
|
|
| BLAKE2b-256 |
d05271f2019c142630c1db20ab731acf770b79e85f990723a3e4fb2d2e3e0483
|
File details
Details for the file codevaultai-1.1.2-py3-none-any.whl.
File metadata
- Download URL: codevaultai-1.1.2-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1a1d70625c8705d7719fb6059e6facb62db7639584f6d4682e8f4eb60a8e718
|
|
| MD5 |
69c0165d58ba0334f67a182e0c9ee7ba
|
|
| BLAKE2b-256 |
47132575a1b5b02ab5ccb7a98b61c9203010a3babf846b8b9275f91e7d1ff823
|