Inspect configuration
Use these commands to inspect local settings.Configuration file path
Print the configuration file path.~/.config/costgraph/config.toml.
Effective settings
Print the effective settings and their sources.One setting
To read one setting, pass its name.Set a file value
Create a configuration file with defaults if you do not already have one.--force option replaces that file with defaults.
The following command changes the saved default output format.
costgraph config list to check which value applies.
Configure a self-hosted deployment
SetCOSTGRAPH_API_URL before signing in or creating an API key. Use your deployment’s API address, rather than its dashboard address.
COSTGRAPH_API_URL does not change COSTGRAPH_PRICING_URL.
Supported settings
The following table maps file settings to their environment variables.
For a setting with a command-line flag, the flag takes precedence over its environment variable and file value. For example,
-o table overrides COSTGRAPH_OUTPUT=json. There is no global --api-url flag.
Use COSTGRAPH_API_KEY or your CI secret store instead of saving a key in the configuration file. A saved browser session takes precedence over the API key. Refer to Credentials for how the CLI chooses its credential.
Select configuration and credential files
The following options control where the CLI reads its files.
If these directory overrides are absent, the CLI uses
~/.config/costgraph. Credentials default to credentials.toml in that directory. Changing --config alone does not select a different saved browser session.
To use a separate configuration file for a command, pass its path.
Choose an output format
Data commands such ascost get, tags list, and recommendations list support table and json output. Add -o json for structured data.
config path and config get print a path or value. Completion commands print a shell script. Cost-estimate commands also have format-specific options. Check the Command reference rather than assuming every command returns JSON.
During sign-in and key approval, browser instructions go to standard error so a script can capture the JSON result from standard output. Refer to Capture the key in a script.
Generate shell completion
The CLI generates completion scripts for Bash, fish, PowerShell, and zsh. The following command writes a zsh completion script to a local file.costgraph completion zsh --help for the instructions for your system. Replace zsh with bash, fish, or powershell for the other supported scripts.
Disable usage telemetry
To disable CLI telemetry for the current shell, set the following variable.telemetry.enabled to false in the file. DO_NOT_TRACK=true disables telemetry even when another setting enables it.
Check the installed release
Run the following command to print the installed version.Command reference
Commands are shown without thecostgraph prefix. Add --help for the complete flag list.
Read local settings
Run each command with thecostgraph prefix.
Write local settings
These commands change the local configuration file.Shell completion and version
Completion commands print scripts. Follow each command’s--help to install its output.