https://github.com/eldanielhumberto/ct
A tool to translate commit messages to different languages.
https://github.com/eldanielhumberto/ct
git go traductor
Last synced: about 2 months ago
JSON representation
A tool to translate commit messages to different languages.
- Host: GitHub
- URL: https://github.com/eldanielhumberto/ct
- Owner: eldanielhumberto
- License: mit
- Created: 2025-11-01T06:02:10.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-12-15T03:57:00.000Z (6 months ago)
- Last Synced: 2025-12-17T04:55:40.217Z (6 months ago)
- Topics: git, go, traductor
- Language: Go
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ct - Commit Translator
[](https://go.dev/)
[](LICENSE)
**ct** (commit translator) is a command-line tool that helps you write clean, consistent, and readable git commit messages across different languages using Google's Gemini AI.
## ✨ Features
- 🌍 **Multilingual Support**: Translate commit messages to any language
- 🤖 **AI-Powered**: Uses Google Gemini 2.5 Flash for accurate translations
- ⚡ **Fast & Efficient**: Built with Go for optimal performance
- 🔒 **Secure**: API keys managed through environment variables
- 🎯 **Simple CLI**: Easy-to-use command-line interface powered by Cobra
## 📋 Prerequisites
- Go 1.25.5 or higher
- Google Gemini API key ([Get one here](https://ai.google.dev/))
## 🚀 Installation
```bash
go install github.com/eldanielhumberto/ct@latest
```
## ⚙️ Configuration
1. Create a `.env` file in the project root:
```bash
cp .env.example .env
```
2. Add your Gemini API key to the `.env` file:
```env
GEMINI_API_KEY=your_api_key_here
```
> **Note**: You can also set the environment variable directly in your shell:
> ```bash
> export GEMINI_API_KEY=your_api_key_here
> ```
> **Note**: Add the go binaries to your PATH:
> ```bash
> export PATH="$PATH:$HOME/go/bin"
> ```
## 📖 Usage
### Basic Usage
Translate a commit message to a specific language:
```bash
ct commit "Initial commit" --lang es
```
**Output:**
```
Original message: Initial commit
Translated message (es): Commit inicial
```
### Available Options
```bash
ct commit [message] [flags]
```
**Flags:**
- `-l, --lang string`: Target language for translation (default: "en")
- `-h, --help`: Help for commit command
### Examples
```bash
# Translate to Spanish
ct commit "Add user authentication" --lang es
# Translate to French
ct commit "Fix database connection bug" --lang fr
# Translate to Japanese
ct commit "Update documentation" --lang ja
# Translate to German
ct commit "Refactor payment module" --lang de
```
## 🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## 📝 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Contact
Daniel Humberto - [@eldanielhumberto](https://github.com/eldanielhumberto)
Project Link: [https://github.com/eldanielhumberto/ct](https://github.com/eldanielhumberto/ct)
---
Made with ❤️ by Daniel Humberto