codnex
v0.1.1
Published
A powerful CLI tool designed to streamline, organize, and document coding problem solutions from platforms like LeetCode. Codnex enables developers to efficiently manage their problem-solving workflow with intelligent automation and seamless version contr
Maintainers
Readme
📚 Codnex CLI
Codnex is a powerful, developer-friendly CLI tool for organizing and documenting coding problem solutions. Create structured problem folders with metadata, solution stubs, and professional documentation—all with simple commands and interactive prompts.
Perfect for competitive programmers, students, and developers maintaining their coding problem portfolio.
✨ Key Features
- 📁 Organized Problem Structure - Auto-creates folders with metadata and templates
- 💻 Multi-Language Support - C, C++, JavaScript, TypeScript, Python, Java, Rust, Go
- 🎨 Interactive & Colorful CLI - Beautiful prompts with helpful emojis and formatting
- 🏷️ Rich Metadata - Track title, difficulty, tags, platform, complexity, and problem source
- 📄 Auto-Generated Templates - Professional README and JSON metadata for every problem
- 🔗 Smart URL Parsing - Extracts problem titles directly from LeetCode, HackerRank, etc.
- ⚡ Dual Modes - Use interactive prompts OR CLI flags for automation
- 📤 Export Functionality - Convert problem folders to formatted markdown
📦 Installation
Option 1: Global (recommended for CLI usage)
npm install -g codnex
codnex newOption 2: Local Project
npm install --save-dev codnex
npx codnex newOption 3: Direct with npx
npx codnex new🚀 Quick Start
Interactive Mode (Default)
codnex newAnswer the colorful prompts—it's that simple!
CLI Flags Mode (For Scripting)
codnex new \
--name "Two Sum" \
--lang ts,py \
--diff easy \
--tags "array,hash-map" \
--platform "LeetCode" \
--problem-src "https://leetcode.com/problems/two-sum/" \
--time "O(n)" \
--space "O(n)"Export a Problem
# Convert problem folder to formatted markdown
codnex export ./two-sum📋 Command Reference
codnex new
Create a new problem entry.
Interactive mode (default when no flags provided):
codnex newCLI flags mode (for automation):
codnex new [options]Options:
| Option | Description | Example |
|--------|-------------|---------|
| --name, --title <name> | Problem title | --name "Two Sum" |
| --lang <languages> | Comma-separated languages | --lang ts,py,cpp |
| --diff <difficulty> | Difficulty level | --diff easy |
| --tags <tags> | Comma-separated tags | --tags "array,hash-map" |
| --platform <platform> | Problem platform | --platform LeetCode |
| --problem-src <url> | Problem source URL | --problem-src "https://..." |
| --time <complexity> | Time complexity | --time "O(n)" |
| --space <complexity> | Space complexity | --space "O(n)" |
codnex export <folder>
Export a problem folder to a formatted markdown file.
codnex export ./problem-nameCreates/updates README.md with your problem metadata and structure.
📂 Generated File Structure
When you create a new problem, Codnex generates:
problem-name/
├── Solution.ts # Solution file for each language
├── Solution.py
├── meta.json # Problem metadata
└── README.md # Problem documentationmeta.json Example
{
"title": "Two Sum",
"difficulty": "easy",
"tags": ["array", "hash-map"],
"platform": "LeetCode",
"problemSrc": "https://leetcode.com/problems/two-sum/",
"languages": ["ts", "py"],
"timeComplexity": "O(n)",
"spaceComplexity": "O(n)",
"solvedOn": "2025-11-21"
}README.md Template
Includes professional sections for:
- Problem Statement
- Input/Output Format
- Constraints
- Examples with Explanations
- Test Cases
- Approach & Complexity Analysis
💡 Usage Examples
Example 1: Interactive Mode
$ codnex new
┌─ Codnex Problem Creation ─┐
? 📌 Problem Title: Two Sum
? 🔗 Problem Source URL: https://leetcode.com/problems/two-sum/
? 💻 Select Programming Languages: (checkbox mode)
? ⭐ Difficulty Level: (list mode)
? 🏛️ Platform: LeetCode
? 🏷️ Tags: array, hash-map
? ⏱️ Time Complexity: O(n)
? 💾 Space Complexity: O(n)
✅ Success! Problem folder created: two-sum
📎 Problem Source: https://leetcode.com/problems/two-sum/
📁 Location: /current/dir/two-sumExample 2: CLI Flags (Automation)
codnex new \
--name "Merge Sort" \
--lang ts,py,cpp \
--diff medium \
--tags "sorting,divide-and-conquer" \
--platform "GeeksforGeeks" \
--time "O(n log n)" \
--space "O(n)"Example 3: Auto-Extract from URL
# Title automatically extracted from URL
codnex new \
--problem-src "https://hackerrank.com/challenges/solve-me-first/problem/" \
--lang cpp \
--diff easyExample 4: Export Problem
codnex export ./two-sum
# Updates README.md with formatted markdown content📋 Project Organization
Recommended folder structure for organizing problems:
coding-problems/
├── arrays/
│ ├── two-sum/
│ │ ├── Solution.ts
│ │ ├── meta.json
│ │ └── README.md
│ └── best-time-buy-sell/
├── sorting/
├── dynamic-programming/
└── graphs/🔧 Requirements
- Node.js >= 16.0.0
- npm (comes with Node.js)
📖 Tips & Tricks
Batch Create Problems
Create multiple problems using a script:
codnex new --name "Problem 1" --lang ts --diff easy
codnex new --name "Problem 2" --lang ts --diff medium
codnex new --name "Problem 3" --lang ts --diff hardExtract Title from URL
Supports popular platforms:
- LeetCode:
https://leetcode.com/problems/problem-slug/ - HackerRank:
https://hackerrank.com/challenges/challenge-slug/ - CodeForces:
https://codeforces.com/problemset/problem/A/B - Generic URLs with
/problems/or/challenges/patterns
Get Help
codnex --help # Show all commands
codnex new --help # Show create options
codnex export --help # Show export options🚀 Getting Started
Install globally:
npm install -g codnexCreate your first problem:
mkdir my-problems && cd my-problems codnex newStart solving! Edit the
Solution.*files in the created folder.Export when ready:
codnex export ./problem-name
🤝 Contributing
Contributions are welcome! Please feel free to:
- Report bugs and issues
- Suggest new features
- Submit pull requests
GitHub: arpanxneuro/codnex
📝 License
MIT © Arpan Ghosh
See LICENSE file for details.
📧 Support & Feedback
- Issues: Raise an issue
- Discussions: Join the discussion
Made with ❤️ for developers who love clean, organized code
🤖 AI Assistance
This project was improved with assistance from AI tools to speed up development, generate documentation drafts, and help design templates. Codnex itself does not require an AI service to run — any AI-powered features are optional and will be clearly documented where available.
