You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a file named `.lcconfig` in your home directory.
263
-
264
-
*Example*
265
-
266
-
{
267
-
"LANG": "java",
268
-
"USE_COLOR": true,
269
-
"AUTO_LOGIN": false
270
-
}
271
-
272
-
### Auto login
273
-
274
-
Leetcode.com is restricting one session only in the same time, which means if you have login same account otherwhere, the existing login session will be expired immediately. This will greatly harm your experience since you have to re-login again and again among different sessions.
275
-
276
-
However leetcode-cli will help some one this.It will try to save you from this trial and re-login transparently without interrupting your current work whenever it notices the session is already expired. To enable this in your config:
277
-
278
-
"AUTO_LOGIN": true
279
-
280
-
**NOTE: if enabled, your PASSWORD will be persisted locally to achieve auto login, so PLEASE be careful to ONLY enable this on your OWN computer for the sake of security!**
**NOTE: it might become slower in bash with this enabled, personally I would NOT suggest to use it...**
22
+
23
+
## Colorful Output
24
+
25
+
*`--color` to enable color.
26
+
*`--no-color` to disable it.
27
+
28
+
Or use configuration setting to avoid typing it repeatedly, see [below](#configuration).
29
+
30
+
## Configuration
31
+
32
+
Create a JSON file named `.lcconfig` in your home directory, e.g.
33
+
34
+
$ cat ~/.lcconfig
35
+
36
+
{
37
+
"LANG": "java",
38
+
"USE_COLOR": true,
39
+
"AUTO_LOGIN": false
40
+
}
41
+
42
+
Here are some useful settings:
43
+
44
+
*`AUTO_LOGIN` to enable auto login feature, see [below](#auto-login)
45
+
*`LANG` to set default language in coding.
46
+
*`USE_COLOR` to set colorful output or not by default.
47
+
48
+
## Cache
49
+
50
+
The local cache folder (`.lc/`) is in your home directory, e.g.
51
+
52
+
$ ls -a1 ~/.lc/
53
+
54
+
.user.json # user info
55
+
all.json # problems list
56
+
two-sum.json # specific problem info
57
+
58
+
59
+
## Auto login
60
+
61
+
Leetcode.com is restricting only one session alive in the same time, which means if you login same account otherwhere, the existing login session will be expired immediately. This will greatly harm your experience since you have to re-login again and again among different sessions.
62
+
63
+
The good news is leetcode-cli will help a lot on this by trying re-login transparently and automatically without interrupting your current work whenever it detects your current session is expired. To enable this feature you could add following in your config then login again:
64
+
65
+
"AUTO_LOGIN": true
66
+
67
+
**NOTE: once enabled, your PASSWORD will be persisted locally for further using, so PLEASE be careful to ONLY enable this on your OWN computer for the sake of security!**
0 commit comments