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, and no proxy. An app starts
here and sets only what differs. Pitboard’s own directory is the system’s default for
home, the home handed in and never this account’s own.
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
Claude Code’s config directory, as CLAUDE_CONFIG_DIR names it. Empty is kept, as
Claude Code keeps it: unset for its config file and its credential slot’s name, but
the empty path for its config dir, as the register’s config_file_location says,
which is refused as a home that is not a full path.
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 started_by_the_schedule(self) -> Context
pub fn started_by_the_schedule(self) -> Context
Say this process is a run of the daily renewal schedule, as the marker its job is
started with says where what the system says of the job it started is not to be
relied on: the command line does this for pitboard renew --scheduled. Such a run
renews the default home whatever PITBOARD_HOME says
(crate::schedule::SCHEDULED_RUN).
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.
Sourcepub fn for_command_line(env: &Environment) -> Context
pub fn for_command_line(env: &Environment) -> Context
The command line’s context, from the environment it was started with: a shell’s, so
each tool’s program is looked for on its PATH when it runs.