Skip to content

Releases: night-slayer18/leetcode-cli

v2.2.2

18 Jan 05:29
v2.2.2
e42eaa7

Choose a tag to compare

Release Date: 2026-01-18
Focus: Critical Bug Fix (Update Command)

🐛 Bug Fixes

  • Update Command: Fixed a logic inversion where leetcode update would incorrectly report "You're on the latest version" even when updates were available. It now correctly prompts for updates.

v2.2.1

17 Jan 11:22
v2.2.1
34d4f57

Choose a tag to compare

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

17 Jan 07:43
v2.2.0
de74da7

Choose a tag to compare

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

16 Jan 18:44
v2.1.1
70f7b91

Choose a tag to compare

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

16 Jan 11:26
v2.1.0
f2781a0

Choose a tag to compare

🚀 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
  • --force flag 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-cli

v2.0.1

12 Jan 13:19
v2.0.1
9779383

Choose a tag to compare

🔒 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

11 Jan 06:29
v2.0.0
224243c

Choose a tag to compare

⚠️ 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 workspace
  • workspace list - List all workspaces
  • workspace create <name> - Create new workspace
  • workspace use <name> - Switch workspaces
  • workspace 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.0

v1.6.0

10 Jan 06:34
v1.6.0
55f7b52

Choose a tag to compare

What's New

👥 Collaborative Coding (leetcode collab)

Solve problems together with a partner!

  • collab host <id> - Create a room and get a code to share
  • collab join <code> - Join your partner's room
  • collab sync - Upload your solution to the cloud
  • collab compare - View both solutions side by side
  • collab status - Check who has synced
  • collab 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

09 Jan 16:48
v1.5.0
e5514fa

Choose a tag to compare

🚀 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

08 Jan 13:59
v1.4.0
bd05bb2

Choose a tag to compare

🚀 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 init if needed
  • Auto-create GitHub repos with gh CLI
  • Clean commit messages with stats

Configuration

  • New -r, --repo option to set your Git remote

Full Changelog: v1.3.2...v1.4.0