pub struct Context { /* private fields */ }Implementations§
Source§impl Context
impl Context
Sourcepub fn new(home: PathBuf) -> Context
pub fn new(home: PathBuf) -> Context
Claude Code’s defaults for a person whose home is home: ~/.pitboard, ~/.claude,
the default credential slot, claude looked up on PATH. An app starts here and sets
only what differs.
Sourcepub fn with_codex_home(self, dir: String) -> Context
pub fn with_codex_home(self, dir: String) -> Context
Where Codex keeps its login. Empty means unset, as Codex reads it.
pub fn with_pitboard_home(self, dir: PathBuf) -> Context
Sourcepub fn with_claude_config_dir(self, dir: String) -> Context
pub fn with_claude_config_dir(self, dir: String) -> Context
Empty means unset, as Claude Code reads CLAUDE_CONFIG_DIR.
Sourcepub fn with_secure_storage_dir(self, dir: String) -> Context
pub fn with_secure_storage_dir(self, dir: String) -> Context
Empty is set, and pins the default slot, as Claude Code reads
CLAUDE_SECURESTORAGE_CONFIG_DIR.
Sourcepub fn with_argv_fallback(self, allowed: bool) -> Context
pub fn with_argv_fallback(self, allowed: bool) -> Context
The login name whose keychain account Claude Code stores under. Allows the argument-line write for a login too large for the stdin one.
Sourcepub fn custom_oauth(&self) -> bool
pub fn custom_oauth(&self) -> bool
Whether a custom OAuth endpoint is configured, which moves Claude Code’s login.
Sourcepub fn claude_program(&self) -> &Path
pub fn claude_program(&self) -> &Path
The claude pitboard would run to sign someone in.
Sourcepub fn argv_fallback(&self) -> bool
pub fn argv_fallback(&self) -> bool
Whether the argument-line write is allowed for an oversized login.
Sourcepub fn overriding_auth(&self) -> &[String]
pub fn overriding_auth(&self) -> &[String]
Environment variables that authenticate Claude Code some other way, if any.
Sourcepub fn with_caller(self, caller: String) -> Context
pub fn with_caller(self, caller: String) -> Context
Names the front end in the audit log.
pub fn with_user(self, user: String) -> Context
Sourcepub fn with_claude_program(self, program: PathBuf) -> Context
pub fn with_claude_program(self, program: PathBuf) -> Context
An app started from Finder does not see the shell’s PATH, so it names claude itself.
Sourcepub fn with_codex_program(self, program: PathBuf) -> Context
pub fn with_codex_program(self, program: PathBuf) -> Context
The same for codex.
Sourcepub fn codex_program(&self) -> &Path
pub fn codex_program(&self) -> &Path
The codex pitboard would run to sign someone in.
Sourcepub fn with_schedule_program(self, program: PathBuf) -> Context
pub fn with_schedule_program(self, program: PathBuf) -> Context
An app is not a command line, so it names the one it comes with for the schedule to run.
Sourcepub fn schedule_program(&self) -> Option<&Path>
pub fn schedule_program(&self) -> Option<&Path>
The pitboard the daily renewal schedule is written to run, where one was named.
Sourcepub fn with_search_path(self, path: String) -> Context
pub fn with_search_path(self, path: String) -> Context
Look for a tool’s program on path, in PATH’s form, rather than on this process’s
own PATH. An app opened from Finder has only the system’s directories there, so a
tool installed through a version manager or an npm prefix is found only on the PATH
the person’s shell has, and a script it runs finds its interpreter only there.
Sourcepub fn program_for(&self, tool: ProviderId) -> &Path
pub fn program_for(&self, tool: ProviderId) -> &Path
The program named for this tool, found or not.