tufty.aitufty.ai CLI
CLI

Global Flags

Flags, environment variables and the tool manifest cache shared by every command.

Flags

FlagDescription
--api-key <key>API key for this command; overrides TUFTY_API_KEY and the config file
--base-url <url>API base URL; overrides TUFTY_BASE_URL. Defaults to https://tufty.ai
-l, --lang <locale>Output language: en-US or zh-CN. Saved to the config file and reused without -l
--verbosePrint debug logs to stderr
--refresh-manifestSkip the 10-minute local manifest cache and fetch from the server
-V, --versionPrint the version
-h, --helpShow help; after a command, show that command's help
tufty --lang en-US tools list
tufty --refresh-manifest pet-dressup -h
tufty --api-key sk-xxxx status 3f6c2a1e-8b4d-4e7a-9c55-0d2b7e1f4a90

The language isn't just for messages: the CLI fetches the tool manifest in that language, so tool names, descriptions and help text switch too.

Environment variables

VariableDescription
TUFTY_API_KEYAPI key
TUFTY_BASE_URLAPI base URL, https://tufty.ai by default
TUFTY_CONFIG_DIRConfig and cache directory, ~/.tufty by default
TUFTY_LANGOutput language, en-US or zh-CN

How the language is chosen

  1. -l / --lang
  2. TUFTY_LANG
  3. The language saved in the config file (written by -l)
  4. The system's LC_ALL and LANG
  5. en-US

Config directory

~/.tufty/ (or the directory in TUFTY_CONFIG_DIR) contains:

FileContents
config.jsonThe API key (TUFTY_API_KEY) and the saved language (lang)
manifest-<locale>.jsonThe tool manifest cache for that language

Tool manifest cache

  • A cache younger than 10 minutes is used as-is.
  • An expired or missing cache is refreshed synchronously (5-second timeout); if that fails, the expired cache is used.
  • With no network and no cache, tool commands can't be registered and the CLI returns manifest_unavailable.

The cache records which --base-url it came from, so switching servers never mixes them up.

On this page