Docs: Cost tracking in CLI (#4043)

This commit is contained in:
Emma Youndtsmith
2025-08-12 12:30:36 -05:00
committed by GitHub
parent b0d3c7ddad
commit 086c4ead03
3 changed files with 17 additions and 8 deletions
+1
View File
@@ -32,6 +32,7 @@ The following settings can be configured at the root level of your config.yaml f
| `GOOSE_TOOLSHIM_OLLAMA_MODEL` | Model for tool interpretation | Model name (e.g., "llama3.2") | System default | No |
| `GOOSE_CLI_MIN_PRIORITY` | Tool output verbosity | Float between 0.0 and 1.0 | 0.0 | No |
| `GOOSE_CLI_THEME` | [Theme](/docs/guides/goose-cli-commands#themes) for CLI response markdown | "light", "dark", "ansi" | "dark" | No |
| `GOOSE_CLI_SHOW_COST` | Show estimated cost for token use in the CLI | true/false | false | No |
| `GOOSE_ALLOWLIST` | URL for allowed extensions | Valid URL | None | No |
| `GOOSE_RECIPE_GITHUB_REPO` | GitHub repository for recipes | Format: "org/repo" | None | No |
@@ -111,6 +111,7 @@ These variables control how Goose manages conversation sessions and context.
| `GOOSE_SCHEDULER_TYPE` | Controls which scheduler Goose uses for [scheduled recipes](/docs/guides/recipes/session-recipes.md#schedule-recipe) | "legacy" or "temporal" | "legacy" (Goose's built-in cron scheduler) |
| `GOOSE_TEMPORAL_BIN` | Optional custom path to your Temporal binary | /path/to/temporal-service | None |
| `GOOSE_RANDOM_THINKING_MESSAGES` | Controls whether to show amusing random messages during processing | "true", "false" | "true" |
| `GOOSE_CLI_SHOW_COST` | Toggles display of model cost estimates in CLI output | "true", "1" (case insensitive) to enable | false |
**Examples**
@@ -141,6 +142,9 @@ export GOOSE_TEMPORAL_BIN=/path/to/temporal-service
# Disable random thinking messages for less distraction
export GOOSE_RANDOM_THINKING_MESSAGES=false
# Enable model cost display in CLI
export GOOSE_CLI_SHOW_COST=true
```
### Model Context Limit Overrides
@@ -181,7 +185,6 @@ These variables control how Goose handles [tool permissions](/docs/guides/managi
| `GOOSE_TOOLSHIM_OLLAMA_MODEL` | Specifies the model for [tool call interpretation](/docs/experimental/ollama) | Model name (e.g. llama3.2, qwen2.5) | System default |
| `GOOSE_CLI_MIN_PRIORITY` | Controls verbosity of [tool output](/docs/guides/managing-tools/adjust-tool-output) | Float between 0.0 and 1.0 | 0.0 |
| `GOOSE_CLI_TOOL_PARAMS_TRUNCATION_MAX_LENGTH` | Maximum length for tool parameter values before truncation in CLI output (not in debug mode) | Integer | 40 |
| `GOOSE_CLI_SHOW_COST` | Toggles display of model cost estimates in CLI output | "true", "1" (case insensitive) to enable | false |
**Examples**
@@ -192,9 +195,6 @@ export GOOSE_TOOLSHIM_OLLAMA_MODEL=llama3.2
export GOOSE_MODE="auto"
export GOOSE_CLI_MIN_PRIORITY=0.2 # Show only medium and high importance output
export GOOSE_CLI_TOOL_PARAMS_MAX_LENGTH=100 # Show up to 100 characters for tool parameters in CLI output
# Enable model cost display in CLI
export GOOSE_CLI_SHOW_COST=true
```
### Enhanced Code Editing
@@ -350,7 +350,7 @@ export GOOSE_PLANNER_CONTEXT_LIMIT=1000000
```
## Cost Tracking
Display estimated real-time costs of your session at the bottom of the Goose Desktop window.
Display real-time estimated costs of your session.
<Tabs groupId="interface">
<TabItem value="ui" label="Goose Desktop" default>
@@ -360,13 +360,21 @@ To manage live cost tracking:
3. Click the `App` tab
4. Toggle `Cost Tracking` on/off
The session cost updates dynamically as tokens are consumed. Hover over the cost to see a detailed breakdown of token usage. If multiple models are used in the session, this includes a cost breakdown by model. Ollama and local deployments always show a cost of $0.00.
The session cost is shown at the bottom of the Goose window and updates dynamically as tokens are consumed. Hover over the cost to see a detailed breakdown of token usage. If multiple models are used in the session, this includes a cost breakdown by model. Ollama and local deployments always show a cost of $0.00.
Pricing data is regularly fetched from the OpenRouter API and cached locally. The `Advanced settings` tab shows when the data was last updated and allows you to refresh.
These costs are estimates only, and not connected to your actual provider bill. The cost shown is an approximation based on token counts and public pricing data.
</TabItem>
<TabItem value="cli" label="Goose CLI">
Cost tracking is [not yet available](https://github.com/block/goose/issues/3206) in the Goose CLI.
</TabItem>
Show estimated cost in the Goose CLI by setting the `GOOSE_CLI_SHOW_COST` [environment variable](/docs/guides/environment-variables.md#session-management) or including it in the [configuration file](/docs/guides/config-file.md).
```
# Set environment variable
export GOOSE_CLI_SHOW_COST=true
# config.yaml
GOOSE_CLI_SHOW_COST: true
```
</TabItem>
</Tabs>