# 使用 Homebrew, Nix 安装 leetcode-cli

查看 leetcode-cli 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:leetcode-cli
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install leetcode-cli
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#leetcode-cli
```

  证据: nixpkgs package indexes: pkgs/by-name/le/leetcode-cli/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:leetcode-cli
- **软件包管理器:** Homebrew
- **版本:** 0.5.4
- **来源摘要:** May the code be with you
- **主页:** <https://github.com/clearloop/leetcode-cli>
- **仓库:** <https://github.com/clearloop/leetcode-cli>
- **最后更新:** 2026-06-29T07:59:28Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- leetcode (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.5.4
## 项目历史与用法

clearloop's `leetcode-cli` is a Rust command-line client for LeetCode workflows: picking problems, opening generated solution files, running sample tests, submitting solutions, filtering problem lists, and managing local cache data.

### 项目历史

The project is distributed from GitHub and crates.io-style Rust installation paths, with the README emphasizing `cargo install leetcode-cli`, a Nix flake, shell completions, and local configuration.

A notable configuration milestone appears in the v0.4.0 release on 2024-06-24, which introduced the documented TOML configuration layout for editor, cookies, and storage. Later releases expanded everyday coding-practice ergonomics, including daily challenge flags, LeetCode China support, environment-variable cookie overrides, clap-derived commands, and README/docs restructuring.

### 采用历史

The repository shows hundreds of stars and dozens of forks, and the input package facts list Homebrew and Nix packaging. That puts it in the small but active ecosystem of terminal-first LeetCode clients used by programmers who want editor-centric practice instead of browser-only workflows.

### 使用方式

The README's quickstart has users sign in to LeetCode in a browser, then run commands such as `leetcode pick`, `leetcode edit`, `leetcode test`, and `leetcode exec`. On macOS and Linux, the tool can read Chrome cookies automatically; manual cookie setup and environment-variable overrides are documented for other cases.

### 为什么软件包爱好者会关心

The package is interesting because it packages an authenticated web-workflow CLI: browser cookies, local code generation, editor integration, shell completions, SQLite/OpenSSL build concerns, and LeetCode API changes all meet in one terminal tool.

### 时间线

- 2024-06-24: v0.4.0 release introduced the documented TOML configuration format.
- 2024-12-24: v0.5.0 release switched command definitions to clap derive.
- 2026-06-21: v0.5.1 release notes document README/docs restructuring and macOS Chrome-cookie fixes.
- 2026-06-21: v0.5.2 release bundled SQLite to reduce system build dependency friction.

### Related projects

- It overlaps with other LeetCode CLIs in this batch, especially `leetgo`, `leetup`, and older JavaScript-era LeetCode command-line clients, but clearloop's implementation is Rust-centered and packaged for cargo, Homebrew, and Nix users.

### 来源

- <https://crates.io/crates/leetcode-cli>
- <https://github.com/clearloop/leetcode-cli>
- <https://github.com/clearloop/leetcode-cli/releases>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.leetcode/leetcode.toml

## Credential files

- Unix: ~/.leetcode/leetcode.toml
## 其他软件包管理器记录

- Nix - leetcode-cli: normalized package name match | nixpkgs package indexes: pkgs/by-name/le/leetcode-cli/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/leetcode-cli.yml](https://github.com/mxcl/pkgdb/blob/main/combined/leetcode-cli.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
