Skip to content

damienbutt/emojify-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

88 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ‰ Emojify

CI Go Report Card codecov Go Version Release Downloads License

A lightning-fast, cross-platform command-line tool for bidirectional emoji conversion. Convert between emoji aliases (:smile:) and Unicode emoji characters (πŸ˜„) seamlessly. This is a complete Go rewrite of the original emojify bash script with 169.9x better performance and modern tooling.

# Encode aliases to emojis (default behavior)
echo "Deploy completed :rocket: :100:" | emojify
# Deploy completed πŸš€ πŸ’―

# Decode emojis back to aliases
echo "Deploy completed πŸš€ πŸ’―" | emojify --decode
# Deploy completed :rocket: :100:

git log --oneline | emojify | head -5
# ✨ feat: add new feature :sparkles:
# πŸ› fix: resolve critical bug :bug:
# πŸ“š docs: update README :books:

πŸ“– Contents

✨ Features

  • ↔️ Bidirectional Conversion: Encode aliases to emojis and decode emojis back to aliases
  • ⚑ Lightning Fast: 169.9x faster than bash version (up to 758x on large files)
  • 🌍 Cross-Platform: Single binary for Linux, macOS, Windows (AMD64 & ARM64)
  • πŸ“¦ Zero Dependencies: No runtime dependencies, just download and run
  • 🎯 100% Compatible: Drop-in replacement for original emojify
  • πŸ”§ Pipeline Friendly: Perfect for git logs, CI/CD, and shell scripts
  • πŸ“Š 2,500+ Emojis: Complete GitHub gemoji database
  • πŸ›‘οΈ Production Ready: Comprehensive tests, benchmarks, and error handling
  • 🎨 Modern CLI: Built with urfave/cli for excellent UX

🎬 Demo

Emojify-Go Demo

Lightning-fast emoji conversion in action! See the 169.9x performance improvement over the original bash version.

πŸ“¦ Installation

Package Managers (Recommended)

🍎 macOS
# Homebrew
brew install damienbutt/tap/emojify-go
🐧 Linux
# Arch Linux (AUR)
# Install pre-built binary
paru -S emojify-go-bin

# Or build from source
paru -S emojify-go

# Ubuntu/Debian (DEB package)
wget https://github.com/damienbutt/emojify-go/releases/latest/download/emojify-go_linux_amd64.deb
sudo dpkg -i emojify-go_linux_amd64.deb

# RHEL/CentOS/Fedora (RPM package)
sudo rpm -i https://github.com/damienbutt/emojify-go/releases/latest/download/emojify-go_linux_amd64.rpm
πŸͺŸ Windows
# Scoop
# 1. Add the bucket (only needs to be done once)
scoop bucket add damienbutt https://github.com/damienbutt/scoop-bucket.git

# 2. Install the package
scoop install emojify-go

# WinGet
# 1. Add the source repository (only needs to be done once)
winget source add --name damienbutt --arg https://github.com/damienbutt/winget-pkgs --type Microsoft.Winget.Source.8wekyb3d8bbwe

# 2. Install the package
winget install damienbutt.emojify-go
❄️ NixOS / Nix

emojify-go is available in a Nix User Repository (NUR).

To install emojify-go from the NUR, you first need to add the NUR to your Nix configuration. This is a one-time setup step.

1. Add the NUR to your Nix configuration

Add the following to your ~/.config/nixpkgs/config.nix file:

{
  packageOverrides = pkgs: {
    nur = import (builtins.fetchTarball "https://github.com/damienbutt/nur/archive/master.tar.gz") {
      inherit pkgs;
    };
  };
}

2. Install the package

nix-env -iA nur.repos.damienbutt.emojify-go

Note on Nix Flakes

If you're using Nix Flakes, you can install emojify-go directly from the NUR repo:

nix profile install github:damienbutt/nur#emojify-go

🐳 Docker

# Run directly
echo "Hello :wave: world" | docker run --rm -i ghcr.io/damienbutt/emojify-go

# Use as alias
alias emojify='docker run --rm -i ghcr.io/damienbutt/emojify-go'

πŸ“₯ Direct Download

Download the latest binary for your platform from the releases page.

# Linux (AMD64)
curl -L https://github.com/damienbutt/emojify-go/releases/latest/download/emojify-go_linux_amd64.tar.gz | tar xz
sudo mv emojify-go /usr/local/bin/emojify

# macOS (ARM64)
curl -L https://github.com/damienbutt/emojify-go/releases/latest/download/emojify-go_darwin_arm64.tar.gz | tar xz
sudo mv emojify-go /usr/local/bin/emojify

# Windows (AMD64)
curl -L https://github.com/damienbutt/emojify-go/releases/latest/download/emojify-go_windows_amd64.zip -o emojify.zip
unzip emojify.zip

πŸ› οΈ Build from Source

git clone https://github.com/damienbutt/emojify-go.git
cd emojify-go
make build
./build/emojify "Hello :wave:"

πŸ“₯ Go Install

go install github.com/damienbutt/emojify-go/cmd/emojify@latest

πŸš€ Usage

Basic Usage

# Convert emoji aliases to emojis (default behavior)
emojify "Hey, I just :raising_hand: you, and this is :scream:"
# Output: Hey, I just πŸ™‹ you, and this is 😱

# Explicitly encode aliases to emojis
emojify --encode "To :bee: or not to :bee:"
emojify -e "To :bee: or not to :bee:"
# Output: To 🐝 or not to 🐝

# Decode emojis back to aliases
emojify --decode "Deploy completed πŸš€ πŸ’― πŸŽ‰"
emojify -d "Deploy completed πŸš€ πŸ’― πŸŽ‰"
# Output: Deploy completed :rocket: :100: :tada:

Bidirectional Conversion

# Round-trip conversion
echo "Hello :wave: world!" | emojify --encode | emojify --decode
# Output: Hello :wave: world!

# Convert emoji-rich text to aliases for storage/transmission
echo "Great work! πŸ‘ πŸŽ‰ πŸš€" | emojify --decode
# Output: Great work! :+1: :tada: :rocket:

# Convert back to emojis for display
echo "Great work! :+1: :tada: :rocket:" | emojify --encode
# Output: Great work! οΏ½ πŸŽ‰ πŸš€

Pipeline Usage

# Git log with emojis (most popular use case)
git log --oneline --color | emojify | less -r

# Git commit with emojis
git commit -m ":sparkles: Add new feature :rocket:"

# Echo and pipe (default encoding)
echo "Perfect! :100: :tada:" | emojify
# Output: Perfect! πŸ’― πŸŽ‰

# Decode emoji-rich output
curl -s "https://api.github.com/repos/user/repo/commits" | jq -r '.[].commit.message' | emojify --decode

# Process files
cat commit_messages.txt | emojify > pretty_commits.txt
cat emoji_output.txt | emojify --decode > clean_text.txt

# CI/CD notifications with bidirectional support
echo "Build status: :white_check_mark: Success :rocket:" | emojify
echo "Build completed 🟒 βœ… πŸš€" | emojify --decode

Command Options

# Encode aliases to emojis (default behavior)
emojify "text with :aliases:"
emojify --encode "text with :aliases:"
emojify -e "text with :aliases:"

# Decode emojis to aliases
emojify --decode "text with πŸš€ emojis"
emojify -d "text with πŸš€ emojis"

# List all available emojis
emojify --list
emojify -l

# Show version information
emojify --version
emojify -v

# Get help
emojify --help
emojify -h

Note:

  • --encode and --decode flags are mutually exclusive.
  • When using shell pipes or arguments with special characters (!, $, etc.), wrap strings in single quotes or escape them properly.

πŸ“š Examples

Git Integration

# Create a git alias for emoji logs
git config --global alias.elog '!git log --oneline --color | emojify | less -r'

# Create a git alias for clean (no emoji) logs
git config --global alias.clean-log '!git log --oneline --color | emojify --decode | less -r'

# Use the aliases
git elog      # Shows emojified commit messages
git clean-log # Shows clean text commit messages

# Emoji commit messages
git commit -m ":sparkles: feat: add user authentication :lock:"
git commit -m ":bug: fix: resolve memory leak :wrench:"
git commit -m ":books: docs: update API documentation"

# Extract clean commit messages for reports
git log --oneline --since="1 week ago" | emojify --decode > weekly_report.txt

Common Use Cases

# Shakespeare with emojis
emojify "To :bee: or not to :bee: that is the question :thinking:"

# Convert emoji-rich social media content to clean text
echo "Amazing product πŸŽ‰ Love it ❀️ 5 stars ⭐⭐⭐⭐⭐" | emojify --decode
# Output: Amazing product :tada: Love it :heart: 5 stars :star::star::star::star::star:

# Status updates with bidirectional conversion
emojify "Server status: :green_heart: Healthy | Load: :chart_with_upwards_trend:"
echo "Server status: πŸ’š Healthy | Load: πŸ“ˆ" | emojify --decode

# Code review feedback
emojify "LGTM :+1: Great work :clap: Ship it :rocket:"

# Clean up emoji-heavy slack exports for documentation
cat slack_export.txt | emojify --decode > clean_documentation.txt

# Progress indicators
emojify "Progress: :white_check_mark: Tests | :white_check_mark: Build | :construction: Deploy"

# Convert between formats for different platforms
echo "🎯 Goal achieved πŸš€ Next milestone: Q4 targets πŸ“Š" | emojify --decode | tee clean_report.txt | emojify

Advanced Pipeline Examples

# Colorful git statistics
git shortlog -sn | head -10 | sed 's/^/πŸ‘€ /' | emojify

# Enhanced build notifications
./build.sh && echo ":white_check_mark: Build successful :rocket:" | emojify || echo ":x: Build failed :sob:" | emojify

# Log processing with timestamps
tail -f app.log | while read line; do echo "$(date '+%H:%M:%S') :clock: $line"; done | emojify

⚑ Performance

Emojify is built for speed and handles large inputs efficiently:

Dataset Size Bash Version Go Version Speedup
Small (151 chars) 395.6ms 177.8ms 2.22x
Medium (1.6KB) 659.3ms 155.8ms 4.23x
Large (17KB) 10.328s 126.9ms 81.36x
XLarge (90KB) 156.197s 205.8ms 758.81x

Average Performance Improvement: 169.9x faster ⚑

Benchmarks

# Run performance benchmarks
make benchmark

# Test with large input
seq 1 10000 | sed 's/.*/:rocket: Line &/' | time emojify > /dev/null

πŸ“– Documentation

Man Page

Emojify includes a comprehensive Unix manual page that provides detailed documentation about all commands and options.

Package Manager Installation

When installed via package managers, the man page is automatically available:

# After installing via Homebrew, AUR, etc.
man emojify

Supported Systems: macOS, Linux, Windows (WSL/MSYS2/Cygwin)

πŸ—οΈ Development

Prerequisites

  • Go 1.23 or later
  • Make (optional, for convenience)

Setup

git clone https://github.com/damienbutt/emojify-go.git
cd emojify-go
make dev-setup  # Downloads dependencies

Building

# Build for current platform
make build                    # Output: build/emojify

# Build for all platforms
make build-all               # Output: build/emojify-{os}-{arch}

# Create optimized release binary
make release                 # Output: build/emojify (optimized)

Testing

# Run all tests
make test

# Run tests with coverage
make test-coverage

# Run benchmarks
make benchmark

# Run specific benchmark
make benchmark-processor

# Integration tests
make test-integration

# Race condition testing
make test-race

# Generate test report
make test-report

Code Quality

# Run linting
make lint

# Format code
go fmt ./...

# Vet code
go vet ./...

# Security scan
gosec ./...

πŸ”§ Configuration

Git Configuration

# Add emoji git aliases
git config --global alias.ec '!git log --oneline --color | emojify | head -10'
git config --global alias.es '!git status --porcelain | emojify'

# Set up commit template with emojis
cat > ~/.gitmessage << 'EOF'
# :sparkles: feat:
# :bug: fix:
# :books: docs:
# :art: style:
# :recycle: refactor:
# :white_check_mark: test:
# :construction_worker: build:
# :green_heart: ci:
EOF

git config --global commit.template ~/.gitmessage

🐳 Docker

Using the Official Image

# Run with stdin
echo "Hello :wave: Docker" | docker run --rm -i ghcr.io/damienbutt/emojify-go

# Process files
docker run --rm -v $(pwd):/workspace -w /workspace ghcr.io/damienbutt/emojify-go "$(cat input.txt)"

# Multi-architecture support
docker run --platform linux/arm64 --rm -i ghcr.io/damienbutt/emojify-go

Building Custom Image

# Build image
docker build -t my-emojify .

# Run
echo "Custom build :hammer:" | docker run --rm -i my-emojify

🀝 Contributing

We love contributions! Here's how you can help:

Quick Start

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Add tests for new functionality
  5. Run tests: make test
  6. Commit with emojis: git commit -m ":sparkles: feat: add amazing feature"
  7. Push to your branch: git push origin feature/amazing-feature
  8. Open a Pull Request

Development Guidelines

  • Write tests for new features
  • Follow Go conventions and best practices
  • Run make lint before committing
  • Include benchmarks for performance-critical code
  • Update documentation for user-facing changes

Areas for Contribution

  • 🌐 Additional package managers
  • πŸ”§ New emoji sources/databases
  • πŸ“Š Performance optimizations
  • πŸ§ͺ Additional test cases
  • πŸ“š Documentation improvements
  • πŸ› Bug fixes and edge cases

See CONTRIBUTING.md for detailed guidelines.

βš–οΈ License

MIT License - see LICENSE for details.

πŸ™ Acknowledgments

πŸ“Š Status

  • βœ… Production Ready: Used in CI/CD pipelines and development workflows
  • βœ… Actively Maintained: Regular updates and improvements
  • βœ… Cross-Platform: Supports all major platforms and architectures
  • βœ… Well Tested: Comprehensive test suite with >95% coverage

πŸ”— Related Projects


⬆ Back to Top

Made with ❀️ and β˜•

Star ⭐ this repo if you find it useful!

About

Lighting fast Emoji convertion on the command line 😱

Resources

License

Contributing

Stars

Watchers

Forks

Packages