feat(cli): load Config in run() and inject resolvers into cmd_show - #193
Open
ecalifornica wants to merge 1 commit into
Open
feat(cli): load Config in run() and inject resolvers into cmd_show#193ecalifornica wants to merge 1 commit into
ecalifornica wants to merge 1 commit into
Conversation
) run() extracts one Config and passes &Config to cmd_show. The providers module builds each provider's PathResolver from Config::home_dir(). opencode, copilot, and cursor (Windows) get their directory injected, since their internal env reads win against with_home. cmd_show constructs every provider via with_resolver.
|
🔍 Preview deployed: https://a5a8be23.toolpath.pages.dev |
This was referenced Aug 13, 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.
Part of #184 (PR 2 of the plan there). Stacked on #191. path-cli only.
What
run()loads oneConfigafter clap parsing and passes&Configtocmd_show. No other command takes it yet.providersmodule: one function per provider builds itsPathResolverfromConfig::home_dir(). Call sites chain per-site overrides onto the result.with_data_dir,with_copilot_dir): their internal$XDG_DATA_HOME/$COPILOT_HOMEreads win againstwith_home, and only an injected directory wins against the read. cursor gets$APPDATA\Cursorinjected on Windows only; its resolver consults$APPDATAonly there.opencodeandCursorpath segments in the CLI. Proposal to move them back into the crates: Remove env reads from the provider crates #185 (comment)cmd_showconstructs every provider viawith_resolver. The pi arm chainswith_sessions_dirwhen--baseis given, so--basewins over the injected home.providersis compiled out on emscripten, likecmd_show. opencode and cursor are not dependencies on that target.Behavior change
show pi, Windows only: the CLI injectsConfig::home_dir(), which falls back to$USERPROFILE. The pi resolver's internal lookup reads$HOMEonly (pi: resolver home lookup ignores $USERPROFILE #192). With$HOMEunset,show piresolves%USERPROFILE%\.pi\agent\sessions.Tests
providerstests pin each resolver path to config-supplied values. Assertions stay on paths fully determined by injected values; resolver defaults that read the ambient environment are not asserted.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.