Skip to content

Commit bb60cce

Browse files
authored
Merge pull request #1 from scarowar/feat/cli
2 parents 8c6983b + 064f75e commit bb60cce

36 files changed

+2664
-213
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var/
2828
*.egg-info/
2929
.installed.cfg
3030
*.egg
31+
.env
3132

3233
# Installer logs
3334
pip-log.txt

.scarleet/lists/blind75.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
[
2+
"the-k-weakest-rows-in-a-matrix",
3+
"number-of-1-bits",
4+
"subsets",
5+
"richest-customer-wealth",
6+
"reverse-linked-list",
7+
"climbing-stairs",
8+
"binary-search",
9+
"longest-substring-without-repeating-characters",
10+
"longest-palindromic-substring",
11+
"squares-of-a-sorted-array",
12+
"majority-element",
13+
"best-time-to-buy-and-sell-stock",
14+
"valid-parentheses",
15+
"valid-anagram",
16+
"invert-binary-tree",
17+
"balanced-binary-tree",
18+
"linked-list-cycle",
19+
"implement-queue-using-stacks",
20+
"first-bad-version",
21+
"ransom-note",
22+
"implement-stack-using-queues",
23+
"maximum-depth-of-binary-tree",
24+
"contains-duplicate",
25+
"middle-of-the-linked-list",
26+
"flood-fill",
27+
"lowest-common-ancestor-of-a-binary-search-tree",
28+
"valid-palindrome",
29+
"two-sum",
30+
"merge-two-sorted-lists",
31+
"diameter-of-binary-tree",
32+
"backspace-string-compare",
33+
"counting-bits",
34+
"missing-number",
35+
"add-binary",
36+
"meeting-rooms",
37+
"roman-to-integer",
38+
"palindrome-linked-list",
39+
"maximum-subarray",
40+
"insert-interval",
41+
"01-matrix",
42+
"k-closest-points-to-origin",
43+
"longest-palindrome",
44+
"3sum",
45+
"binary-tree-level-order-traversal",
46+
"clone-graph",
47+
"evaluate-reverse-polish-notation",
48+
"course-schedule",
49+
"implement-trie-prefix-tree",
50+
"coin-change",
51+
"product-of-array-except-self",
52+
"min-stack",
53+
"validate-binary-search-tree",
54+
"number-of-islands",
55+
"rotting-oranges",
56+
"search-in-rotated-sorted-array",
57+
"combination-sum",
58+
"permutations",
59+
"merge-intervals",
60+
"lowest-common-ancestor-of-a-binary-tree",
61+
"time-based-key-value-store",
62+
"accounts-merge",
63+
"sort-colors",
64+
"word-break",
65+
"partition-equal-subset-sum",
66+
"string-to-integer-atoi",
67+
"spiral-matrix",
68+
"container-with-most-water",
69+
"letter-combinations-of-a-phone-number",
70+
"word-search",
71+
"find-all-anagrams-in-a-string",
72+
"minimum-height-trees",
73+
"task-scheduler",
74+
"lru-cache",
75+
"top-k-frequent-elements",
76+
"group-anagrams"
77+
]

.scarleet/lists/neetcode150.json

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
[
2+
"contains-duplicate",
3+
"valid-anagram",
4+
"two-sum",
5+
"group-anagrams",
6+
"top-k-frequent-elements",
7+
"product-of-array-except-self",
8+
"valid-sudoku",
9+
"encode-and-decode-strings",
10+
"longest-consecutive-sequence",
11+
"valid-palindrome",
12+
"two-sum-ii-input-array-is-sorted",
13+
"3sum",
14+
"container-with-most-water",
15+
"trapping-rain-water",
16+
"best-time-to-buy-and-sell-stock",
17+
"longest-substring-without-repeating-characters",
18+
"longest-repeating-character-replacement",
19+
"permutation-in-string",
20+
"minimum-window-substring",
21+
"sliding-window-maximum",
22+
"valid-parentheses",
23+
"min-stack",
24+
"evaluate-reverse-polish-notation",
25+
"generate-parentheses",
26+
"daily-temperatures",
27+
"car-fleet",
28+
"largest-rectangle-in-histogram",
29+
"binary-search",
30+
"search-a-2d-matrix",
31+
"koko-eating-bananas",
32+
"find-minimum-in-rotated-sorted-array",
33+
"search-in-rotated-sorted-array",
34+
"time-based-key-value-store",
35+
"median-of-two-sorted-arrays",
36+
"reverse-linked-list",
37+
"merge-two-sorted-lists",
38+
"reorder-list",
39+
"remove-nth-node-from-end-of-list",
40+
"copy-list-with-random-pointer",
41+
"add-two-numbers",
42+
"linked-list-cycle",
43+
"find-the-duplicate-number",
44+
"lru-cache",
45+
"merge-k-sorted-lists",
46+
"reverse-nodes-in-k-group",
47+
"invert-binary-tree",
48+
"maximum-depth-of-binary-tree",
49+
"diameter-of-binary-tree",
50+
"balanced-binary-tree",
51+
"same-tree",
52+
"subtree-of-another-tree",
53+
"lowest-common-ancestor-of-a-binary-search-tree",
54+
"binary-tree-level-order-traversal",
55+
"binary-tree-right-side-view",
56+
"count-good-nodes-in-binary-tree",
57+
"validate-binary-search-tree",
58+
"kth-smallest-element-in-a-bst",
59+
"construct-binary-tree-from-preorder-and-inorder-traversal",
60+
"binary-tree-maximum-path-sum",
61+
"serialize-and-deserialize-binary-tree",
62+
"implement-trie-prefix-tree",
63+
"design-add-and-search-words-data-structure",
64+
"word-search-ii",
65+
"find-median-from-data-stream",
66+
"k-closest-points-to-origin",
67+
"last-stone-weight",
68+
"kth-largest-element-in-a-stream",
69+
"kth-largest-element-in-an-array",
70+
"task-scheduler",
71+
"design-twitter",
72+
"subsets",
73+
"combination-sum",
74+
"permutations",
75+
"subsets-ii",
76+
"combination-sum-ii",
77+
"word-search",
78+
"palindrome-partitioning",
79+
"letter-combinations-of-a-phone-number",
80+
"n-queens",
81+
"number-of-islands",
82+
"max-area-of-island",
83+
"clone-graph",
84+
"walls-and-gates",
85+
"rotting-oranges",
86+
"pacific-atlantic-water-flow",
87+
"surrounded-regions",
88+
"course-schedule",
89+
"course-schedule-ii",
90+
"graph-valid-tree",
91+
"number-of-connected-components-in-an-undirected-graph",
92+
"redundant-connection",
93+
"word-ladder",
94+
"reconstruct-itinerary",
95+
"min-cost-to-connect-all-points",
96+
"network-delay-time",
97+
"swim-in-rising-water",
98+
"alien-dictionary",
99+
"cheapest-flights-within-k-stops",
100+
"climbing-stairs",
101+
"min-cost-climbing-stairs",
102+
"house-robber",
103+
"house-robber-ii",
104+
"longest-palindromic-substring",
105+
"palindromic-substrings",
106+
"decode-ways",
107+
"coin-change",
108+
"maximum-product-subarray",
109+
"word-break",
110+
"longest-increasing-subsequence",
111+
"partition-equal-subset-sum",
112+
"unique-paths",
113+
"longest-common-subsequence",
114+
"best-time-to-buy-and-sell-stock-with-cooldown",
115+
"coin-change-ii",
116+
"target-sum",
117+
"interleaving-string",
118+
"longest-increasing-path-in-a-matrix",
119+
"distinct-subsequences",
120+
"edit-distance",
121+
"burst-balloons",
122+
"partition-to-k-equal-sum-subsets",
123+
"maximum-subarray",
124+
"jump-game",
125+
"jump-game-ii",
126+
"gas-station",
127+
"hand-of-straights",
128+
"merge-triplets-to-form-target-triplet",
129+
"partition-labels",
130+
"valid-parenthesis-string",
131+
"insert-interval",
132+
"merge-intervals",
133+
"non-overlapping-intervals",
134+
"meeting-rooms",
135+
"meeting-rooms-ii",
136+
"minimum-interval-to-include-each-query",
137+
"rotate-image",
138+
"spiral-matrix",
139+
"set-matrix-zeroes",
140+
"happy-number",
141+
"plus-one",
142+
"powx-n",
143+
"multiply-strings",
144+
"detect-squares",
145+
"single-number",
146+
"number-of-1-bits",
147+
"counting-bits",
148+
"reverse-bits",
149+
"missing-number",
150+
"sum-of-two-integers",
151+
"reverse-integer"
152+
]

INSTALL.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Scarleet CLI Installation (Local, Editable)
2+
3+
You can install Scarleet as a CLI tool locally, so you can run `scarleet` from anywhere on your system.
4+
5+
## 1. Install in Editable Mode
6+
7+
From the root of your project, run:
8+
9+
```sh
10+
pip install --editable .
11+
```
12+
13+
This will make the `scarleet` command available globally (in your environment).
14+
15+
## 2. Install dependencies
16+
17+
You can install all required dependencies for Scarleet using either:
18+
19+
```sh
20+
pip install -r requirements.txt
21+
```
22+
23+
or, for modern Python packaging:
24+
25+
```sh
26+
pip install .
27+
```
28+
29+
Both methods will set up everything needed for the CLI.
30+
31+
## 3. Usage
32+
33+
After installation, you can run:
34+
35+
```sh
36+
scarleet --help
37+
```
38+
39+
or any subcommand, e.g.:
40+
41+
```sh
42+
scarleet new <problem-slug>
43+
scarleet setup
44+
scarleet docgen <problem-slug>
45+
scarleet flashcards <problem-slug>
46+
scarleet status
47+
```
48+
49+
## 4. Uninstall
50+
51+
To remove the CLI:
52+
53+
```sh
54+
pip uninstall scarleet
55+
```
56+
57+
---
58+
59+
**Note:** This does not publish your package to PyPI. It only makes it available on your local machine for development and use.
60+
61+
62+
## OpenAI or Azure OpenAI Usage (Optional)
63+
64+
Scarleet can use either OpenAI or Azure OpenAI models for flashcard and docgen generation. Set the following environment variables in a `.env` file (recommended, and git-ignored):
65+
66+
### For OpenAI:
67+
```
68+
OPENAI_API_KEY=sk-...your-key...
69+
OPENAI_API_URL=https://api.openai.com/v1
70+
OPENAI_MODEL=gpt-4o
71+
OPENAI_API_VERSION=2024-06-01
72+
```
73+
74+
### For Azure OpenAI:
75+
```
76+
AZURE_API_KEY=your-azure-key
77+
AZURE_API_BASE=https://your-resource.openai.azure.com
78+
AZURE_DEPLOYMENT_NAME=your-deployment
79+
AZURE_API_VERSION=2024-06-01
80+
```
81+
82+
- Scarleet will auto-detect which provider to use based on your `.env`.
83+
- If neither is set, Scarleet will use your local SLM endpoint as a fallback.
84+
- Install dependencies for .env support:
85+
```sh
86+
pip install python-dotenv
87+
```
88+
- The `openai` Python package is required (see `requirements.txt`).
89+
90+
**Never commit your `.env` file or API keys to version control.**
91+
92+
---

0 commit comments

Comments
 (0)