wrapt-cli 0.1.4 → 0.1.6
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 +3 -2
- package/dist/cli.js +9 -4
- package/dist/render/cards.js +23 -3
- package/dist/render/index.js +18 -6
- package/dist/share/page.js +12 -6
- package/dist/site.js +7 -1
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -48,8 +48,8 @@ Step-by-step guide: **https://wrapt.cc**
|
|
|
48
48
|
| Format | Size | For |
|
|
49
49
|
|---|---|---|
|
|
50
50
|
| 8 story cards | 1080 × 1920 | Instagram Stories |
|
|
51
|
-
| 8 carousel cards | 1080 × 1350 | Instagram carousel post |
|
|
52
|
-
| 8-page PDF | 1080 × 1350 | LinkedIn document post |
|
|
51
|
+
| 8 carousel cards | 1080 × 1350 | Instagram carousel, or a LinkedIn image post (easiest) |
|
|
52
|
+
| 8-page PDF | 1080 × 1350 | LinkedIn document post (swipeable in the feed) |
|
|
53
53
|
| 1 summary card | 1200 × 675 | X |
|
|
54
54
|
|
|
55
55
|
The eight cards: your name and year, your biggest number (tokens, hours or prompts), when you
|
|
@@ -68,6 +68,7 @@ npx wrapt-cli render --name "Ada" --theme pastel
|
|
|
68
68
|
|---|---|
|
|
69
69
|
| `--name "Ada"` | Your first name on the cover. Without it, the cover says “Your 2026”. |
|
|
70
70
|
| `--theme bold\|mono\|pastel` | Color theme. Default: `bold`. |
|
|
71
|
+
| `--no-credit` | Leave out the line crediting wrapt's creator, Mayank Agarwal, with his LinkedIn (`in/whomayankagarwal`) and Instagram (`@whomayankagarwal`) handles. By default it is on the last card. |
|
|
71
72
|
| `--show-projects` | Put your real project names on the cards. By default they show as “Project A”, “Project B”. |
|
|
72
73
|
| `--year 2025` | Make the cards for another year. Add it to each command. Default: this year. |
|
|
73
74
|
| `--source claude\|copilot` | Only read one tool's history. Default: every supported tool found. |
|
package/dist/cli.js
CHANGED
|
@@ -26,7 +26,7 @@ Run it with npx: npx wrapt-cli <command> (or install it: npm i -g wrapt-cli, t
|
|
|
26
26
|
|
|
27
27
|
Usage
|
|
28
28
|
wrapt analyze [--year 2026] [--source all|claude|copilot] [--json] [--samples] [--projects-dir <dir>]
|
|
29
|
-
wrapt render [--year 2026] [--name "Ada"] [--show-projects] [--theme bold|mono|pastel] [--out <dir>]
|
|
29
|
+
wrapt render [--year 2026] [--name "Ada"] [--show-projects] [--theme bold|mono|pastel] [--no-credit] [--out <dir>]
|
|
30
30
|
wrapt schema [--validate <narrative.json>]
|
|
31
31
|
wrapt share [--year 2026] [--minutes 15] [--port <n>]
|
|
32
32
|
wrapt airdrop [--year 2026] [--set story|carousel|all]
|
|
@@ -56,6 +56,8 @@ Options
|
|
|
56
56
|
--samples analyze: also save samples.json, prompt excerpts for the /wrapt skill. Off by default.
|
|
57
57
|
--name Name for the cover (default: "Your 2026 with Claude")
|
|
58
58
|
--show-projects Put your real project names on the cards (default: "Project A/B/C")
|
|
59
|
+
--no-credit Leave out the line crediting wrapt's creator (LinkedIn and Instagram handles)
|
|
60
|
+
on the last card. It is shown by default.
|
|
59
61
|
--theme Colour theme: ${Object.keys(THEMES).join(", ")} (default: bold)
|
|
60
62
|
-h, --help Show help
|
|
61
63
|
`;
|
|
@@ -76,6 +78,9 @@ async function main(argv) {
|
|
|
76
78
|
// Older flag: project names are hidden by default now, so this is a no-op kept for scripts.
|
|
77
79
|
"hide-projects": { type: "boolean", default: false },
|
|
78
80
|
theme: { type: "string" },
|
|
81
|
+
// The creator credit is on by default; --no-credit turns it off. --credit is accepted for scripts.
|
|
82
|
+
credit: { type: "boolean", default: true },
|
|
83
|
+
"no-credit": { type: "boolean", default: false },
|
|
79
84
|
validate: { type: "string" },
|
|
80
85
|
minutes: { type: "string" },
|
|
81
86
|
set: { type: "string" },
|
|
@@ -143,7 +148,7 @@ async function main(argv) {
|
|
|
143
148
|
process.stderr.write(`Ignoring invalid narrative.json:\n${parsed.error.message}\n`);
|
|
144
149
|
}
|
|
145
150
|
const t0 = Date.now();
|
|
146
|
-
const res = await renderAll({ stats, narrative, name: values.name, hideProjects: values["hide-projects"] || !values["show-projects"], theme: values.theme, outDir: dir, infoDir: dataDir });
|
|
151
|
+
const res = await renderAll({ stats, narrative, name: values.name, hideProjects: values["hide-projects"] || !values["show-projects"], theme: values.theme, credit: !values["no-credit"], outDir: dir, infoDir: dataDir });
|
|
147
152
|
// Every card of a set in one file, for downloading or sending in one go.
|
|
148
153
|
const zipNames = [];
|
|
149
154
|
for (const [set, buf] of Object.entries(cardZips(dir, year, collectAssets(dir)))) {
|
|
@@ -159,9 +164,9 @@ async function main(argv) {
|
|
|
159
164
|
"",
|
|
160
165
|
` Saved in ${shown(dir)}`,
|
|
161
166
|
row("story/", `${n} Instagram Story cards (1080 × 1920)`),
|
|
162
|
-
row("carousel/", `${res.carousel.length}
|
|
167
|
+
row("carousel/", `${res.carousel.length} cards (1080 × 1350) for an Instagram carousel or a LinkedIn image post`),
|
|
163
168
|
...zipNames.map((z) => row(z, `all the ${z.includes("story") ? "story" : "carousel"} cards in one file`)),
|
|
164
|
-
row(path.basename(res.pdf), "LinkedIn document
|
|
169
|
+
row(path.basename(res.pdf), "the same cards as a swipeable LinkedIn document (optional)"),
|
|
165
170
|
row(path.basename(res.xCard), "X post"),
|
|
166
171
|
"",
|
|
167
172
|
" Next",
|
package/dist/render/cards.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { brandFor } from "../brand.js";
|
|
2
2
|
import { displayTool, human } from "../format.js";
|
|
3
|
-
import { SITE, SITE_URL, qrSvgDataUri } from "../site.js";
|
|
3
|
+
import { CREATOR, SITE, SITE_URL, qrSvgDataUri } from "../site.js";
|
|
4
4
|
import { h } from "./h.js";
|
|
5
5
|
import { textWidthEm } from "./measure.js";
|
|
6
6
|
export const SIZES = {
|
|
@@ -385,6 +385,24 @@ export function outroStats(ctx) {
|
|
|
385
385
|
lang ? { value: lang, label: "top language" } : { value: human(t.sessions), label: "sessions" },
|
|
386
386
|
];
|
|
387
387
|
}
|
|
388
|
+
/** "wrapt by Mayank Agarwal" and the LinkedIn and Instagram handles, unless `render --no-credit`. One line when `inline`, else two. */
|
|
389
|
+
function CreditLine(props) {
|
|
390
|
+
if (!props.ctx.credit)
|
|
391
|
+
return null;
|
|
392
|
+
const s = props.size;
|
|
393
|
+
const sep = h("span", { style: { opacity: 0.45, marginLeft: 0.4 * s, marginRight: 0.4 * s } }, "\u00B7");
|
|
394
|
+
const by = (h("div", { style: { display: "flex" } },
|
|
395
|
+
h("span", { style: { opacity: 0.7, marginRight: 0.3 * s } }, "wrapt by"),
|
|
396
|
+
h("span", { style: { fontWeight: 700 } }, CREATOR.name)));
|
|
397
|
+
const handles = (h("div", { style: { display: "flex", opacity: 0.85, marginTop: props.inline ? 0 : 0.3 * s } },
|
|
398
|
+
h("span", null, `LinkedIn ${CREATOR.linkedin}`),
|
|
399
|
+
sep,
|
|
400
|
+
h("span", null, `Instagram ${CREATOR.instagram}`)));
|
|
401
|
+
return (h("div", { style: { display: "flex", flexDirection: props.inline ? "row" : "column", fontSize: s, fontWeight: 500, marginTop: props.marginTop } },
|
|
402
|
+
by,
|
|
403
|
+
props.inline ? sep : null,
|
|
404
|
+
handles));
|
|
405
|
+
}
|
|
388
406
|
function Outro(ctx) {
|
|
389
407
|
const d = dims(ctx.size);
|
|
390
408
|
const { u } = d;
|
|
@@ -428,7 +446,8 @@ function Outro(ctx) {
|
|
|
428
446
|
h("span", { style: { fontSize: 120 * u, fontWeight: 700, lineHeight: 1, letterSpacing: -4 * u, color: ctx.palette.accent } }, String(ctx.stats.year)),
|
|
429
447
|
h("span", { style: { fontSize: fitFont(`with ${brand.long}`, 380 * u, 40 * u), fontWeight: 700, lineHeight: 1, marginBottom: 28 * u } }, `with ${brand.long}`),
|
|
430
448
|
cta),
|
|
431
|
-
grid)
|
|
449
|
+
grid),
|
|
450
|
+
h(CreditLine, { ctx: ctx, size: 20 * u, marginTop: 28 * u, inline: true })));
|
|
432
451
|
}
|
|
433
452
|
return (h(Frame, { ctx: ctx, kicker: "That\u2019s a wrap" },
|
|
434
453
|
h("span", { style: {
|
|
@@ -440,7 +459,8 @@ function Outro(ctx) {
|
|
|
440
459
|
marginBottom: 44 * u,
|
|
441
460
|
} }, title),
|
|
442
461
|
grid,
|
|
443
|
-
h("div", { style: { display: "flex", marginTop: 48 * u } }, cta)
|
|
462
|
+
h("div", { style: { display: "flex", marginTop: 48 * u } }, cta),
|
|
463
|
+
h(CreditLine, { ctx: ctx, size: (d.tall ? 23 : 26) * u, marginTop: (d.tall ? 40 : 24) * u })));
|
|
444
464
|
}
|
|
445
465
|
export const CARDS = [Cover, BigNumber, Rhythm, TopAsks, WordOfYear, Stack, Archetype, Outro];
|
|
446
466
|
export const CARD_NAMES = ["cover", "big-number", "rhythm", "top-asks", "word", "stack", "archetype", "outro"];
|
package/dist/render/index.js
CHANGED
|
@@ -34,6 +34,7 @@ export async function renderAll(opts) {
|
|
|
34
34
|
narrative: opts.narrative,
|
|
35
35
|
name: opts.name,
|
|
36
36
|
hideProjects: opts.hideProjects ?? true,
|
|
37
|
+
credit: opts.credit ?? true,
|
|
37
38
|
total: CARDS.length,
|
|
38
39
|
};
|
|
39
40
|
const ctxFor = (size, i) => ({ ...base, size, palette: palettes[i], index: i + 1 });
|
|
@@ -54,20 +55,31 @@ export async function renderAll(opts) {
|
|
|
54
55
|
fs.writeFileSync(out.xCard, await toPng(Outro(ctxFor(SIZES.x, CARDS.length - 1)), SIZES.x));
|
|
55
56
|
fs.writeFileSync(out.pdf, await carouselPdf(carouselPngs, opts.stats.year, brandFor(opts.stats).long));
|
|
56
57
|
// Remember how the cards were made, so `wrapt publish` can warn before project names go public.
|
|
57
|
-
fs.writeFileSync(path.join(opts.infoDir ?? opts.outDir, "render.json"), JSON.stringify({ name: opts.name ?? null, hideProjects: opts.hideProjects ?? true, theme: opts.theme ?? "bold", renderedAt: new Date().toISOString() }, null, 2) + "\n", { mode: 0o600 });
|
|
58
|
+
fs.writeFileSync(path.join(opts.infoDir ?? opts.outDir, "render.json"), JSON.stringify({ name: opts.name ?? null, hideProjects: opts.hideProjects ?? true, credit: opts.credit ?? true, theme: opts.theme ?? "bold", renderedAt: new Date().toISOString() }, null, 2) + "\n", { mode: 0o600 });
|
|
58
59
|
fs.chmodSync(path.join(opts.infoDir ?? opts.outDir, "render.json"), 0o600); // also when the file already existed
|
|
59
60
|
return out;
|
|
60
61
|
}
|
|
61
|
-
/**
|
|
62
|
+
/** Points per pixel: a 1080 × 1350 px card becomes an 810 × 1012.5 pt page (11.25 × 14.06 in at 96 dpi), the size design tools export for LinkedIn. */
|
|
63
|
+
export const PDF_SCALE = 0.75;
|
|
64
|
+
/**
|
|
65
|
+
* One carousel card per page. LinkedIn shows a PDF document post as a swipeable carousel.
|
|
66
|
+
* Kept deliberately plain so LinkedIn's document processing accepts it: a classic cross-reference
|
|
67
|
+
* table instead of compressed object streams, ordinary page sizes, and full-resolution images.
|
|
68
|
+
*/
|
|
62
69
|
export async function carouselPdf(pngs, year, tool = "Claude Code") {
|
|
63
70
|
const doc = await PDFDocument.create();
|
|
64
|
-
|
|
71
|
+
const title = `My ${year} with ${tool}`;
|
|
72
|
+
doc.setTitle(title);
|
|
73
|
+
doc.setSubject(`${title}, made with wrapt`);
|
|
65
74
|
doc.setCreator("wrapt");
|
|
66
75
|
doc.setProducer("wrapt");
|
|
76
|
+
doc.setLanguage("en");
|
|
67
77
|
for (const png of pngs) {
|
|
68
78
|
const img = await doc.embedPng(png);
|
|
69
|
-
const
|
|
70
|
-
|
|
79
|
+
const w = img.width * PDF_SCALE;
|
|
80
|
+
const h = img.height * PDF_SCALE;
|
|
81
|
+
const page = doc.addPage([w, h]);
|
|
82
|
+
page.drawImage(img, { x: 0, y: 0, width: w, height: h });
|
|
71
83
|
}
|
|
72
|
-
return doc.save();
|
|
84
|
+
return doc.save({ useObjectStreams: false });
|
|
73
85
|
}
|
package/dist/share/page.js
CHANGED
|
@@ -96,8 +96,8 @@ export function sharePage(a, o) {
|
|
|
96
96
|
|
|
97
97
|
${a.carousel.length
|
|
98
98
|
? `<div class="wrap">
|
|
99
|
-
<h2>
|
|
100
|
-
<p>4:5 cards
|
|
99
|
+
<h2>Instagram carousel & LinkedIn</h2>
|
|
100
|
+
<p>4:5 cards. Post all ${a.carousel.length} as an Instagram carousel, or as a LinkedIn image post.</p>
|
|
101
101
|
<div class="actions"><button class="btn secondary" id="save-carousel" data-set="carousel">Save all ${a.carousel.length} carousel cards</button></div>
|
|
102
102
|
<div class="hint" id="hint-carousel"></div>
|
|
103
103
|
<div class="grid">${a.carousel.map((r, i) => card(r, i, "carousel")).join("")}
|
|
@@ -107,8 +107,11 @@ ${a.carousel.length
|
|
|
107
107
|
|
|
108
108
|
<div class="wrap">
|
|
109
109
|
${a.pdf
|
|
110
|
-
? `<h2>LinkedIn
|
|
111
|
-
<p>
|
|
110
|
+
? `<h2>LinkedIn</h2>
|
|
111
|
+
<p><b>Easiest:</b> post the ${a.carousel.length} carousel cards as an image post. LinkedIn shows them as a grid that opens into a swipeable viewer.</p>
|
|
112
|
+
${a.carousel.length ? `<div class="actions"><button class="btn secondary" id="save-linkedin" data-set="carousel" data-hint="linkedin">Save all ${a.carousel.length} for LinkedIn</button></div>
|
|
113
|
+
<div class="hint" id="hint-linkedin"></div>` : ""}
|
|
114
|
+
<p><b>Swipeable in the feed:</b> post the same cards as one PDF document. It takes a few more steps on LinkedIn.</p>
|
|
112
115
|
<div class="actions"><a class="btn secondary" href="${esc(dl(a.pdf))}" download>Download linkedin.pdf</a></div>`
|
|
113
116
|
: ""}
|
|
114
117
|
${a.xCard
|
|
@@ -122,7 +125,8 @@ ${a.carousel.length
|
|
|
122
125
|
<ol>
|
|
123
126
|
<li><b>Instagram Story.</b> Post the 8 story cards in order as one story. On the last card, add a <b>link sticker</b> with ${esc(SITE_URL)} so people can tap through and make their own. Afterwards, add them to a Highlight called “${o.year}” so they stay on your profile.</li>
|
|
124
127
|
<li><b>Instagram carousel.</b> New post → select multiple → choose carousel cards 01–08 in order. The 4:5 size fills the feed. Put ${esc(SITE)} in your bio, since links in captions can't be tapped.</li>
|
|
125
|
-
<li><b>LinkedIn.</b> Start a post →
|
|
128
|
+
<li><b>LinkedIn, easiest.</b> Start a post → add photos → pick the ${a.carousel.length} carousel cards in order → add the caption below → Post.</li>
|
|
129
|
+
<li><b>LinkedIn, swipeable.</b> Start a post → “Add a document” → upload linkedin.pdf → give it a title → Post. It shows as a carousel people swipe in the feed.</li>
|
|
126
130
|
<li><b>X.</b> Attach x-card.png to a post.</li>
|
|
127
131
|
</ol>
|
|
128
132
|
|
|
@@ -154,7 +158,7 @@ ${a.carousel.length
|
|
|
154
158
|
var ua = navigator.userAgent;
|
|
155
159
|
var iOS = /iPhone|iPad|iPod/.test(ua) || (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1);
|
|
156
160
|
|
|
157
|
-
function
|
|
161
|
+
function showHint(name, html) {
|
|
158
162
|
var el = document.getElementById("hint-" + name);
|
|
159
163
|
if (el) { el.innerHTML = html; el.classList.add("show"); }
|
|
160
164
|
}
|
|
@@ -194,6 +198,8 @@ ${a.carousel.length
|
|
|
194
198
|
btn.addEventListener("click", async function () {
|
|
195
199
|
var name = btn.getAttribute("data-set");
|
|
196
200
|
var urls = sets[name];
|
|
201
|
+
var where = btn.getAttribute("data-hint") || name;
|
|
202
|
+
var hint = function (_, html) { showHint(where, html); };
|
|
197
203
|
btn.disabled = true;
|
|
198
204
|
try {
|
|
199
205
|
// On a phone over HTTPS, the share sheet saves every card straight to Photos in one go.
|
package/dist/site.js
CHANGED
|
@@ -2,6 +2,12 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
/** Where people go to make their own wrapt. Shown on the cards and in share captions. */
|
|
3
3
|
export const SITE = "wrapt.cc";
|
|
4
4
|
export const SITE_URL = `https://${SITE}`;
|
|
5
|
+
/** wrapt's creator, credited on the last card unless the user passes `render --no-credit`. */
|
|
6
|
+
export const CREATOR = {
|
|
7
|
+
name: "Mayank Agarwal",
|
|
8
|
+
linkedin: "in/whomayankagarwal",
|
|
9
|
+
instagram: "@whomayankagarwal",
|
|
10
|
+
};
|
|
5
11
|
const require = createRequire(import.meta.url);
|
|
6
12
|
// qrcode-terminal ships a plain QR encoder; reuse it rather than adding another dependency.
|
|
7
13
|
const QRCode = require("qrcode-terminal/vendor/QRCode/index.js");
|
|
@@ -43,7 +49,7 @@ export function captions(year, tool = "Claude Code") {
|
|
|
43
49
|
},
|
|
44
50
|
{
|
|
45
51
|
platform: "LinkedIn",
|
|
46
|
-
tip: "Paste this as the post text above linkedin.pdf.",
|
|
52
|
+
tip: "Paste this as the post text above your 8 carousel images, or above linkedin.pdf.",
|
|
47
53
|
text: `My ${year} with ${tool}, in eight cards. wrapt reads your ${tool} history on your own computer ` +
|
|
48
54
|
`and turns it into a year in review. Nothing is uploaded.\n\nMake yours: ${SITE_URL}`,
|
|
49
55
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wrapt-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Your year with Claude Code and GitHub Copilot, wrapped. Share cards made on your own computer.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,6 +41,12 @@
|
|
|
41
41
|
"./package.json": "./package.json"
|
|
42
42
|
},
|
|
43
43
|
"homepage": "https://wrapt.cc",
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git+https://github.com/m-scudder/wrapt.git",
|
|
47
|
+
"directory": "packages/cli"
|
|
48
|
+
},
|
|
49
|
+
"bugs": "https://github.com/m-scudder/wrapt/issues",
|
|
44
50
|
"keywords": [
|
|
45
51
|
"claude",
|
|
46
52
|
"claude-code",
|