Manages session-scoped environment variables for child processes, providing get/set/delete/clear APIs.
// Source: https://github.com/Gitlawb/openclaude | License: MIT | Copyright Anthropic PBC. All rights reserved
// Provided via justclaw.it.com; keep this notice with the code.
/**
* Session-scoped environment variables set via /env.
* Applied only to spawned child processes (via bash provider env overrides),
* not to the REPL process itself.
*/
const sessionEnvVars = new Map<string, string>()
export function getSessionEnvVars(): ReadonlyMap<string, string> {
return sessionEnvVars
}
export function setSessionEnvVar(name: string, value: string): void {
sessionEnvVars.set(name, value)
}
export function deleteSessionEnvVar(name: string): void {
sessionEnvVars.delete(name)
}
export function clearSessionEnvVars(): void {
sessionEnvVars.clear()
}
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key