product-discovery-cli
v0.0.15
Published
CLI to consume the Product Discovery Agent API
Maintainers
Readme
Product Discovery CLI
A professional command-line interface to interact with the Product Discovery Agent API. Generate structured product discoveries powered by AI using an intuitive and colorful CLI experience.
✨ Features
- 🌐 Internationalization: Support for Portuguese (pt-br) and English (en-us)
- 🎨 Professional UX: Colorful output, interactive prompts, and loading spinners
- 🏗️ Clean Architecture: Built with SOLID principles and layered architecture
- 💾 Auto-save: Optional automatic JSON result saving
- 🔄 Iterative Improvement: Refine discoveries with additional context
- ⚙️ Configurable: CLI flags, config files, and environment variables
- ✅ Well-tested: Comprehensive unit tests with 90%+ coverage
- 📦 Easy to install: Available as a global npm package
📦 Installation
Global Installation (Recommended)
npm install -g product-discovery-cliLocal Installation
npm install product-discovery-cli🚀 Quick Start
After global installation, simply run:
product-discoveryThe CLI will guide you through an interactive flow to generate product discoveries.
📖 Usage
Basic Usage
# Run with default settings (Portuguese)
product-discovery
# Run in English
product-discovery --lang en-us
# Specify API URL
product-discovery --api-url http://localhost:3000/api/v1/discovery
# Auto-save results without prompting
product-discovery --save --output ./resultsCLI Options
| Option | Alias | Description | Default |
|--------|-------|-------------|---------|
| --api-url <url> | -u | API endpoint URL | http://localhost:3000/api/v1/discovery |
| --lang <code> | -l | Language (pt-br, en-us) | pt-br |
| --config <path> | -c | Path to JSON config file | - |
| --save | -s | Auto-save without prompting | false |
| --output <dir> | -o | Default output directory | - |
| --file <name> | -f | Default output filename | - |
| --no-save | - | Disable saving prompt | - |
Configuration File
Create a JSON configuration file to set default options:
{
"apiUrl": "http://localhost:3000/api/v1/discovery",
"lang": "en-us",
"autoSave": true,
"defaultOutputDir": "./discoveries",
"defaultFileName": "discovery.json"
}Use it with:
product-discovery --config ./config.jsonEnvironment Variables
Set environment variables for configuration:
export PRODUCT_DISCOVERY_API_URL=http://localhost:3000/api/v1/discovery
product-discovery🌍 Internationalization
The CLI supports multiple languages:
- Portuguese (pt-br): Default language
- English (en-us): Full translation of all messages
Switch languages using the --lang flag:
product-discovery --lang en-us🏗️ Architecture
This project follows Clean Architecture principles with clear separation of concerns:
src/
├── application/ # Use cases and business logic
├── domain/ # Domain entities and utilities
├── infrastructure/ # External dependencies (API, storage, i18n)
├── presentation/ # CLI controllers and routes
└── config/ # Configuration and CLI optionsKey Principles
- SOLID: Single Responsibility, Open/Closed, Dependency Inversion
- Dependency Injection: All dependencies injected via constructors
- Testability: Easy to mock and test each layer independently
🛠️ Development
Prerequisites
- Node.js >= 20
Setup
# Clone the repository
git clone https://github.com/AuronForge/product-discovery-cli.git
cd product-discovery-cli
# Install dependencies
npm install
# Run locally
npm start
# Run tests
npm test
# Run tests with coverage
npm run test:coverageTesting
The project includes comprehensive unit tests with Jest:
# Run all tests
npm test
# Run with coverage report
npm run test:coverageCoverage thresholds are set to 90% for all metrics.
📝 Interactive Flow
The CLI guides you through an intuitive workflow:
- Welcome: Display branded banner with metadata
- Input: Describe your idea/problem/application
- Processing: Call the Product Discovery API
- Results: View the generated JSON discovery
- Save: Optionally save results to a file
- Improve: Refine with additional context (optional)
- Repeat: Run discovery for another idea (optional)
🎨 Output Example
╭────────────────────────────────────────────────────────────────────╮
│ │
│ ____ _ _ ____ _ │
│ | _ \ _ __ ___ __| |_ _ ___| |_ | _ \(_)___ ___ ___ │
│ | |_) | '__/ _ \ / _ | | | |/ __| __| | | | | / __|/ __/ _ \ │
│ | __/| | | (_) | (_| | |_| | (__| |_ | |_| | \__ \ (_| (_) | │
│ |_| |_| \___/ \__,_|\__,_|\___|\__| |____/|_|___/\___\___/ │
│ │
│ Product Discovery CLI │
│ Generate a structured product discovery via the API. │
│ │
│ Author: AuronForge │
│ Version: 0.0.2 │
│ License: Apache-2.0 │
│ │
╰────────────────────────────────────────────────────────────────────╯📄 License
This project is licensed under the Apache-2.0 License.
👤 Author
José Eduardo Trindade E Marques
- Company: AuronForge 🚀
- Email: [email protected]
- LinkedIn: linkedin.com/in/edu-marques29
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
🐛 Issues
Found a bug or have a suggestion? Please open an issue on GitHub.
🔗 Links
Made with ❤️ by AuronForge
