From 4d309c313d8fcd7beb941cdd0329ab40dee3b2c3 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Wed, 24 Dec 2025 23:44:23 +0545 Subject: [PATCH] 1. Title: `feat(root): add TODO.md for project roadmap and tasks` --- TODO.md | 30 ++++++++++++++++++++++++++++++ devgen/cli/commit.py | 24 ++++++++++++++++++++++++ devgen/cli/main.py | 2 +- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 TODO.md diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..309882b --- /dev/null +++ b/TODO.md @@ -0,0 +1,30 @@ +# 📋 Project Roadmap & TODOs + +This document outlines future improvements, features, and technical debt for `devgen`. + +## 🚀 Priority: Short-Term (Reliability & DX) +- [ ] **Full Test Suite**: Implement `pytest` for all modules, especially `commit_generator` and `utils`. +- [ ] **Interactive Commit Review**: Add a `--check` flag to `devgen commit run` that allows users to approve/edit the AI message before committing. +- [ ] **Project-Level Config**: Support `.devgen.yaml` in the repository root that overrides global `~/.devgen.yaml`. +- [ ] **Improved Gitignore Detection**: Auto-detect project type (Python, Node, Go) and suggest relevant `.gitignore` templates during `devgen gitignore run`. + +## 🤖 AI & Intelligence +- [ ] **Custom Prompts**: Allow users to define their own Jinja2 templates for commits in the config file. +- [ ] **Context-Aware Commits**: Send the manifest file (`package.json`, `pyproject.toml`) to the AI to provide better context for dependency changes. +- [ ] **Token Usage Dashboard**: Add a `devgen config tokens` command to estimate or track AI token consumption. +- [ ] **More Providers**: Add support for **Mistral**, **Cohere**, and **Groq** for faster/cheaper generations. + +## 🛠️ Developer Experience (DX) +- [ ] **Pre-commit Hook Integration**: Provide a command to easily install `devgen` as a pre-commit hook. +- [x] **Shell Completion**: Implement `typer` shell completion for `bash`, `zsh`, and `fish`. +- [x] **Commit Undo**: `devgen commit undo` to easily revert the last AI-generated commit and unstage files. +- [ ] **Multi-Group Commits**: Better handling of repositories where changes are spread across many unrelated directories. + +## 🏗️ Refactoring & Technical Debt +- [ ] **Code Split**: Move CLI logic out of `devgen/cli` into separate service classes to improve testability. +- [ ] **Consistent Logging**: Standardize log output across all modules. +- [ ] **API Documentation**: Use Sphinx or MkDocs to generate documentation for the core modules. + +## 🌍 Ecosystem +- [ ] **GitHub Action**: Create an official `devgen` GitHub Action for automated changelog updates on PR merge. +- [ ] **VS Code Extension**: A simple extension to trigger `devgen commit` from the sidebar. diff --git a/devgen/cli/commit.py b/devgen/cli/commit.py index 1238d9e..c6dfa42 100644 --- a/devgen/cli/commit.py +++ b/devgen/cli/commit.py @@ -1,5 +1,6 @@ from typing import Annotated +import questionary import typer from devgen.modules.commit_generator import run_commit_engine @@ -94,3 +95,26 @@ def validate() -> None: typer.echo(f"- {f}") else: typer.secho("[i] No staged files.", fg=typer.colors.RED) + + +@app.command("undo") +def undo_commit() -> None: + """Undoes the last commit but keeps changes staged.""" + from devgen.utils import run_git_command + + try: + # Check if there's at least one commit + run_git_command(["git", "rev-parse", "HEAD"]) + except Exception: + typer.secho("No commits found to undo.", fg=typer.colors.RED) + return + + if questionary.confirm( + "Are you sure you want to undo the last commit? (Changes will remain staged)", + default=False, + ).ask(): + try: + run_git_command(["git", "reset", "--soft", "HEAD~1"]) + typer.secho("Last commit undone. Changes are still staged.", fg=typer.colors.GREEN) + except Exception as e: + typer.secho(f"Failed to undo commit: {e}", fg=typer.colors.RED) diff --git a/devgen/cli/main.py b/devgen/cli/main.py index e640b71..9c0ce25 100644 --- a/devgen/cli/main.py +++ b/devgen/cli/main.py @@ -15,7 +15,7 @@ from devgen.cli.setup import app as setup_app app = typer.Typer( name="devgen", help="devgen-py: AI-Powered Git Commit & Release Automation.", - add_completion=False, + add_completion=True, no_args_is_help=True, rich_markup_mode="markdown", )