open-index/open-npm huggingface dataset:
npm package: @mckinleymedia/cli-maker
Description: Auto-generate CLIs from a folder of commands
Author: Will McKinley
Latest version: 1.0.0

# cli-maker

A tool to automatically generate CLIs from a folder of command scripts.

## Installation

```bash
npm install -g @mckinleymedia/cli-maker
```

## Usage

```bash
cli-maker <name> [options]
```

### Options

- `-c, --commands <path>` - Path to commands directory (default: `./commands`)
- `-t, --typescript` - Generate TypeScript CLI (default: false)
- `-h, --help` - Show help
- `-V, --version` - Show version

### Example

```bash
# Generate a CLI called "mycli" from the example-commands folder
cli-maker mycli -c ./example-commands

# The CLI is immediately ready to use!
mycli --help
mycli hello World
```

## How it works

1. **Command Discovery**: cli-maker scans your commands directory for scripts (`.sh`, `.js`, `.ts`, `.py`)
2. **Description Extraction**: It extracts descriptions from comments in your scripts (format: `# Description: Your description here`)
3. **CLI Generation**: Creates a fully functional Node.js CLI with:
   - Command routing
   - Interactive mode with arrow key navigation
   - Colored output
   - Automatic argument detection
   - Help menu
   - Support for multiple script types
4. **Automatic Installation**: The CLI is installed globally with no manual steps required

## Command Script Format

Your command scripts should include a description comment:

```bash
#!/usr/bin/env bash
# Description: This is what my command does

# Your script logic here
echo "Hello from my command!"
```

## Generated CLI Features

The generated CLI includes:

- **Direct command execution**: `mycli <command> [args]`
- **Interactive mode**: Just run `mycli` without arguments
  - Arrow key navigation
  - Colored command list
  - Automatic argument prompting for commands that need them
- **Help menu**: `mycli --help`
- **Automatic script type detection** (bash, node, ts-node, python3)
- **Smart argument detection** - knows which commands accept arguments

## License

MIT