leetkick
v0.5.0
Published
A CLI tool for scaffolding LeetCode exercises with language-specific testing setups
Downloads
41
Maintainers
Readme
LeetKick
A modern CLI tool for scaffolding LeetCode exercises with language-specific testing setups. Fetch problems, auto-generate boilerplate, and start coding immediately!
🚧 Heads up!
LeetKick is still pretty new and changing fast. Things might break between updates as I add support for more programming languages. Once it hits v1.0, it'll be much more stable!
Features
- Fetch problems directly from LeetCode - no copy/paste needed
- Auto-scaffolding - solution + test files generated instantly
- Clean organization - problems organized by language and number
- Zero-config testing - just run
leetkick testfrom anywhere - Smart problem matching - run tests by number, slug, or name
- Multi-language support - 8 languages supported, 10+ planned (goal: all LeetCode languages)
Quick Start
# Setup once
leetkick init my-practice && cd my-practice
leetkick add python # or typescript, javascript, go, rust, kotlin, java, cpp
# Use daily
leetkick fetch two-sum --language python # Auto-generates solution + test files
leetkick test two-sum --language python # Run tests instantlyWhat you get: Ready-to-code files with problem description, starter code, and test setup. No configuration needed!
Installation
Prerequisites: Node.js 18+
# Install from npm (recommended)
npm install -g leetkick
# Or build from source
git clone https://github.com/charliesbot/leetkick.git
cd leetkick && npm install && npm run compile && npm link
# Verify installation
leetkick --helpLanguage Support
Our goal is to support all languages that LeetCode offers. Here's our current progress:
| Language | Status | Testing Framework | Formatter | Linter | Notes | | -------------- | ---------------- | ----------------- | ------------ | ------ | ------------------------------- | | TypeScript | ✅ Supported | Vitest | Biome | Biome | Full support with type checking | | C++ | ✅ Supported | Catch2 (bundled) | clang-format | — | C++17 standard | | Kotlin | ✅ Supported | JUnit 5 + Gradle | — | — | Full Gradle integration | | Java | ✅ Supported | JUnit 5 + Gradle | — | — | Full Gradle integration | | Go | ✅ Supported | Built-in testing | — | — | Go 1.21+ with modules | | Rust | ✅ Supported | cargo test | — | — | Rust 2021 edition | | Python | ✅ Supported | pytest | ruff | ruff | Python 3.8+ with modern tooling | | JavaScript | ✅ Supported | Vitest | Biome | Biome | ES Modules with modern tooling | | C | 🚧 Planned | — | — | — | Coming soon | | C# | 🚧 Planned | — | — | — | Coming soon | | Ruby | 🚧 Planned | — | — | — | Coming soon | | Swift | 🚧 Planned | — | — | — | Coming soon | | Scala | 🚧 Planned | — | — | — | Coming soon | | PHP | 🚧 Planned | — | — | — | Coming soon | | Dart | 🚧 Planned | — | — | — | Coming soon |
Legend:
- ✅ Supported - Full integration with templates, testing, and tooling
- 🚧 Planned - On our roadmap, contributions welcome!
Each supported language workspace includes setup instructions, prerequisites, and testing guides in its own README.
Command Reference
| Command | Purpose | Example |
| ----------------------------------- | -------------------- | ---------------------------------------------- |
| init [dir] | Create workspace | leetkick init my-practice |
| add <lang> | Add language support | leetkick add javascript |
| fetch <problem> --language <lang> | Get LeetCode problem | leetkick fetch two-sum --language javascript |
| test <problem> --language <lang> | Run tests | leetkick test 1 --language javascript |
| sync [lang] | Update config files | leetkick sync --all --dry-run |
| help [cmd] | Show help | leetkick help fetch |
Advanced Features
Smart Problem Matching
leetkick test 1 --language javascript # By number
leetkick test two-sum --language javascript # By slug
leetkick test problem_0001 --language javascript # By exact directory nameWorkspace Sync
leetkick sync typescript # Sync specific language
leetkick sync --all # Sync all languages
leetkick sync --dry-run # Preview changes onlyWorks Anywhere: Run commands from any directory in your workspace
Safe Overwrites: CLI warns before overwriting existing solutions. Use --force to override
Shortcuts: Use -l instead of --language, -f instead of --force
Project Structure
After using the CLI, your project will be organized by language:
your-project/
├── .leetkick.json # Workspace configuration
├── typescript/ # TypeScript workspace
│ ├── problem_0001/
│ │ ├── TwoSum.ts # Your solution
│ │ └── TwoSum.test.ts # Test cases
│ └── problem_0704/
│ ├── BinarySearch.ts
│ └── BinarySearch.test.ts
├── cpp/ # C++ workspace
│ ├── problem_0001/
│ │ ├── two_sum.cpp # Your solution
│ │ └── two_sum.test.cpp # Test cases
│ └── catch_amalgamated.hpp # Bundled testing framework
├── kotlin/ # Kotlin workspace
│ ├── src/main/kotlin/ # Solutions
│ │ └── problem0001/TwoSum.kt
│ ├── src/test/kotlin/ # Tests
│ │ └── problem0001/TwoSumTest.kt
│ └── build.gradle.kts # Gradle configuration
├── go/ # Go workspace
│ ├── go.mod # Module definition
│ ├── problem_0001/ # Each problem is its own package
│ │ ├── solution.go # Solution
│ │ └── solution_test.go # Tests
│ └── problem_0704/
│ ├── solution.go
│ └── solution_test.go
├── python/ # Python workspace
│ ├── src/ # Source code
│ │ ├── problem_0001/
│ │ │ └── two_sum.py # Your solution
│ │ └── problem_0704/
│ │ └── binary_search.py
│ ├── tests/ # Tests
│ │ ├── problem_0001/
│ │ │ └── test_two_sum.py
│ │ └── problem_0704/
│ │ └── test_binary_search.py
│ ├── requirements.txt # Dependencies
│ └── pyproject.toml # Configuration
└── ...Each language workspace includes all necessary configuration files, testing frameworks, and formatting rules.
What You Get
Each problem generates solution and test files with:
- Problem description and difficulty
- LeetCode starter code
- Test framework setup ready to use
- Language-specific project structure
Workflow: Implement solution → Add test cases → Run leetkick test → Success!
Troubleshooting
Installation Issues:
- Ensure Node.js 18+ is installed:
node --version - Clear npm cache:
npm cache clean --force - Use
npm install -g leetkick --forceto reinstall
Command Issues:
- Run
leetkick --helpto verify installation - Check you're in a leetkick workspace (contains
.leetkick.json) - Use full problem names if short names don't work
Language Issues:
- Check language-specific README for setup instructions and prerequisites
- Ensure required compilers/runtimes are installed
Update LeetKick:
npm update -g leetkick
leetkick --versionContributing
We'd love your contributions! Here's how to help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/awesome-feature - Make your changes following the existing code style
- Run tests:
npm testand linting:npm run lint - Submit a pull request
Development Setup
git clone https://github.com/charliesbot/leetkick.git
cd leetkick && npm install && npm run compile && npm linkCommands: npm run compile (build) | npm test (test) | npm run lint (style check)
Adding New Language Support
Add new language templates easily:
- Create
templates/<language>/directory - Add
exercise_template.*andtest_template.*files with placeholders - Include config files (package.json, requirements.txt, etc.)
- CLI automatically discovers new languages!
Template placeholders: __PROBLEM_ID__, __PROBLEM_TITLE__, __PROBLEM_DESC__, __PROBLEM_DEFAULT_CODE__, etc.
See existing templates in templates/ for examples.
License
MIT
Acknowledgments
- Built with Google TypeScript Style (gts)
- Uses LeetCode's GraphQL API for problem fetching
