@udondan/duolingo 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +215 -12
- package/dist/cli/config-file.d.ts +22 -0
- package/dist/cli/config-file.d.ts.map +1 -0
- package/dist/cli/config-file.js +68 -0
- package/dist/cli/config-file.js.map +1 -0
- package/dist/cli/program.d.ts +25 -0
- package/dist/cli/program.d.ts.map +1 -0
- package/dist/cli/program.js +187 -0
- package/dist/cli/program.js.map +1 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +8 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/mcp.d.ts +14 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +38 -0
- package/dist/mcp.js.map +1 -0
- package/dist/tools/account.d.ts.map +1 -1
- package/dist/tools/account.js +28 -621
- package/dist/tools/account.js.map +1 -1
- package/dist/tools/helpers.d.ts +11 -7
- package/dist/tools/helpers.d.ts.map +1 -1
- package/dist/tools/helpers.js +19 -50
- package/dist/tools/helpers.js.map +1 -1
- package/dist/tools/language.d.ts.map +1 -1
- package/dist/tools/language.js +63 -552
- package/dist/tools/language.js.map +1 -1
- package/dist/tools/shop.d.ts.map +1 -1
- package/dist/tools/shop.js +6 -93
- package/dist/tools/shop.js.map +1 -1
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -0
- package/dist/views/account.d.ts +32 -0
- package/dist/views/account.d.ts.map +1 -0
- package/dist/views/account.js +393 -0
- package/dist/views/account.js.map +1 -0
- package/dist/views/language.d.ts +38 -0
- package/dist/views/language.d.ts.map +1 -0
- package/dist/views/language.js +269 -0
- package/dist/views/language.js.map +1 -0
- package/dist/views/utils.d.ts +13 -0
- package/dist/views/utils.d.ts.map +1 -0
- package/dist/views/utils.js +30 -0
- package/dist/views/utils.js.map +1 -0
- package/dist/views/view.d.ts +34 -0
- package/dist/views/view.d.ts.map +1 -0
- package/dist/views/view.js +34 -0
- package/dist/views/view.js.map +1 -0
- package/package.json +20 -19
- package/dist/server.d.ts +0 -19
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -40
- package/dist/server.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# @udondan/duolingo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@udondan/duolingo)
|
|
4
|
+
[](https://hub.docker.com/r/udondan/duolingo)
|
|
5
|
+
[](https://www.npmjs.com/package/@udondan/duolingo)
|
|
6
|
+
[](https://github.com/udondan/duolingo/actions/workflows/ci.yml)
|
|
7
|
+
[](https://codecov.io/gh/udondan/duolingo)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
|
|
10
|
+
A TypeScript package that provides a **Duolingo API client library**, a
|
|
11
|
+
**command line interface** (`duolingo`) and an
|
|
4
12
|
**[MCP](https://modelcontextprotocol.io) server** for LLM agents (e.g. Claude).
|
|
5
13
|
|
|
6
14
|
Built natively in TypeScript against the unofficial Duolingo REST API — no third-party
|
|
@@ -9,10 +17,16 @@ Duolingo library dependency.
|
|
|
9
17
|
## Table of Contents
|
|
10
18
|
|
|
11
19
|
- [Getting Your JWT Token](#getting-your-jwt-token)
|
|
20
|
+
- [CLI](#cli)
|
|
21
|
+
- [Installation](#cli-installation)
|
|
22
|
+
- [Credentials](#credentials)
|
|
23
|
+
- [Commands](#commands)
|
|
24
|
+
- [With Docker](#with-docker)
|
|
12
25
|
- [MCP Server](#mcp-server)
|
|
13
26
|
- [Installation](#mcp-installation)
|
|
14
27
|
- [Claude Desktop](#claude-desktop)
|
|
15
28
|
- [Claude Code](#claude-code)
|
|
29
|
+
- [Docker MCP Toolkit](#docker-mcp-toolkit)
|
|
16
30
|
- [Available Tools](#available-tools)
|
|
17
31
|
- [Library](#library)
|
|
18
32
|
- [Installation](#library-installation)
|
|
@@ -24,7 +38,7 @@ Duolingo library dependency.
|
|
|
24
38
|
|
|
25
39
|
## Getting Your JWT Token
|
|
26
40
|
|
|
27
|
-
|
|
41
|
+
The CLI, the MCP server and the library all require a Duolingo JWT token for authentication.
|
|
28
42
|
|
|
29
43
|
1. Log in to [duolingo.com](https://www.duolingo.com) in your browser.
|
|
30
44
|
2. Open the browser developer console (F12 → Console tab).
|
|
@@ -38,6 +52,103 @@ Both the MCP server and the library require a Duolingo JWT token for authenticat
|
|
|
38
52
|
|
|
39
53
|
---
|
|
40
54
|
|
|
55
|
+
## CLI
|
|
56
|
+
|
|
57
|
+
### CLI Installation
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm install -g @udondan/duolingo
|
|
61
|
+
duolingo --help
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Or run it without installing: `npx -y @udondan/duolingo --help`.
|
|
65
|
+
|
|
66
|
+
The CLI and the MCP server are also available as the Docker image
|
|
67
|
+
[`udondan/duolingo`](https://hub.docker.com/r/udondan/duolingo) (amd64 and
|
|
68
|
+
arm64), no Node.js needed. See [With Docker](#with-docker).
|
|
69
|
+
|
|
70
|
+
### Credentials
|
|
71
|
+
|
|
72
|
+
The CLI reads `DUOLINGO_USERNAME` and `DUOLINGO_JWT` from the environment. You
|
|
73
|
+
can also put them in `~/.config/duolingo/config`:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
mkdir -p ~/.config/duolingo
|
|
77
|
+
cat > ~/.config/duolingo/config <<'EOF'
|
|
78
|
+
DUOLINGO_USERNAME=your_username
|
|
79
|
+
DUOLINGO_JWT=your_jwt_token
|
|
80
|
+
EOF
|
|
81
|
+
chmod 0600 ~/.config/duolingo/config
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The file is only read when no other user can access it (mode `0600`).
|
|
85
|
+
Environment variables take precedence over the file.
|
|
86
|
+
|
|
87
|
+
### Commands
|
|
88
|
+
|
|
89
|
+
Output is JSON by default. Use `--format markdown` (or `-f markdown`) for the
|
|
90
|
+
same readable text the MCP tools return.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
duolingo streak
|
|
94
|
+
duolingo --format markdown progress es
|
|
95
|
+
duolingo known-words fr --username someone
|
|
96
|
+
duolingo leaderboard --unit month
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
| Command | Description |
|
|
100
|
+
|---------|-------------|
|
|
101
|
+
| `user [-u name]` | Profile: name, bio, location, followers, languages |
|
|
102
|
+
| `settings` | Account settings |
|
|
103
|
+
| `streak [-u name]` | Current streak, daily goal and longest streak |
|
|
104
|
+
| `xp` | XP earned and lessons completed today |
|
|
105
|
+
| `languages [-u name] [-a]` | Languages being learned (`-a` for abbreviations) |
|
|
106
|
+
| `courses [-u name]` | All courses, including Math, Chess and Music |
|
|
107
|
+
| `friends` | Users the authenticated user follows |
|
|
108
|
+
| `calendar [-u name]` | Recent activity of the current course |
|
|
109
|
+
| `leaderboard [--unit week\|month]` | Friends ranked by XP |
|
|
110
|
+
| `shop` | Shop items and prices |
|
|
111
|
+
| `health` | Hearts and refill status |
|
|
112
|
+
| `currencies` | Gem and lingot balances |
|
|
113
|
+
| `streak-goal` | Current streak goal and checkpoints |
|
|
114
|
+
| `language <name> [-u name]` | Level, points and streak of a language (e.g. `French`) |
|
|
115
|
+
| `progress <abbr>` | Detailed progress in a language (e.g. `fr`) |
|
|
116
|
+
| `known-topics <abbr> [-u name]` | Learned topics |
|
|
117
|
+
| `unknown-topics <abbr> [-u name]` | Topics not learned yet |
|
|
118
|
+
| `golden-topics <abbr> [-u name]` | Fully mastered topics |
|
|
119
|
+
| `reviewable-topics <abbr> [-u name]` | Learned topics that need review |
|
|
120
|
+
| `known-words <abbr> [-u name]` | Words learned |
|
|
121
|
+
| `learned-skills <abbr> [-u name]` | Learned skills in learning order |
|
|
122
|
+
| `voices [abbr]` | Text-to-speech voices |
|
|
123
|
+
| `audio-url <word> [abbr] [--voice v] [--no-random]` | Pronunciation audio URL |
|
|
124
|
+
| `language-name <abbr> [-u name]` | Full name of a language (`fr` → `French`) |
|
|
125
|
+
| `abbreviation <name> [-u name]` | Abbreviation of a language (`French` → `fr`) |
|
|
126
|
+
| `mcp` | Start the MCP server (stdio) |
|
|
127
|
+
|
|
128
|
+
Errors go to stderr and the CLI exits with code 1.
|
|
129
|
+
|
|
130
|
+
### With Docker
|
|
131
|
+
|
|
132
|
+
Arguments after the image name are passed to the CLI. `-e NAME` without a
|
|
133
|
+
value takes the variable from your shell:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
docker run --rm -e DUOLINGO_USERNAME -e DUOLINGO_JWT udondan/duolingo streak
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
As an alias, the image behaves like an installed `duolingo`:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
alias duolingo='docker run --rm -e DUOLINGO_USERNAME -e DUOLINGO_JWT udondan/duolingo'
|
|
143
|
+
|
|
144
|
+
duolingo --format markdown progress es
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The config file `~/.config/duolingo/config` is not visible inside the
|
|
148
|
+
container, so pass the credentials as environment variables.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
41
152
|
## MCP Server
|
|
42
153
|
|
|
43
154
|
### MCP Installation
|
|
@@ -45,23 +156,32 @@ Both the MCP server and the library require a Duolingo JWT token for authenticat
|
|
|
45
156
|
**Option A — run directly with npx (no install needed):**
|
|
46
157
|
|
|
47
158
|
```bash
|
|
48
|
-
DUOLINGO_USERNAME=your_username DUOLINGO_JWT=your_jwt npx @udondan/duolingo
|
|
159
|
+
DUOLINGO_USERNAME=your_username DUOLINGO_JWT=your_jwt npx -y @udondan/duolingo mcp
|
|
49
160
|
```
|
|
50
161
|
|
|
51
162
|
**Option B — install globally:**
|
|
52
163
|
|
|
53
164
|
```bash
|
|
54
165
|
npm install -g @udondan/duolingo
|
|
55
|
-
DUOLINGO_USERNAME=your_username DUOLINGO_JWT=your_jwt duolingo
|
|
166
|
+
DUOLINGO_USERNAME=your_username DUOLINGO_JWT=your_jwt duolingo mcp
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Option C — run the Docker image:**
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
docker run --rm -i -e DUOLINGO_USERNAME -e DUOLINGO_JWT udondan/duolingo
|
|
56
173
|
```
|
|
57
174
|
|
|
58
|
-
|
|
175
|
+
Without arguments, the image starts the MCP server. `-i` keeps stdin open,
|
|
176
|
+
which the server uses to talk to the client.
|
|
177
|
+
|
|
178
|
+
**Option D — clone and build from source:**
|
|
59
179
|
|
|
60
180
|
```bash
|
|
61
181
|
git clone https://github.com/udondan/duolingo.git
|
|
62
182
|
cd duolingo
|
|
63
183
|
npm install && npm run build
|
|
64
|
-
node dist/
|
|
184
|
+
node dist/cli.js mcp
|
|
65
185
|
```
|
|
66
186
|
|
|
67
187
|
### Claude Desktop
|
|
@@ -73,7 +193,34 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
|
73
193
|
"mcpServers": {
|
|
74
194
|
"duolingo": {
|
|
75
195
|
"command": "npx",
|
|
76
|
-
"args": ["-y", "@udondan/duolingo"],
|
|
196
|
+
"args": ["-y", "@udondan/duolingo", "mcp"],
|
|
197
|
+
"env": {
|
|
198
|
+
"DUOLINGO_USERNAME": "your_username",
|
|
199
|
+
"DUOLINGO_JWT": "your_jwt_token"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
With Docker instead of `npx`, the entry looks like this. `-e NAME` without a
|
|
207
|
+
value passes the variable from `env` to the container:
|
|
208
|
+
|
|
209
|
+
```json
|
|
210
|
+
{
|
|
211
|
+
"mcpServers": {
|
|
212
|
+
"duolingo": {
|
|
213
|
+
"command": "docker",
|
|
214
|
+
"args": [
|
|
215
|
+
"run",
|
|
216
|
+
"--rm",
|
|
217
|
+
"-i",
|
|
218
|
+
"-e",
|
|
219
|
+
"DUOLINGO_USERNAME",
|
|
220
|
+
"-e",
|
|
221
|
+
"DUOLINGO_JWT",
|
|
222
|
+
"udondan/duolingo"
|
|
223
|
+
],
|
|
77
224
|
"env": {
|
|
78
225
|
"DUOLINGO_USERNAME": "your_username",
|
|
79
226
|
"DUOLINGO_JWT": "your_jwt_token"
|
|
@@ -86,7 +233,7 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
|
86
233
|
### Claude Code
|
|
87
234
|
|
|
88
235
|
```bash
|
|
89
|
-
claude mcp add duolingo -- npx -y @udondan/duolingo
|
|
236
|
+
claude mcp add duolingo -- npx -y @udondan/duolingo mcp
|
|
90
237
|
```
|
|
91
238
|
|
|
92
239
|
Then set the environment variables before starting Claude Code:
|
|
@@ -96,6 +243,52 @@ export DUOLINGO_USERNAME="your_username"
|
|
|
96
243
|
export DUOLINGO_JWT="your_jwt_token"
|
|
97
244
|
```
|
|
98
245
|
|
|
246
|
+
### Docker MCP Toolkit
|
|
247
|
+
|
|
248
|
+
With the [Docker MCP Toolkit](https://docs.docker.com/ai/mcp-catalog-and-toolkit/toolkit/)
|
|
249
|
+
of Docker Desktop, the server runs as a container behind the MCP Gateway. The
|
|
250
|
+
gateway starts the container on demand and passes its tools on to the connected
|
|
251
|
+
clients. The credentials are stored as secrets in Docker Desktop instead of in
|
|
252
|
+
plain text in the client configuration.
|
|
253
|
+
|
|
254
|
+
Requires Docker Desktop with the MCP Toolkit enabled.
|
|
255
|
+
|
|
256
|
+
1. Download the server definition [`docker-mcp.yml`](docker-mcp.yml) and add it
|
|
257
|
+
to a Toolkit profile. The Toolkit only reads such files from its catalogs
|
|
258
|
+
directory:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
mkdir -p ~/.docker/mcp/catalogs
|
|
262
|
+
curl -fsSL https://raw.githubusercontent.com/udondan/duolingo/main/docker-mcp.yml -o ~/.docker/mcp/catalogs/duolingo.yml
|
|
263
|
+
|
|
264
|
+
# new profile "duolingo" ...
|
|
265
|
+
docker mcp profile create --name duolingo --id duolingo --server "file://$HOME/.docker/mcp/catalogs/duolingo.yml"
|
|
266
|
+
# ... or add it to an existing profile
|
|
267
|
+
docker mcp profile server add default --server "file://$HOME/.docker/mcp/catalogs/duolingo.yml"
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
The profile keeps the image at the version it had when it was added. Run
|
|
271
|
+
`profile server add` again to update.
|
|
272
|
+
|
|
273
|
+
2. Store the credentials as secrets (see [Getting Your JWT Token](#getting-your-jwt-token)):
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
docker mcp secret set duolingo.username=your_username
|
|
277
|
+
docker mcp secret set duolingo.jwt=your_jwt_token
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
3. Connect a client to the profile:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
docker mcp client connect claude-desktop --profile duolingo
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
`docker mcp client connect --help` lists more clients such as `claude-code`,
|
|
287
|
+
`cursor` or `vscode`. This also works in Docker Desktop under _MCP Toolkit_.
|
|
288
|
+
|
|
289
|
+
`docker mcp gateway run --profile duolingo --dry-run --verbose` checks the setup
|
|
290
|
+
without starting a client. The output should end with `duolingo: (N tools)`.
|
|
291
|
+
|
|
99
292
|
### Available Tools
|
|
100
293
|
|
|
101
294
|
All tools are **read-only** — the server never modifies your Duolingo account.
|
|
@@ -343,15 +536,25 @@ npm run dev
|
|
|
343
536
|
```
|
|
344
537
|
src/
|
|
345
538
|
├── index.ts # Library entry point — exports client, types, errors
|
|
346
|
-
├──
|
|
539
|
+
├── cli.ts # `duolingo` binary
|
|
540
|
+
├── mcp.ts # MCP server (stdio transport), started by `duolingo mcp`
|
|
541
|
+
├── version.ts # Package version
|
|
542
|
+
├── cli/
|
|
543
|
+
│ ├── program.ts # CLI commands (commander)
|
|
544
|
+
│ └── config-file.ts # ~/.config/duolingo/config loader
|
|
347
545
|
├── client/
|
|
348
546
|
│ ├── duolingo.ts # DuolingoClient — all API methods
|
|
349
547
|
│ ├── types.ts # TypeScript interfaces for all API responses
|
|
350
548
|
│ └── errors.ts # Custom error classes
|
|
549
|
+
├── views/
|
|
550
|
+
│ ├── account.ts # Account queries: data + markdown
|
|
551
|
+
│ ├── language.ts # Language queries: data + markdown
|
|
552
|
+
│ ├── utils.ts # Language name/abbreviation lookups
|
|
553
|
+
│ └── view.ts # View type and rendering
|
|
351
554
|
└── tools/
|
|
352
|
-
├── account.ts # Account tools
|
|
353
|
-
├── language.ts # Language tools
|
|
354
|
-
├── shop.ts # Utility tools
|
|
555
|
+
├── account.ts # Account tools
|
|
556
|
+
├── language.ts # Language tools
|
|
557
|
+
├── shop.ts # Utility tools
|
|
355
558
|
└── helpers.ts # Shared utilities (error handling, Zod schemas)
|
|
356
559
|
```
|
|
357
560
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config file loader for the Duolingo CLI.
|
|
3
|
+
*
|
|
4
|
+
* Reads ~/.config/duolingo/config (or the path given) and applies any
|
|
5
|
+
* KEY=VALUE entries to process.env, but only when the variable is not
|
|
6
|
+
* already set. Environment variables always take precedence.
|
|
7
|
+
*
|
|
8
|
+
* File format:
|
|
9
|
+
* # comment
|
|
10
|
+
* DUOLINGO_USERNAME=your_username
|
|
11
|
+
* DUOLINGO_JWT=your_jwt
|
|
12
|
+
*
|
|
13
|
+
* The file holds secrets, so it is only read when nobody but its owner can
|
|
14
|
+
* access it (e.g. mode 0600).
|
|
15
|
+
*/
|
|
16
|
+
export declare function defaultConfigFilePath(): string;
|
|
17
|
+
/**
|
|
18
|
+
* Load the config file and apply entries to process.env.
|
|
19
|
+
* Values already present in the environment are not overwritten.
|
|
20
|
+
*/
|
|
21
|
+
export declare function loadConfigFile(path?: string): void;
|
|
22
|
+
//# sourceMappingURL=config-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-file.d.ts","sourceRoot":"","sources":["../../src/cli/config-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAQD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,SAA0B,GAAG,IAAI,CA0CnE"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config file loader for the Duolingo CLI.
|
|
3
|
+
*
|
|
4
|
+
* Reads ~/.config/duolingo/config (or the path given) and applies any
|
|
5
|
+
* KEY=VALUE entries to process.env, but only when the variable is not
|
|
6
|
+
* already set. Environment variables always take precedence.
|
|
7
|
+
*
|
|
8
|
+
* File format:
|
|
9
|
+
* # comment
|
|
10
|
+
* DUOLINGO_USERNAME=your_username
|
|
11
|
+
* DUOLINGO_JWT=your_jwt
|
|
12
|
+
*
|
|
13
|
+
* The file holds secrets, so it is only read when nobody but its owner can
|
|
14
|
+
* access it (e.g. mode 0600).
|
|
15
|
+
*/
|
|
16
|
+
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
17
|
+
import { homedir } from 'node:os';
|
|
18
|
+
import { join } from 'node:path';
|
|
19
|
+
export function defaultConfigFilePath() {
|
|
20
|
+
return join(homedir(), '.config', 'duolingo', 'config');
|
|
21
|
+
}
|
|
22
|
+
function warn(message) {
|
|
23
|
+
process.stderr.write(`[duolingo] Warning: ${message}\n`);
|
|
24
|
+
}
|
|
25
|
+
const UNSAFE_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
|
|
26
|
+
/**
|
|
27
|
+
* Load the config file and apply entries to process.env.
|
|
28
|
+
* Values already present in the environment are not overwritten.
|
|
29
|
+
*/
|
|
30
|
+
export function loadConfigFile(path = defaultConfigFilePath()) {
|
|
31
|
+
if (!existsSync(path))
|
|
32
|
+
return;
|
|
33
|
+
let content;
|
|
34
|
+
try {
|
|
35
|
+
const stat = statSync(path);
|
|
36
|
+
if (!stat.isFile()) {
|
|
37
|
+
warn(`refusing to load config file ${path} because it is not a file.`);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (process.platform !== 'win32' && stat.mode & 0o077) {
|
|
41
|
+
const mode = (stat.mode & 0o777).toString(8);
|
|
42
|
+
warn(`refusing to load config file ${path} because other users can access it (mode ${mode}). Run: chmod 0600 "${path}"`);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
content = readFileSync(path, 'utf8');
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
// fs always throws Error objects
|
|
49
|
+
warn(`unable to read config file ${path}: ${error.message}`);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
for (const raw of content.split('\n')) {
|
|
53
|
+
const line = raw.trim();
|
|
54
|
+
if (!line || line.startsWith('#'))
|
|
55
|
+
continue;
|
|
56
|
+
const eq = line.indexOf('=');
|
|
57
|
+
if (eq < 1)
|
|
58
|
+
continue;
|
|
59
|
+
const key = line.slice(0, eq).trim();
|
|
60
|
+
const value = line.slice(eq + 1).trim();
|
|
61
|
+
if (!UNSAFE_KEYS.has(key) &&
|
|
62
|
+
/^[A-Z_][A-Z0-9_]*$/i.test(key) &&
|
|
63
|
+
!Object.hasOwn(process.env, key)) {
|
|
64
|
+
process.env[key] = value;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=config-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-file.js","sourceRoot":"","sources":["../../src/cli/config-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,qBAAqB;IACnC,OAAO,IAAI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;QACtC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QAE5C,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,EAAE,GAAG,CAAC;YAAE,SAAS;QAErB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAExC,IACE,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC;YACrB,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC;YAC/B,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,EAChC,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC3B,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `duolingo` command line interface.
|
|
3
|
+
*
|
|
4
|
+
* Prints JSON by default (`--format markdown` for readable text) and shares
|
|
5
|
+
* its queries with the MCP tools. `duolingo mcp` starts the MCP server.
|
|
6
|
+
*
|
|
7
|
+
* Credentials come from DUOLINGO_USERNAME and DUOLINGO_JWT, or from the
|
|
8
|
+
* config file ~/.config/duolingo/config (environment variables win).
|
|
9
|
+
*/
|
|
10
|
+
import { Command } from 'commander';
|
|
11
|
+
import { type ResponseFormat, type View } from '../views/view.js';
|
|
12
|
+
export interface CliOptions {
|
|
13
|
+
/** Config file to load; defaults to ~/.config/duolingo/config. */
|
|
14
|
+
configFile?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Render a view for the terminal. JSON always prints the data, markdown the
|
|
18
|
+
* rendered text. A view without data means nothing was found: an error.
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatView(view: View, format: ResponseFormat): string;
|
|
21
|
+
/** Build the CLI. It throws instead of exiting, see `main`. */
|
|
22
|
+
export declare function buildProgram(options?: CliOptions): Command;
|
|
23
|
+
/** Run the CLI with the given arguments. Returns the exit code. */
|
|
24
|
+
export declare function main(argv: string[], options?: CliOptions): Promise<number>;
|
|
25
|
+
//# sourceMappingURL=program.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAA0B,MAAM,WAAW,CAAC;AAkC5D,OAAO,EAAU,KAAK,cAAc,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG1E,MAAM,WAAW,UAAU;IACzB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAMD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,GAAG,MAAM,CAMrE;AAED,+DAA+D;AAC/D,wBAAgB,YAAY,CAAC,OAAO,GAAE,UAAe,GAAG,OAAO,CA4M9D;AAED,mEAAmE;AACnE,wBAAsB,IAAI,CACxB,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAUjB"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `duolingo` command line interface.
|
|
3
|
+
*
|
|
4
|
+
* Prints JSON by default (`--format markdown` for readable text) and shares
|
|
5
|
+
* its queries with the MCP tools. `duolingo mcp` starts the MCP server.
|
|
6
|
+
*
|
|
7
|
+
* Credentials come from DUOLINGO_USERNAME and DUOLINGO_JWT, or from the
|
|
8
|
+
* config file ~/.config/duolingo/config (environment variables win).
|
|
9
|
+
*/
|
|
10
|
+
import { Command, CommanderError, Option } from 'commander';
|
|
11
|
+
import { DuolingoNotFoundError } from '../client/errors.js';
|
|
12
|
+
import { startMcpServer } from '../mcp.js';
|
|
13
|
+
import { handleError } from '../tools/helpers.js';
|
|
14
|
+
import { version } from '../version.js';
|
|
15
|
+
import { calendarView, coursesView, currenciesView, dailyXpProgressView, friendsView, healthView, languagesView, leaderboardView, settingsView, shopItemsView, streakGoalView, streakInfoView, userInfoView, } from '../views/account.js';
|
|
16
|
+
import { audioUrlView, goldenTopicsView, knownTopicsView, knownWordsView, languageDetailsView, languageProgressView, languageVoicesView, learnedSkillsView, reviewableTopicsView, unknownTopicsView, } from '../views/language.js';
|
|
17
|
+
import { abbreviationOfView, languageFromAbbrView } from '../views/utils.js';
|
|
18
|
+
import { toJson } from '../views/view.js';
|
|
19
|
+
import { loadConfigFile } from './config-file.js';
|
|
20
|
+
/**
|
|
21
|
+
* Render a view for the terminal. JSON always prints the data, markdown the
|
|
22
|
+
* rendered text. A view without data means nothing was found: an error.
|
|
23
|
+
*/
|
|
24
|
+
export function formatView(view, format) {
|
|
25
|
+
if (view.data === undefined) {
|
|
26
|
+
throw new DuolingoNotFoundError(String(view.message));
|
|
27
|
+
}
|
|
28
|
+
if (format === 'json')
|
|
29
|
+
return toJson(view.data);
|
|
30
|
+
return view.message ?? view.markdown();
|
|
31
|
+
}
|
|
32
|
+
/** Build the CLI. It throws instead of exiting, see `main`. */
|
|
33
|
+
export function buildProgram(options = {}) {
|
|
34
|
+
const program = new Command();
|
|
35
|
+
program
|
|
36
|
+
.name('duolingo')
|
|
37
|
+
.description('Read your Duolingo data: profile, streak, XP, courses, topics, words and more.\n' +
|
|
38
|
+
'Credentials: DUOLINGO_USERNAME and DUOLINGO_JWT, from the environment or\n' +
|
|
39
|
+
'~/.config/duolingo/config (KEY=VALUE, mode 0600).')
|
|
40
|
+
.version(version)
|
|
41
|
+
.addOption(new Option('-f, --format <format>', 'output format')
|
|
42
|
+
.choices(['json', 'markdown'])
|
|
43
|
+
.default('json'))
|
|
44
|
+
.exitOverride()
|
|
45
|
+
.hook('preAction', () => {
|
|
46
|
+
loadConfigFile(options.configFile);
|
|
47
|
+
});
|
|
48
|
+
async function show(load) {
|
|
49
|
+
const { format } = program.opts();
|
|
50
|
+
const text = formatView(await load(), format);
|
|
51
|
+
process.stdout.write(`${text}\n`);
|
|
52
|
+
}
|
|
53
|
+
const usernameOption = () => new Option('-u, --username <name>', 'Duolingo user to query (default: the authenticated user)');
|
|
54
|
+
// ── MCP ───────────────────────────────────────────────────────────────────
|
|
55
|
+
program
|
|
56
|
+
.command('mcp')
|
|
57
|
+
.description('Start the MCP server (stdio)')
|
|
58
|
+
.action(startMcpServer);
|
|
59
|
+
// ── Account ───────────────────────────────────────────────────────────────
|
|
60
|
+
program
|
|
61
|
+
.command('user')
|
|
62
|
+
.description('Profile: name, bio, location, followers, languages')
|
|
63
|
+
.addOption(usernameOption())
|
|
64
|
+
.action((opts) => show(() => userInfoView(opts)));
|
|
65
|
+
program
|
|
66
|
+
.command('settings')
|
|
67
|
+
.description('Account settings of the authenticated user')
|
|
68
|
+
.action(() => show(settingsView));
|
|
69
|
+
program
|
|
70
|
+
.command('streak')
|
|
71
|
+
.description('Current streak, daily goal and longest streak')
|
|
72
|
+
.addOption(usernameOption())
|
|
73
|
+
.action((opts) => show(() => streakInfoView(opts)));
|
|
74
|
+
program
|
|
75
|
+
.command('xp')
|
|
76
|
+
.description('XP earned and lessons completed today')
|
|
77
|
+
.action(() => show(dailyXpProgressView));
|
|
78
|
+
program
|
|
79
|
+
.command('languages')
|
|
80
|
+
.description('Languages the user is learning')
|
|
81
|
+
.addOption(usernameOption())
|
|
82
|
+
.option('-a, --abbreviations', "print abbreviations (e.g. 'fr')")
|
|
83
|
+
.action((opts) => show(() => languagesView(opts)));
|
|
84
|
+
program
|
|
85
|
+
.command('courses')
|
|
86
|
+
.description('All courses, including Math, Chess and Music')
|
|
87
|
+
.addOption(usernameOption())
|
|
88
|
+
.action((opts) => show(() => coursesView(opts)));
|
|
89
|
+
program
|
|
90
|
+
.command('friends')
|
|
91
|
+
.description('Users the authenticated user follows')
|
|
92
|
+
.action(() => show(friendsView));
|
|
93
|
+
program
|
|
94
|
+
.command('calendar')
|
|
95
|
+
.description('Recent activity of the current course, newest first')
|
|
96
|
+
.addOption(usernameOption())
|
|
97
|
+
.action((opts) => show(() => calendarView(opts)));
|
|
98
|
+
program
|
|
99
|
+
.command('leaderboard')
|
|
100
|
+
.description('Friends ranked by XP')
|
|
101
|
+
.addOption(new Option('--unit <unit>', 'time unit')
|
|
102
|
+
.choices(['week', 'month'])
|
|
103
|
+
.default('week'))
|
|
104
|
+
.action((opts) => show(() => leaderboardView(opts)));
|
|
105
|
+
program
|
|
106
|
+
.command('shop')
|
|
107
|
+
.description('Shop items and their prices (read-only)')
|
|
108
|
+
.action(() => show(shopItemsView));
|
|
109
|
+
program
|
|
110
|
+
.command('health')
|
|
111
|
+
.description('Hearts and refill status')
|
|
112
|
+
.action(() => show(healthView));
|
|
113
|
+
program
|
|
114
|
+
.command('currencies')
|
|
115
|
+
.description('Gem and lingot balances')
|
|
116
|
+
.action(() => show(currenciesView));
|
|
117
|
+
program
|
|
118
|
+
.command('streak-goal')
|
|
119
|
+
.description('Current streak goal and upcoming checkpoints')
|
|
120
|
+
.action(() => show(streakGoalView));
|
|
121
|
+
// ── Language ──────────────────────────────────────────────────────────────
|
|
122
|
+
program
|
|
123
|
+
.command('language <name>')
|
|
124
|
+
.description("Level, points and streak of a language (e.g. 'French')")
|
|
125
|
+
.addOption(usernameOption())
|
|
126
|
+
.action((name, opts) => show(() => languageDetailsView({ language_name: name, ...opts })));
|
|
127
|
+
program
|
|
128
|
+
.command('progress <abbr>')
|
|
129
|
+
.description("Detailed progress in a language (e.g. 'fr')")
|
|
130
|
+
.action((abbr) => show(() => languageProgressView({ language_abbr: abbr })));
|
|
131
|
+
const languageQueries = [
|
|
132
|
+
['known-topics', 'Learned topics', knownTopicsView],
|
|
133
|
+
['unknown-topics', 'Topics not learned yet', unknownTopicsView],
|
|
134
|
+
['golden-topics', 'Fully mastered topics', goldenTopicsView],
|
|
135
|
+
[
|
|
136
|
+
'reviewable-topics',
|
|
137
|
+
'Learned topics that need review',
|
|
138
|
+
reviewableTopicsView,
|
|
139
|
+
],
|
|
140
|
+
['known-words', 'Words learned', knownWordsView],
|
|
141
|
+
['learned-skills', 'Learned skills in learning order', learnedSkillsView],
|
|
142
|
+
];
|
|
143
|
+
for (const [name, description, view] of languageQueries) {
|
|
144
|
+
program
|
|
145
|
+
.command(`${name} <abbr>`)
|
|
146
|
+
.description(`${description} in a language (e.g. 'fr')`)
|
|
147
|
+
.addOption(usernameOption())
|
|
148
|
+
.action((abbr, opts) => show(() => view({ language_abbr: abbr, ...opts })));
|
|
149
|
+
}
|
|
150
|
+
program
|
|
151
|
+
.command('voices [abbr]')
|
|
152
|
+
.description('Text-to-speech voices (default: current language)')
|
|
153
|
+
.action((abbr) => show(() => languageVoicesView({ language_abbr: abbr })));
|
|
154
|
+
program
|
|
155
|
+
.command('audio-url <word> [abbr]')
|
|
156
|
+
.description('URL of the pronunciation audio of a word')
|
|
157
|
+
.option('--voice <voice>', "voice to use (e.g. 'mathieu')")
|
|
158
|
+
.option('--no-random', 'use the default voice instead of a random one')
|
|
159
|
+
.action((word, abbr, opts) => show(() => audioUrlView({ word, language_abbr: abbr, ...opts })));
|
|
160
|
+
// ── Utilities ─────────────────────────────────────────────────────────────
|
|
161
|
+
program
|
|
162
|
+
.command('language-name <abbr>')
|
|
163
|
+
.description("Full name of a language you learn (e.g. 'fr' → 'French')")
|
|
164
|
+
.addOption(usernameOption())
|
|
165
|
+
.action((abbr, opts) => show(() => languageFromAbbrView({ language_abbr: abbr, ...opts })));
|
|
166
|
+
program
|
|
167
|
+
.command('abbreviation <name>')
|
|
168
|
+
.description("Abbreviation of a language you learn (e.g. 'French' → 'fr')")
|
|
169
|
+
.addOption(usernameOption())
|
|
170
|
+
.action((name, opts) => show(() => abbreviationOfView({ language_name: name, ...opts })));
|
|
171
|
+
return program;
|
|
172
|
+
}
|
|
173
|
+
/** Run the CLI with the given arguments. Returns the exit code. */
|
|
174
|
+
export async function main(argv, options = {}) {
|
|
175
|
+
try {
|
|
176
|
+
await buildProgram(options).parseAsync(argv, { from: 'user' });
|
|
177
|
+
return 0;
|
|
178
|
+
}
|
|
179
|
+
catch (err) {
|
|
180
|
+
// Commander already printed help, the version or a usage error.
|
|
181
|
+
if (err instanceof CommanderError)
|
|
182
|
+
return err.exitCode;
|
|
183
|
+
process.stderr.write(`[duolingo] ${handleError(err)}\n`);
|
|
184
|
+
return 1;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=program.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.js","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,YAAY,EACZ,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,UAAU,EACV,aAAa,EACb,eAAe,EACf,YAAY,EACZ,aAAa,EACb,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,GAElB,MAAM,sBAAsB,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
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Entry point of the `duolingo` binary. The CLI itself lives in
|
|
4
|
+
* cli/program.ts so tests can run it in-process.
|
|
5
|
+
*/
|
|
6
|
+
import { main } from './cli/program.js';
|
|
7
|
+
process.exitCode = await main(process.argv.slice(2));
|
|
8
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,CAAC,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|