Creating profiles
Each profile stores a token and API URL for a specific project or environment. When you first rancontree auth, it created a profile
called default. Add more with --profile:
~/.config/contree/auth.ini.
The resulting config file looks like this:
[profile:NAME] section with token, url, type,
and project keys. The [DEFAULT] section stores the name of the active
profile.
Listing profiles
See all saved profiles and which one is active:auth ls verifies each profile against the API with a 2-second timeout.
Possible status values:
ok— token is valid and has the required sandbox permissiontimeout— server did not respond in timeerror— bad token or network erroroffline mode— you passed-O/--offlineno url— the profile has no API URL configured (re-runcontree auth)inactive— token authenticates, but the configured project does not grant the sandbox permission this CLI needs
Switching profiles
Persistent switch
Change the active profile for all future commands:Per-command override
Use-p / --profile on any command:
Environment variable
Override for the entire shell session:Inline token
Pass--token and --url directly:
Removing profiles
Delete a profile and its session database:Profiles and sessions
Each profile has its own session database (~/.config/contree/sessions-{profile}.db), so:
- Same profile, same terminal — resumes the existing session
- Different profile, same terminal — different session, different data
default to personal does not affect your default
sessions — you can switch back and continue where you left off.
Data storage
All data lives inCONTREE_HOME (default $XDG_CONFIG_HOME/contree,
falling back to ~/.config/contree when XDG_CONFIG_HOME is unset):
Override with
$CONTREE_HOME:
cli.ini
cli.ini is meant for hand-editing. Create it yourself; the CLI never
writes to it. Two kinds of sections are supported:
[cli] section: per-flag defaults
Keys here become argparse defaults. Use the argparse dest name (not
the flag name):
Example:
cli.ini > built-in
default. A cli.ini setting always loses to an explicit flag.
[profile:NAME] sections: CLI-scoped profiles
cli.ini accepts the same [profile:NAME] sections as auth.ini and
supports the same fields:
The two files are merged at load time and
auth.ini wins on conflict.
What cli.ini is for: profiles (or any field, including token) you
want only the contree CLI to see. The CLI merges cli.ini with
auth.ini. Other contree-related tooling that talks to the API
directly (the SDK, the MCP server) reads only auth.ini. Use
cli.ini when you need a profile that should be invisible to those
direct-API consumers, or to keep auth.ini minimal and shared.
Example, CLI-only profile alongside the shared one:
profile key in
[DEFAULT] of auth.ini (or by --profile / $CONTREE_PROFILE).
Environment variables
Read at runtime by any command:
Read only by
contree auth (registration-time fallbacks for omitted flags):
Resolution precedence
For token, URL, and project at runtime:- CLI flag (
--token,--url,--project) — overrides profile for the current invocation only - Saved profile field
- Built-in default URL for IAM:
https://api.tokenfactory.nebius.com/sandboxes
contree auth (which reads
CONTREE_TOKEN / NEBIUS_API_KEY, CONTREE_URL, and CONTREE_PROJECT /
NEBIUS_AI_PROJECT as fallbacks for the corresponding flags).
For profiles:
-p/--profileflagCONTREE_PROFILEenvironment variableprofilekey in config[DEFAULT]section- Falls back to
default
See auth - Configure credentials and profiles for the full auth command reference, or Command Reference for all commands.