Repository navigation
rust(feat): read the sift-cli config file from SIFT_CONFIG_FILE - #893
Merged
Merged
Conversation
bijan-sift
approved these changes
Nov 17, 2026
alexluck-sift
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
sift-cli finds
sift.tomlonly throughdirs::config_dir(). In Sift Agents the session'ssift.tomllives in a private temp directory because the root filesystem is read-only, and today the only way to point sift-cli at it isXDG_CONFIG_HOME, which redirects config for every tool in the agent's shell.sift_clientalready readsSIFT_CONFIG_FILE(config_file_pathinpython/lib/sift_client/_internal/credentials.py), so sift-cli now does too.SIFT_CONFIG_FILEwins when it is set and non-empty, and its path is used as given, with no~expansion. Otherwise sift-cli usessift.tomlin the user config directory, as before. This matchessift_client. Every command resolves the file throughget_config_file_path, soconfig createandconfig updatewrite to that path, and every message that prints the path shows it.load_config, which returnsNoneonly for a missing file. Any other failure names the path and keeps the OS error. Before, API commands printed only "failed to read config file", and a directory at the path madeconfig createreport an existing file.write_configerrors name the directory or file that could not be created or written.config createstill creates missing parent directories.The single loader changes a few messages. Non-interactive
config createon a file that isn't valid TOML now reports the parse error instead of "already exists".config whereerrors on an unreadable file instead of printing its path. Parse errors now read "config file '' is invalid TOML" everywhere.agent installdoesn't pass the variable to MCP clients, sosift-cli mcpsees it only when the client runs with it set. In Sift Agents the MCP server inherits the agent server's environment, so that case needs no changes.Follow-ups, out of scope here:
sift_connect'sCredentials::Profileloader still readsdirs::config_local_dir()/sift.tomland ignores the variable, andwrite_configwrites the file as 0644 and not atomically.Verification
Unit tests cover
SIFT_CONFIG_FILEset, empty, and unset, the loader on a missing file, a file, and a directory, and parent directory creation.cargo fmt --check --all,cargo clippy --all-features, andcargo test --all-featurespass (1,410 tests).Manual run of a debug build, with
<dir>standing in for a temp directory (output trimmed):