Releases: night-slayer18/leetcode-cli
v2.2.2
v2.2.1
Release Date: 2026-01-17
Focus: Security Hotfix & CI/CD Enhancements
🔒 Security Fixes
- HTML Injection: Fixed vulnerabilities in problem descriptions, hints, and code templates by replacing regex-based sanitization with
striptags(#security). - Double Escaping: Fixed issue where HTML entities (like
") could be double-unescaped (#security). - Dependencies: Updated CodeQL actions to v4 and added Dependency Review workflow.
🔧 Improvements
- CI/CD: Added Stale issue management and optimized Docker builds with caching.
- Linting: Resolved all ESLint warnings and enforced stricter type safety.
v2.2.0
Release Date: 2026-01-17
Focus: Problem Hints & Performance
🚀 New Features
Hint Command (leetcode hint)
Get hints for a problem when you're stuck.
leetcode hint <id>- Show hints one at a time (press Enter for next)leetcode hint <id> --all- Show all hints at once- Supports both problem ID and slug
- Cleans HTML formatting for terminal display
- Alias:
h
⚡ Performance Improvements
Submission Polling Optimization
- Exponential backoff: Reduced API calls by 60% (30 → 12 calls)
- Faster results: 500ms initial delay for quicker feedback
- Network resilience: Added retry logic for transient network errors
- Better error messages: "Test" vs "Submission" context in timeouts
v2.1.1
Release Date: 2026-01-17
Focus: Refactoring & Robustness
🔧 Improvements
- Code Refactoring: Extracted shared semver utility for consistent version comparison
- Improved Parsing: Enhanced changelog parser regex to handle various version formats
- Robustness: Integration tests now verify against real npm/GitHub APIs
- Network Reliability: Fixed potential hangs by enforcing strict 10s total timeout for registry checks
v2.1.0
🚀 New Features
Update Command (leetcode update)
Check for CLI updates from npm registry with automatic notifications.
- Visual notification box when updates are available
- Detects breaking changes (major version bumps) and warns users
- 24-hour caching to avoid excessive registry calls
--forceflag to bypass cache and re-check
Changelog Command (leetcode changelog)
View release notes directly from the CLI.
- Fetches changelog from GitHub (works for global installs)
- Default: shows only versions newer than your installed version
--all- Show full changelog--latest- Show only latest version--breaking- Filter to breaking changes only
Startup Update Notifications
Non-blocking check on startup shows a subtle banner if updates are available.
⚡ Performance Improvements
- Build minification enabled: bundle size reduced ~40% (163KB → 98KB)
- Tree-shaking for better dead code elimination
📦 Install/Update
npm install -g @night-slayer18/leetcode-cliv2.0.1
🔒 Security Hotfix
This release addresses critical security vulnerabilities discovered in file path handling and shell command execution.
Security Fixes
Path Traversal Prevention
- Fixed vulnerability where test, submit, and diff --file commands accepted file paths outside the configured workspace
- Now validates that files are inside workDir before reading/submitting
- Prevents potential execution of malicious code from downloaded solutions
Command Injection Prevention
- Fixed sync command to sanitize repository names before shell execution
- Added git URL format validation to prevent malicious URL injection
- Properly escapes shell arguments in commit messages
What's Changed
- Added isPathInsideWorkDir() validation function
- Added sanitizeRepoName(), isValidGitUrl(), escapeShellArg() security utilities
- Added 6 new security tests (202 total)
Upgrade
npm update @night-slayer18/leetcode-cli
Full Changelog: https://github.com/night-slayer18/leetcode-cli/blob/main/docs/releases.md
v2.0.0 - Workspaces, Visual Debugging, Snapshots & Diff
⚠️ Breaking Change
This release introduces workspace-aware storage. Existing data in ~/.leetcode/ will not be automatically migrated. Delete the folder to start fresh or manually move data to the new workspace directory.
🚀 New Features
Workspaces (leetcode workspace)
Isolate your problem-solving contexts with separate config, timer history, and snapshots.
workspace current- Show active workspaceworkspace list- List all workspacesworkspace create <name>- Create new workspaceworkspace use <name>- Switch workspacesworkspace delete <name>- Delete workspace
Visual Debugging (leetcode test --visualize)
ASCII visualization for test outputs based on problem tags.
- Supports: Array, Linked List, Tree, Binary Tree, Graph, Matrix, String, Stack, Queue, Heap
- Highlights mismatches in red
- Auto-detects 2D arrays as matrices
Solution Snapshots (leetcode snapshot)
Save, restore, and compare different versions of your solutions.
Solution Diff (leetcode diff)
Compare your current solution with past submissions or files.
🧪 Testing
- 194 tests (was 150)
- Multi-workspace isolation tests
- Visual debugging unit tests
Installation
npm install -g @night-slayer18/leetcode-cli@2.0.0v1.6.0
What's New
👥 Collaborative Coding (leetcode collab)
Solve problems together with a partner!
collab host <id>- Create a room and get a code to sharecollab join <code>- Join your partner's roomcollab sync- Upload your solution to the cloudcollab compare- View both solutions side by sidecollab status- Check who has syncedcollab leave- End the session
🏗️ Architecture Improvements
- Separated storage into individual files for cleaner organization:
~/.leetcode/config.json- CLI settings~/.leetcode/credentials.json- Login session~/.leetcode/collab.json- Collaboration session~/.leetcode/timer.json- Solve time tracking
Full Changelog: v1.5.0...v1.6.0
v1.5.0
🚀 What's New
Interview Timer (leetcode timer)
Simulate interview conditions with a countdown timer!
- Start with default time limits: Easy (20m), Medium (40m), Hard (60m)
- Custom time with
-m <minutes>option - Records your solve time when you submit successfully
- View your history with
--stats
Usage:
leetcode timer 1 # Start with default time
leetcode timer 1 -m 30 # Custom 30 minute limit
leetcode timer --stats # View solve times
leetcode timer --stop # Cancel timer
🐛 Bug Fixes
- File Search: Fixed
leetcode submit <id>finding notes files instead of solutions
Full Changelog: v1.4.0...v1.5.0
v1.4.0
🚀 What's New
Advanced Statistics (leetcode stat)
Visualize your LeetCode progress with new analytics options:
-c, --calendar: Weekly activity table (12 weeks)-s, --skills: Skill breakdown by topic tags-t, --trend: 7-day submission bar chart
Git Sync (leetcode sync)
One-command sync to push your solutions to GitHub/GitLab:
- Auto
git initif needed - Auto-create GitHub repos with
ghCLI - Clean commit messages with stats
Configuration
- New
-r, --repooption to set your Git remote
Full Changelog: v1.3.2...v1.4.0