Skip to content

Command Line

The Teak CLI lets you save, search, favorite, update, and delete cards without leaving your terminal.

Terminal window
npm i -g teak-cli

After installing, the teak command is available globally.

Terminal window
teak login

Opens your browser to authorize the CLI with your Teak account. Credentials are stored locally so you stay signed in across sessions.

Set the TEAK_API_KEY environment variable to skip interactive sign-in:

Terminal window
TEAK_API_KEY=teakapi_... teak ls --json

Generate and manage API keys in Teak Settings → Manage API Keys.

Terminal window
teak logout

Removes stored credentials from your machine.

Terminal window
teak add "A note from the terminal" --tags research
teak add --url https://example.com --tags research,web
teak add --file ./screenshot.png --notes "Inspiration" --tags inspiration
teak add --file ./component.tsx --tags source
teak ls
teak search "blue buttons"
teak cards get <card-id>
teak cards update <card-id> --tags design,reference
teak fav <card-id>
teak rm <card-id>
teak tags

teak add also accepts a bare URL or file path as the positional argument (for example teak add https://example.com) — the CLI detects whether it’s text, a URL, or a file. Use --url / --file when you want to be explicit or when scripting.

File uploads support source and design-token files, Markdown and MDX, ZIP archives, PDF and Office documents, SVG, HEIC, animated GIF, WebM/MP4, Figma .fig, and common image/audio formats up to 100 MB. The CLI infers the media and card type from the file name, so no type flag is required.

Run any command with --help to see available options:

Terminal window
teak --help
teak add --help
teak search --help

By default, commands print human-readable output. Add --json to any command for machine-readable JSON, useful for piping into jq or other tools:

Terminal window
teak search "buttons" --json | jq '.[].url'
  • Confirm the package installed globally: npm ls -g teak-cli
  • Make sure your npm global bin directory is in your PATH.

Login opens the browser but never completes

Section titled “Login opens the browser but never completes”
  • Check your internet connection.
  • Try again — the local callback server occasionally fails to start if the port is in use.
  • As a fallback, use TEAK_API_KEY with a key from Settings.
  • Run teak login to refresh your session.
  • If using TEAK_API_KEY, confirm the key is still active in Teak Settings.

Reach out via Support.