undraw-cli 0.1.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/LICENSE +21 -0
- package/README.md +53 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +127 -0
- package/dist/index.js.map +1 -0
- package/package.json +69 -0
- package/undraw-inventory.json +9902 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 azk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# unDraw CLI
|
|
2
|
+
|
|
3
|
+
A powerful CLI to search, customize, and download illustrations from [unDraw](https://undraw.co).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🔍 **Search**: Find illustrations by keyword.
|
|
8
|
+
- 🎨 **Customize**: Change the primary color (`#6c63ff`) to any hex code on-the-fly.
|
|
9
|
+
- 📦 **Download**: Save customized SVGs directly to your project.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g undraw-cli
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
_(Note: Use `npx undraw-cli` if you don't want to install globally)_
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Sync the full library
|
|
22
|
+
|
|
23
|
+
Run this first to build your local inventory (1,600+ items).
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
undraw sync
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### List illustrations
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
undraw list --page 1 --limit 20
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Search for illustrations
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
undraw search astronomy
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Download and Customize
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
undraw download astronomy_ied1 --color #32a852 --output ./assets
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## How it works
|
|
48
|
+
|
|
49
|
+
The CLI fetches the latest illustration metadata from unDraw and performs a high-performance string replacement on the SVG source code to apply your custom primary color.
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import fetch from "node-fetch";
|
|
6
|
+
import fs from "fs/promises";
|
|
7
|
+
import path from "path";
|
|
8
|
+
import chalk from "chalk";
|
|
9
|
+
import ora from "ora";
|
|
10
|
+
var program = new Command();
|
|
11
|
+
var DEFAULT_COLOR = "#6c63ff";
|
|
12
|
+
var BASE_URL = "https://undraw.co";
|
|
13
|
+
var CDN_URL = "https://cdn.undraw.co/illustration";
|
|
14
|
+
var INVENTORY_PATH = path.resolve(process.cwd(), "undraw-inventory.json");
|
|
15
|
+
async function getBuildId() {
|
|
16
|
+
const response = await fetch(BASE_URL);
|
|
17
|
+
const html = await response.text();
|
|
18
|
+
const match = html.match(/"buildId":"([^"]+)"/);
|
|
19
|
+
return match ? match[1] : null;
|
|
20
|
+
}
|
|
21
|
+
async function fetchIllustrationsPage(buildId, page) {
|
|
22
|
+
const url = page === 1 ? `${BASE_URL}/_next/data/${buildId}/illustrations.json` : `${BASE_URL}/_next/data/${buildId}/illustrations/${page}.json?page=${page}`;
|
|
23
|
+
const response = await fetch(url);
|
|
24
|
+
if (!response.ok) return null;
|
|
25
|
+
const data = await response.json();
|
|
26
|
+
return data.pageProps.illustrations;
|
|
27
|
+
}
|
|
28
|
+
async function loadInventory() {
|
|
29
|
+
try {
|
|
30
|
+
const data = await fs.readFile(INVENTORY_PATH, "utf-8");
|
|
31
|
+
return JSON.parse(data);
|
|
32
|
+
} catch (_err) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function printIllustrations(illustrations, title) {
|
|
37
|
+
if (illustrations.length === 0) {
|
|
38
|
+
console.log(chalk.red("No illustrations found."));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
console.log(chalk.green(`
|
|
42
|
+
${title} (${illustrations.length}):`));
|
|
43
|
+
console.log(chalk.gray("\u2500".repeat(50)));
|
|
44
|
+
illustrations.forEach((i) => {
|
|
45
|
+
console.log(
|
|
46
|
+
`${chalk.bold((i.title || "Untitled").padEnd(30))} id: ${chalk.cyan(i.newSlug || i.slug)}`
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
console.log(chalk.gray("\u2500".repeat(50)) + "\n");
|
|
50
|
+
}
|
|
51
|
+
program.name("undraw").description("CLI to search and customize unDraw illustrations").version("0.1.0");
|
|
52
|
+
program.command("sync").description("Sync the full unDraw library to a local inventory file").action(async () => {
|
|
53
|
+
const spinner = ora("Initializing sync...").start();
|
|
54
|
+
try {
|
|
55
|
+
const buildId = await getBuildId();
|
|
56
|
+
if (!buildId) throw new Error("Could not find buildId");
|
|
57
|
+
let allIllustrations = [];
|
|
58
|
+
let page = 1;
|
|
59
|
+
let hasMore = true;
|
|
60
|
+
while (hasMore) {
|
|
61
|
+
spinner.text = `Fetching page ${page}... (Total: ${allIllustrations.length})`;
|
|
62
|
+
const illustrations = await fetchIllustrationsPage(buildId, page);
|
|
63
|
+
if (!illustrations || illustrations.length === 0) {
|
|
64
|
+
hasMore = false;
|
|
65
|
+
} else {
|
|
66
|
+
allIllustrations = [...allIllustrations, ...illustrations];
|
|
67
|
+
page++;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
spinner.text = "Saving inventory...";
|
|
71
|
+
await fs.writeFile(INVENTORY_PATH, JSON.stringify(allIllustrations, null, 2));
|
|
72
|
+
spinner.succeed(
|
|
73
|
+
chalk.green(`Synced ${allIllustrations.length} illustrations to ${INVENTORY_PATH}`)
|
|
74
|
+
);
|
|
75
|
+
} catch (_err) {
|
|
76
|
+
spinner.fail(chalk.red(`Sync failed: ${_err.message}`));
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
program.command("search").description("Search for illustrations by title").argument("<query>", "search query").action(async (query) => {
|
|
80
|
+
const illustrations = await loadInventory();
|
|
81
|
+
if (!illustrations) {
|
|
82
|
+
console.log(chalk.yellow('Inventory not found. Please run "undraw sync" first.'));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const filtered = illustrations.filter(
|
|
86
|
+
(i) => (i.title || "").toLowerCase().includes(query.toLowerCase())
|
|
87
|
+
);
|
|
88
|
+
printIllustrations(filtered, `Found ${filtered.length} matches for "${query}"`);
|
|
89
|
+
});
|
|
90
|
+
program.command("list").description("List illustrations from local inventory").option("-p, --page <number>", "page number", "1").option("-l, --limit <number>", "items per page", "20").action(async (options) => {
|
|
91
|
+
const illustrations = await loadInventory();
|
|
92
|
+
if (!illustrations) {
|
|
93
|
+
console.log(chalk.yellow('Inventory not found. Please run "undraw sync" first.'));
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const page = parseInt(options.page, 10);
|
|
97
|
+
const limit = parseInt(options.limit, 10);
|
|
98
|
+
const start = (page - 1) * limit;
|
|
99
|
+
const end = start + limit;
|
|
100
|
+
const paginated = illustrations.slice(start, end);
|
|
101
|
+
const totalPages = Math.ceil(illustrations.length / limit);
|
|
102
|
+
printIllustrations(paginated, `Inventory: Page ${page} of ${totalPages}`);
|
|
103
|
+
if (page < totalPages) {
|
|
104
|
+
console.log(chalk.gray(`Run 'undraw list --page ${page + 1}' for more...`));
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
program.command("download").description("Download an illustration with a custom color").argument("<id>", "illustration id (e.g., astronomy_ied1)").option("-c, --color <hex>", "primary hex color", DEFAULT_COLOR).option("-o, --output <path>", "output file path", ".").action(async (id, options) => {
|
|
108
|
+
const spinner = ora(`Downloading ${id}...`).start();
|
|
109
|
+
try {
|
|
110
|
+
const url = `${CDN_URL}/${id}.svg`;
|
|
111
|
+
const response = await fetch(url);
|
|
112
|
+
if (!response.ok) throw new Error(`Illustration not found: ${id}`);
|
|
113
|
+
let svg = await response.text();
|
|
114
|
+
if (options.color !== DEFAULT_COLOR) {
|
|
115
|
+
spinner.text = `Applying color ${options.color}...`;
|
|
116
|
+
svg = svg.split(DEFAULT_COLOR).join(options.color);
|
|
117
|
+
}
|
|
118
|
+
const filename = `${id}.svg`;
|
|
119
|
+
const outputPath = path.resolve(options.output, filename);
|
|
120
|
+
await fs.writeFile(outputPath, svg);
|
|
121
|
+
spinner.succeed(chalk.green(`Saved to ${outputPath}`));
|
|
122
|
+
} catch (err) {
|
|
123
|
+
spinner.fail(chalk.red(`Error: ${err.message}`));
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
program.parse();
|
|
127
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander';\nimport fetch from 'node-fetch';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport chalk from 'chalk';\nimport ora from 'ora';\n\nconst program = new Command();\n\nconst DEFAULT_COLOR = '#6c63ff';\nconst BASE_URL = 'https://undraw.co';\nconst CDN_URL = 'https://cdn.undraw.co/illustration';\nconst INVENTORY_PATH = path.resolve(process.cwd(), 'undraw-inventory.json');\n\nasync function getBuildId() {\n const response = await fetch(BASE_URL);\n const html = await response.text();\n const match = html.match(/\"buildId\":\"([^\"]+)\"/);\n return match ? match[1] : null;\n}\n\nasync function fetchIllustrationsPage(buildId: string, page: number) {\n // Pattern discovered:\n // Page 1: https://undraw.co/_next/data/[BUILD_ID]/illustrations.json\n // Page 2+: https://undraw.co/_next/data/[BUILD_ID]/illustrations/[PAGE].json?page=[PAGE]\n const url =\n page === 1\n ? `${BASE_URL}/_next/data/${buildId}/illustrations.json`\n : `${BASE_URL}/_next/data/${buildId}/illustrations/${page}.json?page=${page}`;\n const response = await fetch(url);\n if (!response.ok) return null;\n const data = (await response.json()) as any;\n return data.pageProps.illustrations;\n}\n\nasync function loadInventory() {\n try {\n const data = await fs.readFile(INVENTORY_PATH, 'utf-8');\n return JSON.parse(data);\n } catch (_err) {\n return null;\n }\n}\n\nfunction printIllustrations(illustrations: any[], title: string) {\n if (illustrations.length === 0) {\n console.log(chalk.red('No illustrations found.'));\n return;\n }\n\n console.log(chalk.green(`\\n${title} (${illustrations.length}):`));\n console.log(chalk.gray('─'.repeat(50)));\n illustrations.forEach((i: any) => {\n console.log(\n `${chalk.bold((i.title || 'Untitled').padEnd(30))} id: ${chalk.cyan(i.newSlug || i.slug)}`\n );\n });\n console.log(chalk.gray('─'.repeat(50)) + '\\n');\n}\n\nprogram\n .name('undraw')\n .description('CLI to search and customize unDraw illustrations')\n .version('0.1.0');\n\nprogram\n .command('sync')\n .description('Sync the full unDraw library to a local inventory file')\n .action(async () => {\n const spinner = ora('Initializing sync...').start();\n try {\n const buildId = await getBuildId();\n if (!buildId) throw new Error('Could not find buildId');\n\n let allIllustrations: any[] = [];\n let page = 1;\n let hasMore = true;\n\n while (hasMore) {\n spinner.text = `Fetching page ${page}... (Total: ${allIllustrations.length})`;\n const illustrations = await fetchIllustrationsPage(buildId, page);\n\n if (!illustrations || illustrations.length === 0) {\n hasMore = false;\n } else {\n allIllustrations = [...allIllustrations, ...illustrations];\n page++;\n }\n }\n\n spinner.text = 'Saving inventory...';\n await fs.writeFile(INVENTORY_PATH, JSON.stringify(allIllustrations, null, 2));\n spinner.succeed(\n chalk.green(`Synced ${allIllustrations.length} illustrations to ${INVENTORY_PATH}`)\n );\n } catch (_err: any) {\n spinner.fail(chalk.red(`Sync failed: ${_err.message}`));\n }\n });\n\nprogram\n .command('search')\n .description('Search for illustrations by title')\n .argument('<query>', 'search query')\n .action(async (query: string) => {\n const illustrations = await loadInventory();\n if (!illustrations) {\n console.log(chalk.yellow('Inventory not found. Please run \"undraw sync\" first.'));\n return;\n }\n\n const filtered = illustrations.filter((i: any) =>\n (i.title || '').toLowerCase().includes(query.toLowerCase())\n );\n\n printIllustrations(filtered, `Found ${filtered.length} matches for \"${query}\"`);\n });\n\nprogram\n .command('list')\n .description('List illustrations from local inventory')\n .option('-p, --page <number>', 'page number', '1')\n .option('-l, --limit <number>', 'items per page', '20')\n .action(async (options) => {\n const illustrations = await loadInventory();\n if (!illustrations) {\n console.log(chalk.yellow('Inventory not found. Please run \"undraw sync\" first.'));\n return;\n }\n\n const page = parseInt(options.page, 10);\n const limit = parseInt(options.limit, 10);\n const start = (page - 1) * limit;\n const end = start + limit;\n const paginated = illustrations.slice(start, end);\n const totalPages = Math.ceil(illustrations.length / limit);\n\n printIllustrations(paginated, `Inventory: Page ${page} of ${totalPages}`);\n\n if (page < totalPages) {\n console.log(chalk.gray(`Run 'undraw list --page ${page + 1}' for more...`));\n }\n });\n\nprogram\n .command('download')\n .description('Download an illustration with a custom color')\n .argument('<id>', 'illustration id (e.g., astronomy_ied1)')\n .option('-c, --color <hex>', 'primary hex color', DEFAULT_COLOR)\n .option('-o, --output <path>', 'output file path', '.')\n .action(async (id, options) => {\n const spinner = ora(`Downloading ${id}...`).start();\n try {\n const url = `${CDN_URL}/${id}.svg`;\n const response = await fetch(url);\n if (!response.ok) throw new Error(`Illustration not found: ${id}`);\n\n let svg = await response.text();\n\n if (options.color !== DEFAULT_COLOR) {\n spinner.text = `Applying color ${options.color}...`;\n svg = svg.split(DEFAULT_COLOR).join(options.color);\n }\n\n const filename = `${id}.svg`;\n const outputPath = path.resolve(options.output, filename);\n\n await fs.writeFile(outputPath, svg);\n spinner.succeed(chalk.green(`Saved to ${outputPath}`));\n } catch (err: any) {\n spinner.fail(chalk.red(`Error: ${err.message}`));\n }\n });\n\nprogram.parse();\n"],"mappings":";;;AACA,SAAS,eAAe;AACxB,OAAO,WAAW;AAClB,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,OAAO,SAAS;AAEhB,IAAM,UAAU,IAAI,QAAQ;AAE5B,IAAM,gBAAgB;AACtB,IAAM,WAAW;AACjB,IAAM,UAAU;AAChB,IAAM,iBAAiB,KAAK,QAAQ,QAAQ,IAAI,GAAG,uBAAuB;AAE1E,eAAe,aAAa;AAC1B,QAAM,WAAW,MAAM,MAAM,QAAQ;AACrC,QAAM,OAAO,MAAM,SAAS,KAAK;AACjC,QAAM,QAAQ,KAAK,MAAM,qBAAqB;AAC9C,SAAO,QAAQ,MAAM,CAAC,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EACvD,SAAS,KAAU;AACjB,YAAQ,KAAK,MAAM,IAAI,UAAU,IAAI,OAAO,EAAE,CAAC;AAAA,EACjD;AACF,CAAC;AAEH,QAAQ,MAAM;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "undraw-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A CLI to search, customize, and download illustrations from undraw.co",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"undraw": "dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE",
|
|
21
|
+
"undraw-inventory.json"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsup",
|
|
25
|
+
"dev": "tsup --watch",
|
|
26
|
+
"sync": "node dist/index.js sync",
|
|
27
|
+
"lint": "eslint .",
|
|
28
|
+
"format": "prettier --write .",
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"prepublishOnly": "npm run build",
|
|
32
|
+
"prepare": "husky"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"undraw",
|
|
36
|
+
"illustrations",
|
|
37
|
+
"svg",
|
|
38
|
+
"cli",
|
|
39
|
+
"agentic-ai"
|
|
40
|
+
],
|
|
41
|
+
"author": "azk",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "git+https://github.com/stefdevscore/undraw-cli.git"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/stefdevscore/undraw-cli#readme",
|
|
48
|
+
"bugs": {
|
|
49
|
+
"url": "https://github.com/stefdevscore/undraw-cli/issues"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"chalk": "^5.3.0",
|
|
53
|
+
"commander": "^12.0.0",
|
|
54
|
+
"node-fetch": "^3.3.2",
|
|
55
|
+
"ora": "^8.0.1"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@eslint/js": "^9.39.4",
|
|
59
|
+
"@types/node": "^25.5.0",
|
|
60
|
+
"eslint": "^9.39.4",
|
|
61
|
+
"husky": "^9.1.7",
|
|
62
|
+
"lint-staged": "^16.4.0",
|
|
63
|
+
"prettier": "^3.2.5",
|
|
64
|
+
"tsup": "^8.0.2",
|
|
65
|
+
"typescript": "^5.4.0",
|
|
66
|
+
"typescript-eslint": "^8.57.2",
|
|
67
|
+
"vitest": "^1.4.0"
|
|
68
|
+
}
|
|
69
|
+
}
|