Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</p>

<p align="center">
<img src="https://raw.githubusercontent.com/WireCatLabs/cli-template/main/kit/images/new.gif" alt="new --spec-url turns PokeAPI's description into 102 commands, answers a real call and starts an MCP server" width="700">
<img src="https://raw.githubusercontent.com/WireCatLabs/cli-template/main/kit/images/new.gif" alt="new --spec-url turns Notion's own OpenAPI description into a CLI: the files it writes, its commands and their help" width="800">
</p>

<p align="center">
Expand Down
Binary file modified kit/images/new.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion kit/images/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)`)
51 changes: 28 additions & 23 deletions kit/images/src/new.tape
Original file line number Diff line number Diff line change
@@ -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
Loading