A lightweight command-line tool to create directories and files for your DSA (Data Structures & Algorithms) solutions and automatically commit and push them to GitHub. Perfect for tracking LeetCode progress.
Iβve been grinding LeetCode following NeetCodeβs roadmap β and while solving problems regularly helped, I realized I had no proper system to track my progress.
I wanted something simple that could:
- Create folders and files for each solution
- Let me write the solution code directly in the terminal
- Automatically commit and push it to GitHub
So I built DSA Commiter CLI β a lightweight command-line tool that does all this in seconds.
- π Create directories and files with default code templates (e.g., .py, .js, .cpp)
- βοΈ Add multiline content (e.g., LeetCode solutions) with Ctrl+D or two blank lines to finish
- π Automatically git add, commit, and push to your current branch (main or master)
- π¨ Clean, colorful terminal interface using rich
- π‘οΈ Robust error handling for file creation and Git operations
Clone the repository:
git clone https://github.com/sem22-dev/dsa-commiter.git
cd dsa-commiterRun the installation script:
chmod +x install.sh
./install.shRun the batch installer:
install.batMake sure you have Python, pip, and Git in your system PATH.
Navigate to a project directory linked with a remote repository. Then run:
dsa-commiterFollow the prompts to:
- π Enter a directory name (or press Enter for current directory)
- π Enter a file name (e.g., solution.py)
- βοΈ Enter file content (e.g., a LeetCode solution), ending with Ctrl+D or two blank lines
- π The CLI auto-commits and pushes to your current branch
Example:
π Enter directory name (or press Enter): problems
π Supported file extensions: .py, .js, .cpp, .java, .c, .txt
π Enter file name (e.g., solution.py): solution.py
π Enter file content (Ctrl+D or two blank lines to end):
def twoSum(nums, target):
seen = {}
for i, num in enumerate(nums):
complement = target - num
if complement in seen:
return [seen[complement], i]
seen[num] = i
return []
[Ctrl+D]
π
Created directory: /path/to/problems
π
Created file: /path/to/problems/solution.py
π’ Added file: problems/solution.py
π
Committed with message: 'problems/solution.py solution'
π Pushed file: problems/solution.py to branch 'master'
If dsa-commiter is not recognized, use:
venv\Scripts\activate
python -m dsa_commiter.cli_interfacedsa-commiter/
βββ dsa_commiter/
β βββ __init__.py
β βββ cli_interface.py
β βββ file_operations.py
β βββ git_operations.py
βββ install.sh
βββ install.bat
βββ setup.py
βββ README.md
- Python 3.7+
- Git
richlibrary (installed via script)
MIT License
Happy Coding! π