leetgo  by j178

CLI tool for LeetCode practice in the terminal

created 2 years ago
591 stars

Top 55.8% on sourcepulse

GitHubView on GitHub
Project Summary

This tool provides a command-line interface for LeetCode users, automating the process of problem fetching, code generation, local testing, and submission. It aims to streamline the competitive programming workflow, allowing users to manage their LeetCode practice entirely within the terminal.

How It Works

Leetgo leverages LeetCode's GraphQL API to interact with the platform. Upon initialization, it can fetch problem details, generate skeleton code in various languages, and create test case files. Its core advantage lies in its local testing capabilities, which allow users to run their solutions against provided test cases using their preferred IDE and debugger, significantly improving the development and debugging cycle.

Quick Start & Requirements

  • Install: Download binaries from releases, or use package managers like Homebrew (brew install j178/tap/leetgo), Scoop (scoop install j178/leetgo), or go install github.com/j178/leetgo@latest.
  • Initialize: leetgo init -t <us or cn> -l <lang>
  • Usage: leetgo pick <id or name>, leetgo test last, leetgo submit last.
  • Dependencies: Go toolchain for source builds. Browser access for cookie-based authentication.
  • Docs: Leetgo GitHub

Highlighted Details

  • Supports both leetcode.com and leetcode.cn.
  • Automatically reads cookies from browsers for authentication.
  • Offers OpenAI integration for experimental code fixing.
  • Generates contest questions and allows batch submission.
  • Supports customizable filename templates and code blocks.

Maintenance & Community

  • Active development with contributions from multiple developers.
  • Credits JetBrains for license support.
  • Contributions are welcomed via GitHub issues and pull requests.

Licensing & Compatibility

  • MIT License.
  • Compatible with commercial and closed-source projects.

Limitations & Caveats

  • Local testing is not yet supported for all languages (e.g., Java, JavaScript, C#, etc.).
  • Browser cookie decryption may be impacted by browser updates (e.g., Chrome/Edge v127 on Windows).
  • Password authentication is not recommended and not supported by leetcode.com.
Health Check
Last commit

6 days ago

Responsiveness

1 day

Pull Requests (30d)
9
Issues (30d)
0
Star History
22 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Anil Dash Anil Dash(Former CEO of Glitch), and
13 more.

cline by cline

0.8%
48k
VS Code extension for autonomous coding agent
created 1 year ago
updated 15 hours ago
Feedback? Help us improve.