CLI that reads your git log, sends it to Claude, and writes a social post in your voice. Optionally generates a 1200×627 cover image with syntax-highlighted code from your actual commits as the background.
npm install -g commitpost
commitpost generate --since 7 --include-imageRequires an Anthropic API key (~$0.01/post).
git log --author --since→ collect commits- Claude API + optional tone profile (your writing sample) → post text
git diff-tree→ find changed files → pick a non-test code file →git show→ extract from first class/function definitionsatori(JSX→SVG) +@resvg/resvg-js(Rust SVG→PNG) +sharp(blur + composite) → cover image PNG
No browser, no Puppeteer, no Electron.
npm install -g commitpost# Set API key
commitpost config --set-key sk-ant-...
# or
export ANTHROPIC_API_KEY=sk-ant-...commitpost generate [options]| Option | Default | Description |
|---|---|---|
--author <name> |
$GIT_AUTHOR_NAME |
Filter commits by author |
--since <days> |
7 |
How many days back to look |
--length <size> |
medium |
Post length: short (~100w), medium (~250w), long (~500w) |
--tone <name> |
— | Built-in tone profile (see commitpost list-tones) |
--image-style <name> |
light_code |
Cover image style (see commitpost list-image-styles) |
--include-image |
false |
Generate cover image PNG |
Examples:
# Basic
commitpost generate
# With cover image, dark style, long post
commitpost generate --include-image --image-style dark_code --length long
# Specific author, last 30 days
commitpost generate --author "Jane Doe" --since 30
# Built-in tone profile
commitpost generate --tone technical_reflective --since 7Set your own writing sample once — all posts match your style:
commitpost config --set-tone my-writing-sample.txtOr use a built-in profile without any setup:
commitpost list-tones
commitpost generate --tone technical_reflectiveBuilt-in profiles: technical_reflective, concise_action_oriented, learning_focused, startup_rapid, collaboration_focused
commitpost list-image-styleslight_code— light background, blurred code texturedark_code— dark background, subtle blurred codeminimal— clean light gradient, no codedark_minimal— clean dark gradient, no code
Code in the image is extracted from files you actually changed in those commits. Test files (*.test.*, __tests__/, etc.) are excluded. Rendering starts at the first class or function definition, not at the import block.
Stored in ~/.commitpost/config.json:
{
"apiKey": "sk-ant-...",
"model": "claude-opus-4-1",
"toneProfile": "",
"postLength": "medium"
}commitpost config --view
commitpost config --set-key sk-ant-...
commitpost config --set-tone writing-sample.txt- Commit messages are sent to the Anthropic API
- Everything else (tone profile, API key, generated images) stays on your machine
- No CommitPost servers involved — direct API call only
git clone https://github.com/vsimke/commitpost.git
cd commitpost
npm install
node src/index.js generate --helpIssues and PRs welcome: github.com/vsimke/commitpost
-
--copy-to-clipboardflag -
--platformflag (adjust length/format per platform) - Hashtag generation
- GitHub Actions workflow template
- Direct LinkedIn/Bluesky posting via API
MIT License