{"_id":"@aaroncx/commitcraft","_rev":"2-4aeb692d5437fb3f19dc9e1ea5f84947","name":"@aaroncx/commitcraft","dist-tags":{"latest":"1.1.1"},"versions":{"1.1.0":{"name":"@aaroncx/commitcraft","version":"1.1.0","keywords":["git","commit","ai","cli","conventional-commits","anthropic","openai"],"license":"MIT","_id":"@aaroncx/commitcraft@1.1.0","maintainers":[{"name":"aaroncx","email":"acharacterc@gmail.com"}],"bin":{"cc":"dist/index.js","commitcraft":"dist/index.js"},"dist":{"shasum":"b3940416b5180e3f9bc21c9719a7305740edd237","tarball":"https://registry.npmjs.org/@aaroncx/commitcraft/-/commitcraft-1.1.0.tgz","fileCount":6,"integrity":"sha512-syA647aqDvh5xF0deKlQ+9mnNfym9dk1rsrSBH1e7mtqGLO8oKsjSu8HdSGeEkjOPIlV9bu7JorckAPKGkJUjA==","signatures":[{"sig":"MEUCIQDd3SFubrYPbgcm/fCAVjSAn6+9L9+pwvcea3nxZNO8fgIgY5Wj9S10HDBEAutao+tbrWPUL4Y4yMAqqvtQ8m0s1E8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27804},"type":"module","engines":{"node":">=18"},"gitHead":"cabfbefddb720b27296a1995af6b960edd38cf80","scripts":{"dev":"tsup --watch","lint":"eslint src --ext .ts","test":"vitest run","build":"tsup","format":"prettier --write src","test:watch":"vitest","prepublishOnly":"npm run build && npm run test"},"_npmUser":{"name":"aaroncx","email":"acharacterc@gmail.com"},"_npmVersion":"11.11.0","description":"AI-powered conventional commit message generator","directories":{},"_nodeVersion":"25.8.0","dependencies":{"ora":"^8.2.0","conf":"^13.1.0","chalk":"^5.4.1","openai":"^4.85.0","commander":"^13.1.0","clipboardy":"^4.0.0","@anthropic-ai/sdk":"^0.39.0","@inquirer/prompts":"^7.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","eslint":"^8.57.0","vitest":"^3.0.0","prettier":"^3.5.0","typescript":"^5.7.0","@types/node":"^22.13.0","@typescript-eslint/parser":"^7.0.0","@typescript-eslint/eslint-plugin":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/commitcraft_1.1.0_1773674321926_0.8990166964003892","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@aaroncx/commitcraft","version":"1.1.1","description":"AI-powered conventional commit message generator","bin":{"commitcraft":"dist/index.js","cc":"dist/index.js"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run","test:watch":"vitest","lint":"eslint src --ext .ts","format":"prettier --write src","prepublishOnly":"npm run build && npm run test"},"keywords":["git","commit","ai","cli","conventional-commits","anthropic","openai"],"license":"MIT","dependencies":{"@anthropic-ai/sdk":"^0.39.0","@inquirer/prompts":"^7.0.0","chalk":"^5.4.1","clipboardy":"^4.0.0","commander":"^13.1.0","conf":"^13.1.0","openai":"^4.85.0","ora":"^8.2.0"},"devDependencies":{"@types/node":"^22.13.0","eslint":"^8.57.0","@typescript-eslint/eslint-plugin":"^7.0.0","@typescript-eslint/parser":"^7.0.0","prettier":"^3.5.0","tsup":"^8.4.0","typescript":"^5.7.0","vitest":"^3.0.0"},"type":"module","engines":{"node":">=18"},"gitHead":"cabfbefddb720b27296a1995af6b960edd38cf80","_id":"@aaroncx/commitcraft@1.1.1","_nodeVersion":"25.8.0","_npmVersion":"11.11.0","dist":{"integrity":"sha512-Kixm6BMzUsWpct6TXSsWzBIa0NKHnWow3BLV6V+LGGTP3iqn/y+Te0IOl61IqJC5fHl6Q0S1aT6QEqVMtw+5dA==","shasum":"648083b2ba2699564d8845f015f293cac8f5c9ee","tarball":"https://registry.npmjs.org/@aaroncx/commitcraft/-/commitcraft-1.1.1.tgz","fileCount":6,"unpackedSize":27800,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCcBpG06wvbt0ke6cORn9ybPXyqV4x8lkSp5EuKEenEqwIhAI2rU3858dZsmzNC13Nin0x+FiQGscbeKG9bbm5sZ6pR"}]},"_npmUser":{"name":"aaroncx","email":"acharacterc@gmail.com"},"directories":{},"maintainers":[{"name":"aaroncx","email":"acharacterc@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/commitcraft_1.1.1_1773674345143_0.07300848046953323"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-16T15:18:41.830Z","modified":"2026-03-16T15:19:05.424Z","1.1.0":"2026-03-16T15:18:42.086Z","1.1.1":"2026-03-16T15:19:05.294Z"},"license":"MIT","keywords":["git","commit","ai","cli","conventional-commits","anthropic","openai"],"description":"AI-powered conventional commit message generator","maintainers":[{"name":"aaroncx","email":"acharacterc@gmail.com"}],"readme":"# CommitCraft\n\nAI-powered conventional commit message generator CLI.\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/aaroncx)\n\n## Install\n\n```bash\nnpm install -g commitcraft\n```\n\n## Setup\n\nConfigure your preferred AI provider:\n\n```bash\n# Anthropic (default)\ncommitcraft config set anthropicApiKey YOUR_ANTHROPIC_KEY\n\n# OpenAI\ncommitcraft config set openaiApiKey YOUR_OPENAI_KEY\ncommitcraft config set provider openai\n```\n\nOr use environment variables:\n\n```bash\nexport ANTHROPIC_API_KEY=your_key_here\nexport OPENAI_API_KEY=your_key_here\n```\n\n## Usage\n\n### Generate a commit message\n\n```bash\n# Stage your changes, then run:\ncommitcraft generate\n\n# Or use the short alias:\ncc gen\n```\n\n### Flags\n\n| Flag | Description |\n|------|-------------|\n| `--provider <name>` | Override provider (`anthropic` or `openai`) |\n| `--model <name>` | Override the default model |\n| `--copy` | Copy the generated message to clipboard |\n| `--commit` | Auto-run `git commit` with the generated message |\n| `--dry-run` | Show the diff that would be sent without calling AI |\n| `--type <type>` | Constrain commit type (`feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`, `ci`, `build`) |\n| `--scope <scope>` | Add a conventional commit scope, e.g. `feat(auth): ...` |\n| `--emoji` | Prepend a gitmoji to the commit message |\n| `--amend` | Regenerate the last commit message |\n\n### Examples\n\n```bash\n# Generate and copy to clipboard\ncommitcraft generate --copy\n\n# Generate and commit directly\ncommitcraft generate --commit\n\n# Use OpenAI instead of default Anthropic\ncommitcraft generate --provider openai\n\n# Preview what diff would be sent\ncommitcraft generate --dry-run\n\n# Force a fix: type message\ncommitcraft --type fix\n\n# Add scope: feat(auth): ...\ncommitcraft --scope auth\n\n# Add gitmoji: ✨ feat: ...\ncommitcraft --emoji\n\n# Redo the last commit message\ncommitcraft --amend\n```\n\n### Init Command\n\nCreate a `.commitcraftrc` project config file interactively:\n\n```bash\ncommitcraft init\n```\n\nThis walks you through selecting a provider, default commit type, emoji preference, and auto-copy setting.\n\n### Project Configuration\n\nCommitCraft supports a `.commitcraftrc` file in your project root. This JSON file lets you set project-specific defaults that override global config:\n\n```json\n{\n  \"provider\": \"anthropic\",\n  \"emoji\": true,\n  \"autoCopy\": false,\n  \"defaultType\": \"feat\"\n}\n```\n\n**Supported keys:** `provider`, `model`, `emoji`, `autoCopy`, `defaultType`\n\nSettings are merged with global config -- project settings take priority.\n\n### Global Configuration\n\n```bash\n# Set a config value\ncommitcraft config set <key> <value>\n\n# Get a config value\ncommitcraft config get <key>\n```\n\n**Config keys:** `provider`, `anthropicApiKey`, `openaiApiKey`, `model`, `autoCopy`, `emoji`, `defaultType`\n\n### Troubleshooting\n\n| Error | Solution |\n|-------|----------|\n| \"Not a git repository\" | Run from inside a git project, or run `git init` |\n| \"No API key found\" | Set via `commitcraft config set anthropicApiKey <key>` or `export ANTHROPIC_API_KEY=<key>` |\n| \"No changes detected\" | Stage changes first with `git add <files>` |\n| \"Network error\" | Check your internet connection and try again |\n| \"Invalid commit type\" | Use one of: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`, `ci`, `build` |\n\n## Supported Providers\n\n| Provider | Default Model | Package |\n|----------|--------------|---------|\n| **Anthropic** (Claude) | `claude-haiku-4-5` | `@anthropic-ai/sdk` |\n| **OpenAI** | `gpt-4o-mini` | `openai` |\n\n## How It Works\n\n1. CommitCraft captures your staged `git diff`\n2. The diff is sent to your configured AI provider with a specialized system prompt\n3. The AI generates a conventional commit message following the [Conventional Commits](https://www.conventionalcommits.org/) specification\n4. The message is validated, displayed, and optionally copied to clipboard or used to commit directly\n\nDiffs are truncated to ~6000 tokens to stay within context limits. API keys are stored securely using XDG-compliant config storage and are never logged or transmitted anywhere except to the configured AI provider.\n\n## Contributing\n\nContributions are welcome! Here's how:\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feat/my-feature`\n3. Make your changes and add tests\n4. Run `npm test` and `npm run lint`\n5. Commit using conventional commits\n6. Open a pull request\n\n## Support the Project\n\nCommitCraft is free and open source. If it saves you time, consider buying me a coffee — it helps fund development and keeps the project maintained.\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/aaroncx)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}