Autocommiter is a small VS Code extension prototype that helps you generate commit messages from the Source Control (SCM) view. It provides a small "wand" action in the SCM view title and a status-bar button that inserts a generated commit message into the Git commit input box.
This project is an early prototype focusing on a lightweight, non-invasive UX: it uses the built-in Git extension when possible to read and set the commit input, and falls back to copying the message to clipboard if necessary.
Features
Generate a commit message and insert it into the SCM commit input.
Status bar button (🪄) to trigger message generation.
Small toolbar action in the Source Control view title for quick access.
autocommiter.gitignorePatterns (optional): Patterns to add to .gitignore when protection is enabled
Development
Requirements
Node.js and pnpm (pnpm is used by this workspace)
VS Code
Run locally
Install dependencies:
pnpm install
Start the TypeScript and bundler watchers (the workspace already includes watch tasks):
pnpm run watch
Open this project in VS Code and press F5 to launch an Extension Development Host. In the new window, open a Git workspace and try the wand button in Source Control.
Build and package
pnpm run package
# or use `vsce package` if you prefer
Notes on typechecks
The project uses tsconfig.json with skipLibCheck and explicit types entries to avoid third-party ambient type issues during development.
Code highlights
src/extension.ts registers the command autocommiter.generateMessage, adds a status bar item, and attempts to use the vscode.git extension's API to read and write the inputBox value for the repository.
src/modelManager.ts handles model fetching, caching, and selection UI for GitHub Models API.
generateMessageFromContext is a minimal placeholder where richer generation logic should plug in.
Extending the generator (recommended next steps)
Use staged/unstaged diffs to build a richer prompt
Use the Git extension API to enumerate changed files and produce a short summary of additions/deletions per file.
Customize commit message style
Add extension settings for conventional commits, scope inclusion, etc.
UI polishing
Replace the text status bar item with an icon-only button.
Add more commit message style templates.
Security & privacy
API keys are stored securely in VS Code's SecretStorage.
File diffs are compressed and sent to GitHub Models API for message generation.
No data is stored on extension or external services beyond the API call itself.
Contributing
Contributions are welcome. Open an issue or PR describing the feature you'd like to add.
License
This project does not include a license by default. Add a LICENSE file if you want to make the code reusable.