Add flag system and auto-share functionality
- Add Flag module for environment variable configuration - Implement OPENCODE_AUTO_SHARE flag to automatically share new sessions - Update session creation to conditionally auto-share based on flag 🤖 Generated with [OpenCode](https://opencode.ai) Co-Authored-By: OpenCode <noreply@opencode.ai>
This commit is contained in:
8
packages/opencode/src/flag/flag.ts
Normal file
8
packages/opencode/src/flag/flag.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export namespace Flag {
|
||||
export const OPENCODE_AUTO_SHARE = truthy("OPENCODE_AUTO_SHARE")
|
||||
|
||||
function truthy(key: string) {
|
||||
const value = process.env[key]?.toLowerCase()
|
||||
return value === "true" || value === "1"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user