A Rust CLI tool that refines your tweets using OpenAI's GPT-4. It transforms verbose technical thoughts into concise, impactful tweets while maintaining your professional voice.
This is a fun side project I built to showcase Rust and OpenAI's API while demonstrating AI agents in a nutshell. While it works well for tweet refinement, I'm not actively maintaining it due to other commitments (full-time job + personal projects). Feel free to fork and modify, but note:
- No guarantee of PR reviews/acceptance
- No active feature development planned
- Built mainly for personal use in Cursor IDE
- May need updates as OpenAI's API evolves
If you find it useful, great! Just don't rely on it for anything mission-critical.
- Transforms draft tweets into polished, tech-savvy content
- Maintains technical credibility while being approachable
- Focuses on product/tech insights with entrepreneurial angles
- Keeps responses sharp and contrarian when appropriate
- Uses emojis sparingly (max 1-2)
- Ensures tweets stay within Twitter's 280-character limit
- Rust toolchain (1.70.0 or later)
- OpenAI API key
- macOS or Linux
You can customize how Chirpfy refines your tweets in two ways:
- Edit
SYSTEM_PROMPT.md
directly in the project root - Use your own prompt file by setting the environment variable:
export CHIRPFY_PROMPT_PATH="/path/to/your/prompt.md"
See SYSTEM_PROMPT.md
for the default prompt and use it as a template for your customizations.
Add to your ~/.zshrc
:
export OPENAI_API_KEY="your-api-key-here"
source ~/.zshrc
git clone https://github.com/ertyurk/chirpfy.git
cd chirpfy
cargo build --release
sudo cp target/release/chirpfy /usr/local/bin/
Add to your ~/.zshrc
:
# Short alias
alias tw="chirpfy"
# Function for quote-free usage
tweet() {
chirpfy "$*"
}
# Standard way
chirpfy "Just learned about Rust's ownership model"
# Using alias (after adding shell conveniences)
tw "Just learned about Rust's ownership model"
# Using function (no quotes needed)
tweet Just learned about Rust's ownership model
$ tw "Shame on me that I did not consider rust before. Bottleneck from my mind got removed."
"After years of Go & TypeScript, Rust's ownership model just clicked. It's not just about memory - it's about modeling complex systems correctly from day one. 🦀"
# Run from source
cargo run -- "Your tweet"
# Run tests
cargo test
# Run with debug output
RUST_LOG=debug cargo run -- "Your tweet"
Chirpfy provides clear error messages for:
- Tweet length exceeds 280 characters
- Empty tweet input
- Missing OpenAI API key
- API communication errors
MIT License - see LICENSE file for details
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request