tmf save — Save Template
Syntax
bash
tmf save <name> --baseUrl <url> --key <api-key> [options]Description
tmf save creates a reusable parameter template that can later be invoked by tmf use <name>. Templates are ideal for:
- Frequently-used provider configurations (e.g. your self-hosted Ollama setup)
- Sharing configurations across team members (templates are stored in
~/.tmf/templates/) - Quick switching between different models or endpoints without re-entering parameters
When a template exists with the same name as a provider, tmf use will apply the template instead of querying the Provider API.
Options
| Option | Description |
|---|---|
--app <app> | Target application (optional — can be overridden at use time) |
--baseUrl <url> | Required. Base URL for the API endpoint |
-k, --key <api-key> | Required. API key |
-m, --model <model> | Single model name |
--models <models...> | Multiple models: opus=X,sonnet=Y,haiku=Z or positional |
--env <env...> | Custom env vars to set (KEY=VALUE format) |
--effort <level> | Effort level: low, medium, high, xhigh |
Examples
bash
# Save a template for a self-hosted Ollama instance
tmf save ollama --baseUrl http://localhost:11434/v1 --key ollama --model llama3
# Save a DeepSeek template with role-based models for Claude Code
tmf save deepseek --app claude-code --baseUrl https://api.deepseek.com/v1 --key sk-xxx \
--models opus=deepseek-v4-pro,sonnet=deepseek-v4-pro,haiku=deepseek-v4-flash
# Save a generic OpenAI-compatible template
tmf save myproxy --baseUrl https://proxy.example.com/v1 --key sk-xxxUsing Templates
Once saved, templates are automatically matched by tmf use:
bash
# Apply the "ollama" template to all detected apps
tmf use ollama
# Apply the "deepseek" template (overrides --app if template has one)
tmf use deepseek
# Apply template but override the model at runtime
tmf use deepseek --model deepseek-v4-flashCLI options (--key, --model, --models, --env, --effort, --app) take precedence over template values.
Template Storage
Templates are stored in ~/.tmf/templates/ as a JSON file. You can edit them directly or share them across machines.
