CLI
Global Flags
Flags, environment variables and the tool manifest cache shared by every command.
Flags
| Flag | Description |
|---|---|
--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 |
--verbose | Print debug logs to stderr |
--refresh-manifest | Skip the 10-minute local manifest cache and fetch from the server |
-V, --version | Print the version |
-h, --help | Show 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-0d2b7e1f4a90The 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
| Variable | Description |
|---|---|
TUFTY_API_KEY | API key |
TUFTY_BASE_URL | API base URL, https://tufty.ai by default |
TUFTY_CONFIG_DIR | Config and cache directory, ~/.tufty by default |
TUFTY_LANG | Output language, en-US or zh-CN |
How the language is chosen
-l/--langTUFTY_LANG- The language saved in the config file (written by
-l) - The system's
LC_ALLandLANG en-US
Config directory
~/.tufty/ (or the directory in TUFTY_CONFIG_DIR) contains:
| File | Contents |
|---|---|
config.json | The API key (TUFTY_API_KEY) and the saved language (lang) |
manifest-<locale>.json | The 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.
