diff --git a/README.md b/README.md index bee1dc9..15cd313 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@

- new --spec-url turns PokeAPI's description into 102 commands, answers a real call and starts an MCP server + new --spec-url turns Notion's own OpenAPI description into a CLI: the files it writes, its commands and their help

diff --git a/kit/images/new.gif b/kit/images/new.gif index 0e08d42..b687a59 100644 Binary files a/kit/images/new.gif and b/kit/images/new.gif differ diff --git a/kit/images/render.ts b/kit/images/render.ts index 3d3bbf2..f6eeca5 100644 --- a/kit/images/render.ts +++ b/kit/images/render.ts @@ -61,6 +61,6 @@ if (has("vhs") && has("ttyd")) { if (local) rmSync(local, { recursive: true, force: true }) } if (has("gifsicle")) - execFileSync("gifsicle", ["-O3", "--lossy=80", "--colors", "64", "--resize-width", "700", "-b", GIF]) + execFileSync("gifsicle", ["-O3", "--lossy=80", "--colors", "64", "--resize-width", "1000", "-b", GIF]) console.error(`${GIF}: ${Math.round(statSync(GIF).size / 1024)} KB`) } else console.error(`skipped ${TAPE}: vhs needs ttyd (https://github.com/charmbracelet/vhs#installation)`) diff --git a/kit/images/src/new.tape b/kit/images/src/new.tape index adbce85..b534b47 100644 --- a/kit/images/src/new.tape +++ b/kit/images/src/new.tape @@ -1,44 +1,49 @@ -# From a public API description to a CLI that answers and an MCP server that starts. Rendered by kit/images/render.ts -# into kit/images/new.gif. Everything runs in a fresh temporary folder that is also HOME, out of reach of the keyring, -# with no sign-in: PokeAPI needs none. With KIT_BIN set (render.ts --local), npx runs this checkout's kit. +# From Notion's own OpenAPI description to a CLI with one command per operation, an MCP server and an agent skill. +# Rendered by kit/images/render.ts into kit/images/new.gif. Everything runs in a fresh temporary folder that is also +# HOME, out of reach of the keyring, with no sign-in. With KIT_BIN set (render.ts --local), npx runs this checkout's kit. +# Only the waiting for pnpm install and pnpm generate is cut; `time` prints how long it took. Output kit/images/new.gif Set Shell "bash" -Set FontSize 20 +Set FontSize 15 Set Width 1280 -Set Height 700 +Set Height 720 Set Padding 24 Set Theme "TokyoNight" -Set TypingSpeed 20ms +Set TypingSpeed 15ms Set WindowBar Colorful Hide -Type `export npm_config_cache="$(npm config get cache)" pnpm_config_store_dir="$(cd ~ && pnpm store path)" COREPACK_HOME="${COREPACK_HOME:-$HOME/.cache/node/corepack}"` Enter +Type `export npm_config_yes=true npm_config_cache="$(npm config get cache)" pnpm_config_store_dir="$(cd ~ && pnpm store path)" COREPACK_HOME="${COREPACK_HOME:-$HOME/.cache/node/corepack}"` Enter Type `[ -z "$KIT_BIN" ] || npx() { if [ "$1" = @wirecat/cli-template ]; then shift; node "$KIT_BIN" "$@"; else command npx "$@"; fi; }` Enter -Type `cd "$(mktemp -d /tmp/acme.XXXX)" && export HOME="$PWD" XDG_CONFIG_HOME="$PWD/.config" XDG_DATA_HOME="$PWD/.local/share" XDG_STATE_HOME="$PWD/.local/state" XDG_CACHE_HOME="$PWD/.cache" DBUS_SESSION_BUS_ADDRESS="disabled:" PS1='$ '` Enter +Type `cd "$(mktemp -d /tmp/acme.XXXX)" && export HOME="$PWD" XDG_CONFIG_HOME="$PWD/.config" XDG_DATA_HOME="$PWD/.local/share" XDG_STATE_HOME="$PWD/.local/state" XDG_CACHE_HOME="$PWD/.cache" DBUS_SESSION_BUS_ADDRESS="disabled:" PS1='$ ' TIMEFORMAT='done in %0Rs'` Enter Type "clear" Enter Show -Type "npx @wirecat/cli-template new poke-cli --preset generic --owner example --sign-in none \" Enter -Type " --spec-url https://raw.githubusercontent.com/PokeAPI/pokeapi/d19c710/openapi.yml | head -2" Enter -Wait@60s /\$$/ -Sleep 2s +Type "npx @wirecat/cli-template new notion-cli --preset generic --owner acme --sign-in token \" Enter +Type " --spec-url https://raw.githubusercontent.com/makenotion/notion-mcp-server/cf16e5c/scripts/notion-openapi.json" Enter +Wait+Screen@90s /fails until step 1 is done/ +Sleep 6s -Type "cd poke-cli && time (pnpm install --silent && pnpm generate >/dev/null 2>&1)" Enter -Wait@120s /\$$/ +Type "clear" Enter +Type "cd notion-cli && time (pnpm install --silent && pnpm generate > /dev/null 2>&1)" Enter +Hide +Wait+Screen@180s /done in/ +Show Sleep 1s -Type `node dist/bin/poke.js api list --json 2>/dev/null | grep -o '"command"' | wc -l` Enter -Wait@20s /\$$/ -Sleep 2s -Type "node dist/bin/poke.js personal api pokemon-get --id pikachu --json=name,height,weight" Enter -Wait@20s /\$$/ -Sleep 3s +Type "ls spec/notion src/generated skills/acme-notion-cli/references/api" Enter +Wait+Screen@10s /api-pages.md/ +Sleep 5s -Type "node dist/bin/poke.js personal mcp check" Enter -Wait@20s /\$$/ -Sleep 4s +Type "clear" Enter +Type "node dist/bin/notion.js api list tag:Pages" Enter +Sleep 6s + +Type "clear" Enter +Type "node dist/bin/notion.js personal api pages-markdown-list --help" Enter +Sleep 7s Hide Type `cd /tmp && rm -rf "$HOME"` Enter