npm package: @kahwati/random-icon-generator
Description: A CLI tool to generate random robot avatar icons in various sizes, perfect for user avatars and identicons
Author: Ehab Kahwati
Latest version: 1.1.1

# 🤖 Random Robot Icon Generator

<div align="center">

[![npm version](https://img.shields.io/npm/v/@kahwati/random-icon-generator.svg)](https://www.npmjs.com/package/@kahwati/random-icon-generator)
[![npm downloads](https://img.shields.io/npm/dm/@kahwati/random-icon-generator.svg)](https://www.npmjs.com/package/@kahwati/random-icon-generator)
[![License](https://img.shields.io/npm/l/@kahwati/random-icon-generator.svg)](https://github.com/Devehab/random-icon-generator/blob/main/LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Devehab/random-icon-generator/blob/main/CONTRIBUTING.md)

Generate unique, robot-style avatars for your applications. Perfect for user profiles, Chrome Extensions, and anywhere you need distinctive, programmatically-generated icons.

[🚀 CLI Guide](#-cli-guide) •
[📖 API Reference](#-api-reference) •
[🎨 Examples](#-examples) •
[🤝 Contributing](#-contributing)

![Robot Icon Examples](examples.png)

</div>

## 🚀 CLI Guide

### Installation

```bash
# Install latest version globally
sudo npm install -g @kahwati/random-icon-generator@latest

# Verify installation
random-icon-generator --version

# Update to latest version
sudo npm update -g @kahwati/random-icon-generator

# Uninstall
sudo npm uninstall -g @kahwati/random-icon-generator
```

### Basic Usage

```bash
# Generate icons in current directory
random-icon-generator generateIcons

# Generate icons in specific directory
random-icon-generator generateIcons ./my-icons

# Generate icons for Chrome Extension
random-icon-generator generateIcons ./extension/icons
```

### Common Use Cases

1. **Chrome Extension Icons**
```bash
# Create extension icons directory
mkdir -p my-extension/icons

# Generate full icon set
random-icon-generator generateIcons my-extension/icons
```

2. **User Avatar Set**
```bash
# Create avatars directory
mkdir user-avatars

# Generate unique avatar set
random-icon-generator generateIcons user-avatars
```

3. **Multiple Projects**
```bash
# Generate icons for different projects
random-icon-generator generateIcons project1/icons
random-icon-generator generateIcons project2/icons
```

### Output Structure

After running the generator, you'll get the following files:

```
output-directory/
├── icon16.png   # Chrome Web Store
├── icon19.png   # Extension toolbar (standard)
├── icon32.png   # Windows compatibility
├── icon38.png   # Extension toolbar (retina)
├── icon48.png   # Extensions page
├── icon96.png   # High-DPI displays
├── icon128.png  # Store & installation
├── icon256.png  # Store detailed view
└── icon512.png  # Promotional tiles
```

### Troubleshooting

1. **Permission Issues**
```bash
# If you get permission errors, try:
sudo random-icon-generator generateIcons

# Or fix permissions:
sudo chown -R $USER:$USER ~/.npm
```

2. **Path Issues**
```bash
# Ensure directory exists
mkdir -p path/to/icons
random-icon-generator generateIcons path/to/icons
```

3. **Version Check**
```bash
# Check installed version
random-icon-generator --version

# Check for updates
npm outdated -g @kahwati/random-icon-generator
```

## 📖 API Reference

For programmatic usage, see our [API Documentation](API.md).

## 🎨 Examples

### Generate Icons for Chrome Extension

```bash
# 1. Create a new extension project
mkdir my-chrome-extension
cd my-chrome-extension

# 2. Generate icon set
random-icon-generator generateIcons ./icons

# 3. Use in manifest.json
{
  "name": "My Extension",
  "icons": {
    "16": "icons/icon16.png",
    "48": "icons/icon48.png",
    "128": "icons/icon128.png"
  },
  "action": {
    "default_icon": {
      "19": "icons/icon19.png",
      "38": "icons/icon38.png"
    }
  }
}
```

### Generate User Avatars

```bash
# 1. Set up avatars directory
mkdir -p public/avatars

# 2. Generate multiple unique sets
for i in {1..5}; do
  random-icon-generator generateIcons public/avatars/user$i
done
```

### Batch Generation for Different Sizes

```bash
# Create directories for each size
mkdir -p icons/{small,medium,large}

# Generate different sets
random-icon-generator generateIcons icons/small   # For small icons (16-48px)
random-icon-generator generateIcons icons/medium  # For medium icons (96-128px)
random-icon-generator generateIcons icons/large   # For large icons (256-512px)
```

## 🤝 Contributing

### Development Setup

```bash
# 1. Clone the repository
git clone https://github.com/Devehab/random-icon-generator.git
cd random-icon-generator

# 2. Install dependencies
npm install

# 3. Run tests
npm test

# 4. Try generating icons
node cli.js generateIcons test-icons
```

### Common Development Tasks

```bash
# Run linting
npm run lint

# Run tests with coverage
npm run test:coverage

# Build documentation
npm run docs

# Create a new release
npm version patch  # or minor/major
npm publish
```

## 📝 License

MIT License with Attribution - See [LICENSE](LICENSE) for details.

## 🔗 Links

- [npm Package](https://www.npmjs.com/package/@kahwati/random-icon-generator)
- [GitHub Repository](https://github.com/Devehab/random-icon-generator)
- [Issue Tracker](https://github.com/Devehab/random-icon-generator/issues)
- [Change Log](CHANGELOG.md)

---

<div align="center">
Made with ❤️ by <a href="https://github.com/Devehab">Ehab Kahwati</a>
</div>