Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
4e22395
Add PHP
jdneo Mar 2, 2019
f80d82a
Fix Submission rate
jdneo Mar 2, 2019
4856eca
Update package.json
jdneo Mar 2, 2019
672563e
chore: modify the plugin source
poppinlp Mar 22, 2019
ca7487a
Merge pull request #1 from poppinlp/master
jdneo Apr 8, 2019
1c0ccb0
Bug fix & Prepare for preview markdown webview (#2)
Vigilans Apr 8, 2019
6ada49d
Add npm ignore (#5)
jdneo Apr 13, 2019
275e502
Add plugins (#4)
jdneo Apr 13, 2019
7d6d021
Add `likes` and `dislikes` property to problem description (#3)
Vigilans Apr 13, 2019
3fce491
Prepare 2.6.3 (#6)
jdneo Apr 13, 2019
03c6059
Add `likes` and `dislikes` to detailed.tpl (#7)
Vigilans Apr 13, 2019
494dc51
Show command update (#9)
Vigilans Apr 21, 2019
54b233b
Bump to 2.6.4 (#10)
jdneo Apr 21, 2019
b9f0303
Code template regression & update (#11)
Vigilans Apr 24, 2019
d18391e
Fix the testcases (#12)
jdneo Apr 25, 2019
eba8da3
Bump version to 2.6.5 (#14)
jdneo Apr 27, 2019
3bf5621
Add problem name into the solution output (#15)
jdneo May 8, 2019
b18748e
chore: bump version to 2.6.6
jdneo May 13, 2019
56f0d1c
Update tags (#16)
jdneo Jun 17, 2019
8cf39b5
Prepare for 2.6.7 (#17)
jdneo Jun 17, 2019
16a383f
Remove the confirm step when removing a session (#18)
jdneo Jun 27, 2019
ad2e01c
Bump to 2.6.8 (#19)
jdneo Jun 27, 2019
cc8a217
Refactor test & submit output format (#20)
Vigilans Aug 23, 2019
955ce03
Prepare for 2.6.9 (#21)
jdneo Aug 28, 2019
6ff12d8
Fix the type error (#22)
jdneo Sep 14, 2019
b361581
add file.codeData to extract user code (#23)
magic-akari Sep 17, 2019
52e51bf
fix: Add id field to match the problem (#24)
jdneo Sep 26, 2019
3386579
Bump version to 2.6.11 (#25)
jdneo Sep 27, 2019
f4e6133
Fix the output bug (#26)
jdneo Sep 28, 2019
b0061de
Bump to 2.6.12
jdneo Sep 28, 2019
4f8d84a
Use more entries to find the problem
jdneo Sep 28, 2019
f5c6f9a
Bump to 2.6.13
jdneo Sep 28, 2019
9c4420d
Fix the bug that LeetCode cannot test (#27)
jdneo Oct 7, 2019
a25ffb7
Fix the fid bug (#28)
jdneo Oct 7, 2019
2ef4128
Bump to 2.6.15
jdneo Oct 7, 2019
3640b49
Fix the NPE for the percent field of the problem (#30)
jdneo Oct 9, 2019
848f2ab
Fix the bug that could not test (#29)
jdneo Oct 9, 2019
07e8e7f
Prepare for 2.6.16
jdneo Oct 9, 2019
126d550
add leetcode user -c that user can login with cookie (#31)
yihong0618 Dec 2, 2019
e4bd585
Bump version to 2.6.17
jdneo Dec 2, 2019
0165a7a
fix leetcode.cn change payload bug and fix typo in readme (#32)
yihong0618 Dec 8, 2019
a5eb30b
Prepare for 2.6.18 (#33)
jdneo Dec 8, 2019
1f26fbd
add third party github login for future updates in vscode-leetcode (#34)
yihong0618 Dec 24, 2019
ec92f5c
Prepare for 2.6.20
jdneo Dec 27, 2019
dae0c8e
Remove windows from CI (#36)
jdneo Dec 30, 2019
a11e137
solve GitHub login two-factor auth problem (#35)
yihong0618 Dec 30, 2019
89572fc
Prepare for 2.6.21 (#37)
jdneo Dec 30, 2019
6a32f23
fix alignment (#39)
cocobear Jan 10, 2020
1b3aaab
Change: dependency from prompt-sync to prompt for extention side to s…
yihong0618 Jan 12, 2020
37cb2ea
Update to 2.6.22
jdneo Jan 12, 2020
1cec0d5
Add new category concurrency (#42)
xpunch Mar 12, 2020
3818bc5
Update to 2.6.23
jdneo Apr 18, 2020
5a23270
Fix: LinkedIn login problem. (#43)
yihong0618 Jun 17, 2020
404420e
Add ts support (for vscode-leetcode) (#45)
nathanesau Jun 18, 2020
1c45e40
fix: leetcode-cn can not use GitHub log in bug (#46)
yihong0618 Jun 27, 2020
eded574
Bump version to 2.7.0 (#47)
jdneo Jun 27, 2020
cd5d4ef
fix: can not star bug also add test (#49)
yihong0618 Aug 21, 2020
dd8ba8b
fix: can't sign in by cookie on leetcode-cn site (#55)
dzz007 Mar 31, 2021
dfbb5b1
feat: Added support for opting out endpoint translation (#56)
dzz007 Apr 8, 2021
007cea4
Bump version to 2.8.0 (#57)
jdneo Apr 9, 2021
c5f6b89
Update dependencies (#58)
jdneo Apr 11, 2021
df69a65
fix: update cn domain (#63)
Miloas May 9, 2022
c93564c
build: Fix error dependencies
spgyip Jan 17, 2024
d9aff53
fix(core.js): don't convert searching `keyword` to Number, because of…
spgyip Jan 17, 2024
7d5374c
docs: change package.json and readme informations from skygragon to s…
spgyip Jan 17, 2024
fef6a0a
docs(README): some readme messages
spgyip Jan 17, 2024
ebb1525
feat: Write default urls items to config file. Add a new config item
spgyip Sep 12, 2024
878032a
fix: Fix default plugin source to github/spgyip
spgyip Sep 12, 2024
2340baa
fix: Upgrade package version to v3.1.0
spgyip Sep 12, 2024
294302d
Merge f1/master into dev
dp9u0 Apr 9, 2026
f278ec1
Refactor code structure for improved readability and maintainability
dp9u0 Apr 9, 2026
49f3ead
remove npm package lock
dp9u0 Apr 9, 2026
bae712d
Merge f2/master into dev
dp9u0 Apr 9, 2026
7daf3dc
update lockfile
dp9u0 Apr 9, 2026
56d2ca3
Merge pull request #2 from dp9u0/dev
dp9u0 Apr 9, 2026
2f4078c
添加 lodash 依赖到 package.json 和 pnpm-lock.yaml
dp9u0 Aug 29, 2026
dc7b9ed
cache: add 24h TTL for problems list
dp9u0 Aug 30, 2026
3b34e4d
cache: purge user problem cache on every login method
dp9u0 Aug 30, 2026
11fe5bc
commands: size output columns to data
dp9u0 Aug 30, 2026
ce96e44
leetcode: stop reporting cloudflare 403 as session expired
dp9u0 Aug 30, 2026
95be16f
log: skip null/undefined args instead of crashing on toString
dp9u0 Aug 30, 2026
ee22186
leetcode: fix parseCookie call mismatch and crash on invalid cookie
dp9u0 Aug 30, 2026
750481e
leetcode: query userStatus for name/premium, surface fetch failures
dp9u0 Aug 30, 2026
81df37e
retry: skip auto relogin when no password is saved
dp9u0 Aug 30, 2026
147d748
stat: floor the calendar month label offset for Buffer.write
dp9u0 Aug 30, 2026
18e32b6
show: add -d/--daily for question of the day
dp9u0 Aug 30, 2026
f92a194
show: display official hints, include them in generated files
dp9u0 Aug 30, 2026
af69529
core: accept a full problem url as the keyword
dp9u0 Aug 30, 2026
042d8f5
deps: drop dead packages, modernize the stack
dp9u0 Aug 30, 2026
2d6acd7
deps: replace prompt with a readline-based helper
dp9u0 Aug 30, 2026
841771a
deps: eslint 5 -> 10 with an effective-rules flat config
dp9u0 Aug 30, 2026
4114862
cli: strip -v/-vv before yargs loads
dp9u0 Aug 30, 2026
a299ac3
deps: replace deprecated request with an axios-backed adapter
dp9u0 Aug 30, 2026
4b80105
show: render problem description and hints as plain text
dp9u0 Aug 30, 2026
fea5f5f
leetcode: fetch problem tags for -t filtering
dp9u0 Aug 30, 2026
d9dd335
cli: signal failures through the exit code
dp9u0 Aug 30, 2026
d357627
cache: mark solved problems, fix discuss solution url
dp9u0 Aug 30, 2026
92113ce
misc: drop the dead padLevels warning shim, use pnpm for plugins
dp9u0 Aug 30, 2026
8ffafee
security + sweep: private user.json, dead code, honest messages
dp9u0 Aug 30, 2026
a680c74
ci: lint and test on push via github actions
dp9u0 Aug 30, 2026
a4d2dc2
test: cover the command layer
dp9u0 Aug 30, 2026
35792c7
ci: build standalone binaries and release on main
dp9u0 Aug 30, 2026
ca186f5
Merge pull request #3 from dp9u0/dev
dp9u0 Aug 31, 2026
7766fcb
leetcode.cn: fix daily query, use todayRecord schema
dp9u0 Sep 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .eslintrc.js

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: ci

on:
push:
branches: [main, dev]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [20, 22, 24]
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm test

46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: release

on:
push:
branches: [main]

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- run: pnpm install --frozen-lockfile

- name: build standalone binaries
run: pnpm exec pkg . --out-path dist

- name: checksums
run: |
cd dist
for f in *; do sha256sum "$f" > "$f.sha256"; done

- name: create release
env:
GH_TOKEN: ${{ github.token }}
run: |
TAG="v$(node -p "require('./package.json').version")"
if git ls-remote --exit-code --tags origin "refs/tags/$TAG" > /dev/null; then
echo "tag $TAG already exists, skipping (bump version in package.json for a new release)"
exit 0
fi
gh release create "$TAG" dist/* \
--title "$TAG" \
--generate-notes
11 changes: 11 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.github/
docs/
test/
.eslintrc.js
.gitignore
.travis.yml
Dockerfile
.dockerignore
.nyc_output/
.vscode/
coverage/
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ node_js:
os:
- linux
- osx
- windows

install:
- npm install
Expand Down
30 changes: 30 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/bin/leetcode",
"args": ["show", "1", "--solution"]
},
{
"type": "node",
"request": "launch",
"name": "Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/plugins"
],
"internalConsoleOptions": "openOnSessionStart"
},
]
}
29 changes: 29 additions & 0 deletions 1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* @lc app=leetcode id=1 lang=javascript
*
* [1] Two Sum
*/

// @lc code=start
/**
* @param {number[]} nums
* @param {number} target
* @return {number[]}
*/
var twoSum = function(nums, target) {
let map = {};
for (var index = 0; index < nums.length; index++) {
var element = nums[index];
let rest = target - element;
if (map.hasOwnProperty(rest)) {
return [map[rest], index];
}
map[element] = index;
}
return [-1, -1];
};
/**
// TEST:
console.log(twoSum([2, 9, 4, 5], 7));
*/
// @lc code=end
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
[![npm version](https://img.shields.io/npm/v/leetcode-cli.svg?style=flat)](https://www.npmjs.com/package/leetcode-cli)
[![Releases](https://img.shields.io/github/release/skygragon/leetcode-cli.svg?style=flat)](https://github.com/skygragon/leetcode-cli/releases)
[![license](https://img.shields.io/npm/l/leetcode-cli.svg?style=flat)](https://github.com/skygragon/leetcode-cli/blob/master/LICENSE)
[![Build](https://img.shields.io/travis/skygragon/leetcode-cli.svg?style=flat)](https://travis-ci.org/skygragon/leetcode-cli)
[![Join chat at https://gitter.im/skygragon/leetcode-cli](https://img.shields.io/gitter/room/skygragon/leetcode-cli.svg?style=flat)](https://gitter.im/skygragon/leetcode-cli)
This repository is forked from [skygragon/leetcode-cli](https://github.com/skygragon/leetcode-cli). It seems the source repository is not maintained, I fix some issues here.

- Fix warnings message caused by old dependencies.
- Fix `leetcode show ID` fail.

# leetcode-cli

> Note: This repository is forked from [leetcode-cli](https://github.com/skygragon/leetcode-cli) for temporary usage.
> Note: Copy cookie from webbrowser and Using **leetcode user -c** can temporary fix can't [login problem](https://github.com/jdneo/vscode-leetcode/issues/478).

<img src="https://github.com/skygragon/leetcode-cli/raw/master/docs/logo.png" align="right">

A productive cli tool to enjoy leetcode!
Expand Down Expand Up @@ -35,10 +37,13 @@ Great thanks to leetcode.com, a really awesome website!

## Quick Start

Read help first $ leetcode help
Login with your leetcode account $ leetcode user -l
Browse all questions $ leetcode list
Choose one question $ leetcode show 1 -g -l cpp
Read help first $ leetcode help
Login with your leetcode account $ leetcode user -l
Login with third party account--GitHub $ leetcode user -g
Login with third party account--LinkedIn $ leetcode user -i
Cookie login with cookie $ leetcode user -c
Browse all questions $ leetcode list
Choose one question $ leetcode show 1 -g -l cpp
Coding it!
Run test(s) and pray... $ leetcode test ./two-sum.cpp -t '[3,2,4]\n7'
Submit final solution! $ leetcode submit ./two-sum.cpp
Run test(s) and pray... $ leetcode test ./two-sum.cpp -t '[3,2,4]\n7'
Submit final solution! $ leetcode submit ./two-sum.cpp
1 change: 0 additions & 1 deletion docs/_config.yml

This file was deleted.

Loading
Loading