MIT licensed · Python 3.10+

Turn your commits into tweets.

Git2Tweet reads your commit and its diff, writes the first draft, and waits for your approval. Nothing is posted until you say so.

uv tool install git2tweet
Star Git2Tweet on GitHub
git tweet
Screen recording of Git2Tweet drafting a tweet from a commit and opening X with the text prefilled.

How it works

Commit as usual.

Nothing in your workflow changes.

Run git tweet.

An agent reads the message and the diff, and skips trivial changes.

Approve.

Accept, edit, or reject the draft. X opens with the text prefilled, and you press Post.

The Git2Tweet flow A commit goes to an agent that reads the diff, then to a draft or skip decision, then to your approval, then X opens with the tweet prefilled. 01 Commit as usual 02 Agent reads diff message + diff 03 Draft or skip trivial edits skipped 04 You approve accept · edit · reject 05 X opens prefilled you press Post The Git2Tweet flow A commit goes to an agent that reads the diff, then to a draft or skip decision, then to your approval, then X opens with the tweet prefilled. 01 Commit as usual 02 Agent reads diff message + diff 03 Draft or skip trivial edits skipped 04 You approve accept · edit · reject 05 X opens prefilled you press Post
git tweet
Terminal showing a tweet draft generated by Git2Tweet and the approval prompt.
X compose
X compose box with the generated tweet text prefilled, before pressing Post.

Features

Reads the diff, not just the message.

Drafts describe what you actually changed.

Skips the noise.

Typo fixes and tiny edits are skipped, with a reason. Override with --no-skip.

You stay in control.

Every tweet needs your approval first.

No X credentials, no paid API.

It opens a prefilled tweet, so you press Post yourself.

Works offline from git.

It reads your local repo, so no GitHub token is needed and private repos work.

Your choice of model.

Groq by default, or Ollama to keep everything on your machine.

Secret scrubbing.

Keys, tokens, private keys and connection-string passwords are redacted, and .env and key files are never sent.

Optional commit reminder.

git2tweet init adds a hook that nudges you after each commit.

Short commands.

git tweet or g2t.

Open source, no telemetry.

MIT licensed.

Install

terminal
uv tool install git2tweet# or: pipx install git2tweet
terminal
git2tweet config# choose a provider, paste your API key (once)
  • Needs: Python 3.10+, git, and an API key (a free Groq key works) or Ollama.
  • Local models: uv tool install "git2tweet[ollama]", then git2tweet config.
  • Reminder hook: git2tweet init (undo with git2tweet init --remove).
  • Update: uv tool upgrade git2tweet.
  • Uninstall: git2tweet init --remove in each repo, then uv tool uninstall git2tweet, delete the config folder, and revoke your API key.

Then, in any git repo:

quick start
git commit -m "feat: add retry with backoff to the webhook handler"
git tweet

What gets sent to the AI model?

The commit message and diff, after known secrets are redacted. Files like .env, *.pem and *.key are excluded. Redaction is best effort, so use Ollama for sensitive repos.

No telemetry.

Never sent

  • .env
  • *.pem
  • *.key

FAQ

Suggestions are welcome on GitHub.

Does it post for me?

No. It opens X with the draft prefilled and you press Post.

Do I need an X API key or a paid plan?

No. It never touches your X account.

What gets sent to the AI model?

The commit message and diff, after known secrets are redacted. Files like .env, *.pem and *.key are excluded. Redaction is best effort, so use Ollama for sensitive repos.

Which models work?

Groq (default) and Ollama. Both are set with git2tweet config.

What does it cost?

Git2Tweet is free. Your model provider may have limits or charges, and Groq has a free tier with rate limits.

Why was my commit skipped?

The agent judges the diff, so tiny or trivial changes are skipped. It tells you why. Run git tweet --no-skip to draft anyway.

Do I need GitHub?

No. It works with any local git repo.

Does it work in VS Code or other editors?

Yes. The reminder hook runs on any commit, but some editors hide hook output, so run git tweet in a terminal.

Which operating systems?

Developed on Windows and checked on Linux. macOS hasn’t been tested yet.

Does it collect data?

No telemetry.

Can it post to LinkedIn or Bluesky?

Not yet. Suggestions are welcome on GitHub.

Found a bug?

Open an issue on GitHub.

Found it useful?

Star Git2Tweet on GitHub — it helps other developers find the project.

Star on GitHub