Skip to content

Commit 4f9366b

Browse files
committed
Add FREBUFF_MODE as a cli env var
1 parent 02d73ac commit 4f9366b

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

cli/src/testing/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ export const createTestCliEnv = (overrides: Partial<CliEnv> = {}): CliEnv => ({
4141
CODEBUFF_CLI_TARGET: undefined,
4242
CODEBUFF_RG_PATH: undefined,
4343
CODEBUFF_SCROLL_MULTIPLIER: undefined,
44+
FREEBUFF_MODE: undefined,
4445
...overrides,
4546
})

cli/src/types/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export type CliEnv = BaseEnv & {
6969
CODEBUFF_RG_PATH?: string
7070
CODEBUFF_SCROLL_MULTIPLIER?: string
7171
CODEBUFF_PERF_TEST?: string
72+
FREEBUFF_MODE?: string
7273
}
7374

7475
/**

cli/src/utils/constants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import type { ToolName } from '@codebuff/sdk'
22

3+
import { getCliEnv } from './env'
4+
35
/**
46
* Freebuff build-time flag. When true, the CLI is built as Freebuff (free-only variant).
57
* Injected via --define at compile time; enables dead-code elimination by the bundler.
68
*/
7-
export const IS_FREEBUFF = process.env.FREEBUFF_MODE === 'true'
9+
export const IS_FREEBUFF = getCliEnv().FREEBUFF_MODE === 'true'
810

911
// Agent IDs that should not be rendered in the CLI UI
1012
export const HIDDEN_AGENT_IDS = ['codebuff/context-pruner'] as const

cli/src/utils/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export const getCliEnv = (): CliEnv => ({
6969
CODEBUFF_RG_PATH: process.env.CODEBUFF_RG_PATH,
7070
CODEBUFF_SCROLL_MULTIPLIER: process.env.CODEBUFF_SCROLL_MULTIPLIER,
7171
CODEBUFF_PERF_TEST: process.env.CODEBUFF_PERF_TEST,
72+
FREEBUFF_MODE: process.env.FREEBUFF_MODE,
7273
})
7374

7475
/**

0 commit comments

Comments
 (0)