cpt-cli-hknain
v1.0.1
Published
A fast and interactive **Competitive Programming Terminal (CPT)** that helps you: - fetch Codeforces problems - auto-generate templates - manage test cases - run local tests instantly
Readme
🚀 cpt-cli
A fast and interactive Competitive Programming Terminal (CPT) that helps you:
- fetch Codeforces problems
- auto-generate templates
- manage test cases
- run local tests instantly
✨ Features
- ⚡ Parse Codeforces problems into folders
- 🧩 Auto-create
solution.cppfrom your template - 📥 Extract sample inputs/outputs automatically
- 🧪 Run all test cases with one command
- 🎨 Colored terminal output (pass/fail/TLE)
- 🧹 Clean and minimal CP workflow
📦 Installation
Global install (recommended)
npm install -g cpt-cli-hknainVerify installation
cptIf installed correctly, you will enter the interactive CPT shell.
🧠 Commands
1. Set template
cpt template set <file>Set your C++ template file for future problems.
2. Show template
cpt template showDisplays current template content.
3. Parse problem
cpt parse <codeforces-url>Example:
cpt parse https://codeforces.com/problemset/problem/2233/AWhat it does:
- Creates folder:
2233A/ - Adds
solution.cpp - Downloads sample inputs/outputs
- Creates:
- input1.txt
- output1.txt
- input2.txt
- output2.txt
4. Test solution
cpt test <folder>Example:
cpt test 2233AOptional time limit:
cpt test 2233A --time 2--time= seconds per test case
5. Clear terminal
cpt clear6. Exit CLI
exit🎨 Output Format
During testing:
- 🟢 Passed → Green
- 🔴 Wrong Answer → Red
- 🟡 Time Limit Exceeded → Yellow
Example:
✓ Test 1 Passed (12 ms)
✗ Test 2 Wrong Answer
⧖ Test 3 Time Limit Exceeded⚙️ Requirements
- Node.js >= 18
- g++ compiler installed
- Internet connection for parse command
📁 Example Structure
2233A/
├─ solution.cpp
├─ input1.txt
├─ output1.txt
├─ input2.txt
├─ output2.txt🧪 Example Workflow
cpt template set myTemplate.cpp
cpt parse https://codeforces.com/problemset/problem/2233/A
cpt test 2233A👨💻 Author
Hitesh Chaudhary
Built for competitive programmers who want a faster workflow.
