quizcraft
v1.0.1
Published
A beautiful TUI quiz application powered by quizapi.io - Test your knowledge with interactive quizzes in your terminal
Maintainers
Readme
QuizCraft 🎯
A beautiful Terminal User Interface (TUI) quiz application that fetches questions from quizapi.io and provides an interactive quiz experience.

Features
- 🎨 Beautiful, colorful terminal interface
- 📚 Multiple categories to choose from
- 🎚️ Three difficulty levels (Easy, Medium, Hard)
- 📊 Real-time score tracking
- 💡 Answer explanations
- ⚡ Fast and responsive
Installation
Global Installation (Recommended)
Install QuizCraft globally via npm:
npm install -g quizcraftUsing npx (No Installation)
Run QuizCraft without installing. You need to have the API key set up as described in the Setup section below.
npx quizcraftSetup
Before using QuizCraft, you need an API key from quizapi.io (free tier available):
- Get your free API key from https://quizapi.io/clientarea/settings/token
- Create a
.envfile in your home directory or current directory:echo "QUIZ_API_KEY=your_actual_api_key_here" > .env - Or set it as an environment variable:
export QUIZ_API_KEY=your_actual_api_key_here
Usage
Once you have your API key set up, run:
quizcraftThen follow the interactive prompts!
How It Works
- Start the application - QuizCraft welcomes you and fetches available categories
- Select a category - Choose from various topics like Linux, DevOps, Programming, or select "All Categories"
- Choose difficulty - Pick Easy 🟢, Medium 🟡, Hard 🔴, or Mixed
- Select question count - Choose between 5, 10, 15, or 20 questions
- Answer questions - Use arrow keys to select your answer (A, B, C, D)
- Get instant feedback - See if you're correct and view explanations
- View results - See your final score with performance feedback
- Play again - Start a new quiz or exit
Development
Running from Source
- Clone the repository:
git clone https://github.com/dnafication/quizcraft.git
cd quizcraft- Install dependencies:
npm install- Set up your API key:
cp .env.example .env
# Edit .env and add your API key- Run the application:
npm startOr use development mode with auto-reload:
npm run devProject Structure
quiz-cli/
├── src/
│ ├── index.js # Entry point
│ ├── api/
│ │ └── quizApi.js # API client for quizapi.io
│ ├── ui/
│ │ ├── menu.js # Main menu interface
│ │ ├── quiz.js # Quiz display logic
│ │ └── results.js # Results display
│ ├── utils/
│ │ ├── config.js # Configuration management
│ │ └── helpers.js # Helper functions
│ └── constants.js # Constants and enums
├── .env.example # Example environment variables
├── .gitignore
├── package.json
├── PLAN.md # Detailed project plan
└── README.mdTechnologies Used
- @clack/prompts - Modern CLI prompts
- chalk - Terminal string styling
- axios - HTTP client
- ora - Terminal spinner
- dotenv - Environment variable management
API Information
This application uses the quizapi.io API to fetch quiz questions. The API provides:
- Multiple categories (Linux, DevOps, Programming, Docker, Kubernetes, and more)
- Three difficulty levels (Easy, Medium, Hard)
- Detailed explanations for answers
- Multiple choice questions
- Free tier available
Environment Variables
QUIZ_API_KEY- Your quizapi.io API key (required)DEBUG- Set totrueto enable debug logging (optional, default:false)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
ISC
Acknowledgments
- Quiz questions powered by quizapi.io
- UI inspired by modern CLI tools
Made with ❤️ and Node.js and Copilot CLI!
