amrit-poem-cli
v1.1.4
Published
A simple and interactive CLI tool to generate classic nursery rhyme poem files right from your terminal.
Readme
📜 amrit-poem-cli
A simple and interactive CLI tool to generate classic nursery rhyme poem files right from your terminal.
📦 Installation
Global Installation (Recommended)
npm install -g amrit-poem-cliLocal Installation
npm install amrit-poem-cli🚀 Usage
Method 1 — npx (no install required)
npx amrit-poem-cli generate-poemMethod 2 — Global (after global install)
poemcli generate-poemMethod 3 — Local project script
Add to your package.json:
"scripts": {
"poem": "poemcli generate-poem"
}Then run:
npm run poemMethod 4 — Run directly with Node
node index.js generate-poemMethod 5 — Local development with npm link
npm link
poemcli generate-poem🎮 Interactive Demo
$ poemcli generate-poem
? Choose a poem: (Use arrow keys)
❯ Twinkle Twinkle
Johny Johny
Humpty Dumpty
Baa Baa Black Sheep
Jack and Jill
✅ Poem file created: poems/twinkle_twinkle.txt📚 Available Poems
| # | Poem Name | |---|-------------------| | 1 | Twinkle Twinkle | | 2 | Johny Johny | | 3 | Humpty Dumpty | | 4 | Baa Baa Black Sheep | | 5 | Jack and Jill |
📁 Output Structure
Poems are saved as .txt files inside a poems/ folder, auto-created in your current working directory:
your-project/
└── poems/
├── twinkle_twinkle.txt
├── johny_johny.txt
├── humpty_dumpty.txt
├── baa_baa_black_sheep.txt
└── jack_and_jill.txt🛠️ All Methods at a Glance
| Method | Command | Best For |
|---|---|---|
| Global install | poemcli generate-poem | Frequent everyday use |
| npx | npx amrit-poem-cli generate-poem | One-time / no install |
| Local + npx | npx poemcli generate-poem | Project-scoped usage |
| npm script | npm run poem | Integrated in a project |
| Node directly | node index.js generate-poem | Debugging / dev mode |
| npm link | poemcli generate-poem (linked) | Local package testing |
⚙️ Commands
| Command | Description |
|---|---|
| generate-poem | Launch interactive prompt to select and save a poem |
📦 Dependencies
| Package | Version | Purpose | |---|---|---| | commander | ^14.0.3 | CLI command parsing | | inquirer | ^8.2.7 | Interactive terminal prompts |
💡 Tip: Run the command multiple times to generate as many poem files as you like. Each poem is saved separately and existing files are overwritten with the latest content.
