diff --git a/docs/cli/configuration.md b/docs/cli/configuration.md index d175aa4f..f200c5df 100644 --- a/docs/cli/configuration.md +++ b/docs/cli/configuration.md @@ -189,6 +189,15 @@ In addition to a project settings file, a project's `.gemini` directory can cont "hideTips": true ``` +- **`hideBanner`** (boolean): + - **Description:** Enables or disables the startup banner (ASCII art logo) in the CLI interface. + - **Default:** `false` + - **Example:** + + ```json + "hideBanner": true + ``` + - **`maxSessionTurns`** (number): - **Description:** Sets the maximum number of turns for a session. If the session exceeds this limit, the CLI will stop processing and start a new chat. - **Default:** `-1` (unlimited) @@ -222,6 +231,7 @@ In addition to a project settings file, a project's `.gemini` directory can cont }, "usageStatisticsEnabled": true, "hideTips": false, + "hideBanner": false, "maxSessionTurns": 10 } ``` diff --git a/packages/cli/src/config/settings.ts b/packages/cli/src/config/settings.ts index 2abe8cd8..d9e6e4c4 100644 --- a/packages/cli/src/config/settings.ts +++ b/packages/cli/src/config/settings.ts @@ -79,6 +79,7 @@ export interface Settings { // UI setting. Does not display the ANSI-controlled terminal title. hideWindowTitle?: boolean; hideTips?: boolean; + hideBanner?: boolean; // Setting for setting maximum number of user/model/tool turns in a session. maxSessionTurns?: number; diff --git a/packages/cli/src/ui/App.test.tsx b/packages/cli/src/ui/App.test.tsx index c64b526e..4b65603b 100644 --- a/packages/cli/src/ui/App.test.tsx +++ b/packages/cli/src/ui/App.test.tsx @@ -187,6 +187,10 @@ vi.mock('./components/Tips.js', () => ({ Tips: vi.fn(() => null), })); +vi.mock('./components/Header.js', () => ({ + Header: vi.fn(() => null), +})); + describe('App UI', () => { let mockConfig: MockServerConfig; let mockSettings: LoadedSettings; @@ -445,6 +449,38 @@ describe('App UI', () => { expect(vi.mocked(Tips)).not.toHaveBeenCalled(); }); + it('should display Header component by default', async () => { + const { Header } = await import('./components/Header.js'); + const { unmount } = render( + , + ); + currentUnmount = unmount; + await Promise.resolve(); + expect(vi.mocked(Header)).toHaveBeenCalled(); + }); + + it('should not display Header component when hideBanner is true', async () => { + const { Header } = await import('./components/Header.js'); + mockSettings = createMockSettings({ + user: { hideBanner: true }, + }); + + const { unmount } = render( + , + ); + currentUnmount = unmount; + await Promise.resolve(); + expect(vi.mocked(Header)).not.toHaveBeenCalled(); + }); + it('should show tips if system says show, but workspace and user settings say hide', async () => { mockSettings = createMockSettings({ system: { hideTips: false }, diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx index 6c32c1ea..cd94311b 100644 --- a/packages/cli/src/ui/App.tsx +++ b/packages/cli/src/ui/App.tsx @@ -716,11 +716,13 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { key={staticKey} items={[ -
+ {!settings.merged.hideBanner && ( +
+ )} {!settings.merged.hideTips && } , ...history.map((h) => (