CLI tool to generate icons with text for multiple sizes and Mac .icns files
npm install mc-icon-gen
> A powerful command-line tool to generate beautiful app icons with custom text or colorful emojis for multiple sizes, including Mac .icns format.
Perfect for developers who need quick, professional-looking icons for their applications, browser extensions, Electron apps, or any project that needs icons in multiple sizes.
---
- šÆ Text or Emoji Support - Create icons with custom text (1-3 characters) or colorful emojis
- š¼ļø Multiple Sizes - Generates icons in 8 standard sizes (16Ć16 to 1024Ć1024)
- š Mac .icns Support - Automatic .icns file generation for macOS applications
- šØ Full Customization - Choose colors, fonts, and corner radius
- š Colorful Emojis - Uses Twitter's Twemoji for consistent, beautiful emoji rendering
- š Beautiful HTML Report - Dark-themed report with preview of all generated icons
- ā” Zero System Dependencies - Pure Node.js solution using Sharp
- š Fast & Easy - Generate complete icon sets in seconds
``bash`
npm install -g mc-icon-gen
Then use it anywhere:
`bash`
mc-icon-gen -w ABC
`bash`
npm install mc-icon-gen
Use with npx:
`bash`
npx mc-icon-gen -w ABC
`bashSimple text icon with default colors
mc-icon-gen -w ABC
$3
`bash
Rocket emoji
mc-icon-gen -e "š" -b "#1E293B"Fire emoji with rounded corners
mc-icon-gen -e "š„" -b "#FF6B6B" -r 12`š Usage
`bash
mc-icon-gen [options]
`$3
| Option | Alias | Description | Default | Required |
|--------|-------|-------------|---------|----------|
|
--word | -w | Text to display (1-3 characters) | - | * |
| --emoji | -e | Emoji to display (single emoji) | - | * |
| --font | -f | Font family (text mode only) | Arial | |
| --background | -b | Background color (hex format) | #2463EB | |
| --color | -c | Text color (hex format) | #FFFFFF | |
| --radius | -r | Corner radius in pixels (0-50) | 4 | |
| --output | -o | Output directory | ./icons | |
| --no-icns | | Skip .icns generation | false | |
| --version | -V | Output version number | | |
| --help | -h | Display help | | |Note: Either
--word or --emoji is required (but not both).šÆ Examples
$3
`bash
Tech startup logo
mc-icon-gen -w TS -f "Helvetica" -b "#0EA5E9" -c "#FFFFFF" -r 8E-commerce app
mc-icon-gen -e "š" -b "#10B981" -r 16Music player
mc-icon-gen -e "šµ" -b "#8B5CF6" -r 20Chat application
mc-icon-gen -e "š¬" -b "#3B82F6" -r 12
`$3
`bash
Code editor
mc-icon-gen -e "š»" -b "#1F2937" -r 8Database tool
mc-icon-gen -e "šļø" -b "#059669" -r 10API testing tool
mc-icon-gen -e "ā”" -b "#FBBF24" -r 12
`$3
`bash
Company initials
mc-icon-gen -w MC -f "Arial" -b "#DC2626" -c "#FFFFFF" -r 6Personal brand
mc-icon-gen -w JD -f "Georgia" -b "#7C3AED" -c "#FFFFFF" -r 10
`š Output
The tool generates:
`
./icons/
āāā icon16.png # 16Ć16 pixels
āāā icon32.png # 32Ć32 pixels
āāā icon48.png # 48Ć48 pixels
āāā icon64.png # 64Ć64 pixels
āāā icon128.png # 128Ć128 pixels
āāā icon256.png # 256Ć256 pixels
āāā icon512.png # 512Ć512 pixels
āāā icon1024.png # 1024Ć1024 pixels
āāā icon.icns # macOS icon file (Mac only)
āāā report.html # Beautiful preview report
`$3
Every generation includes a beautiful dark-themed HTML report with:
- ā
Configuration summary with color swatches
- ā
Preview grid of all generated icons
- ā
File list with status indicators
- ā
Responsive design for viewing on any device
šØ Color Customization
$3
`bash
Blue & White (Professional)
mc-icon-gen -w APP -b "#2463EB" -c "#FFFFFF"Dark Mode
mc-icon-gen -w DM -b "#1F2937" -c "#F9FAFB"Vibrant Gradient Feel
mc-icon-gen -w VG -b "#8B5CF6" -c "#FFFFFF"Success Green
mc-icon-gen -w OK -b "#10B981" -c "#FFFFFF"Warning Orange
mc-icon-gen -w WRN -b "#F59E0B" -c "#FFFFFF"Error Red
mc-icon-gen -w ERR -b "#EF4444" -c "#FFFFFF"
`$3
Colors must be in 6-digit hex format with
# prefix:
- ā
Valid: #2463EB, #FFFFFF, #000000
- ā Invalid: 2463EB, #246, blueš Mac .icns Generation
On macOS, the tool automatically generates a
.icns file with all required sizes and @2x retina variants for perfect display across all Mac applications.Requirements:
- macOS operating system
-
iconutil command-line tool (comes with Xcode Command Line Tools)Skip .icns generation:
`bash
mc-icon-gen -w APP --no-icns
`š Emoji Support
The tool uses Twitter's Twemoji library for consistent, colorful emoji rendering across all platforms. This means your emoji icons will look the same on Windows, Mac, Linux, iOS, and Android.
$3
- š Rocket - Perfect for launch/deploy tools
- šØ Art Palette - Design & creative apps
- š” Light Bulb - Idea & innovation apps
- š„ Fire - Trending/hot content
- ā” Lightning - Fast/performance tools
- š» Laptop - Developer tools
- š± Mobile Phone - Mobile apps
- šµ Music Note - Music/audio apps
- š Chart - Analytics & data
- š Lock - Security apps
- š Star - Favorites/premium
- ā¤ļø Heart - Social/health apps
šÆ Use Cases
- Electron Apps - Generate icon sets for cross-platform desktop apps
- Browser Extensions - Create icons for Chrome, Firefox, Safari extensions
- Mobile Apps - Generate app icons for React Native, Flutter, Ionic
- Web Apps - Create favicons and PWA icons
- macOS Apps - Generate .icns files for native Mac applications
- Quick Prototyping - Fast icon generation for mockups and demos
- Personal Branding - Create unique icons with your initials
š” Tips & Best Practices
1. Text Icons
- Use 1-2 characters for best legibility (e.g., "AB", "X")
- Choose high-contrast colors for readability
- Sans-serif fonts work best for small sizes
2. Emoji Icons
- Single emojis work best
- Consider how the emoji looks at small sizes (16Ć16)
- Simple emojis are more recognizable than complex ones
3. Colors
- Ensure good contrast between background and text
- Test at smallest size (16Ć16) to verify readability
- Consider both light and dark themes
4. Corner Radius
- 0px = Square (traditional app icons)
- 4-8px = Slightly rounded (modern, subtle)
- 12-20px = Very rounded (friendly, approachable)
- 50%+ = Circular icons
š ļø Troubleshooting
$3
$3
Problem: Emoji not rendering or appears black & white
- ā
Ensure you have internet connection (fetches from Twemoji CDN)
- ā
Try a different emoji
- ā
Check the console output for error messages
Problem: .icns generation fails
- ā
Verify you're on macOS
- ā
Install Xcode Command Line Tools:
xcode-select --install
- ā
Or use --no-icns flag to skip .icns generation$3
Problem: Invalid color format error
`bash
Wrong
mc-icon-gen -w ABC -b "blue"
mc-icon-gen -w ABC -b "2463EB"
mc-icon-gen -w ABC -b "#246"Correct
mc-icon-gen -w ABC -b "#2463EB"
``- Node.js 14.15.0 or higher
- macOS (optional, for .icns generation only)
- Internet connection (for emoji support)
MIT Ā© Mohan Chinnappan
Made with ā¤ļø for developers