Download packages/cli/src/ui/noninteractive/nonInteractiveUi.ts from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/noninteractive/nonInteractiveUi.ts
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/cli/src/ui/noninteractive/nonInteractiveUi.ts
-
curl -L -o nonInteractiveUi.ts https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/noninteractive/nonInteractiveUi.ts
1.54 kB
| /** | |
| * @license | |
| * Copyright 2025 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import type { CommandContext } from '../commands/types.js'; | |
| import type { ExtensionUpdateAction } from '../state/extensions.js'; | |
| /** | |
| * Creates a UI context object with no-op functions. | |
| * Useful for non-interactive environments where UI operations | |
| * are not applicable. | |
| */ | |
| export function createNonInteractiveUI(): CommandContext['ui'] { | |
| return { | |
| addItem: (item, _timestamp) => { | |
| if ('text' in item && item.text) { | |
| if (item.type === 'error') { | |
| process.stderr.write(`Error: ${item.text}\n`); | |
| } else if (item.type === 'warning') { | |
| process.stderr.write(`Warning: ${item.text}\n`); | |
| } else if (item.type === 'info') { | |
| process.stdout.write(`${item.text}\n`); | |
| } | |
| } | |
| return 0; | |
| }, | |
| clear: () => {}, | |
| setDebugMessage: (_message) => {}, | |
| loadHistory: (_newHistory) => {}, | |
| pendingItem: null, | |
| setPendingItem: (_item) => {}, | |
| toggleCorgiMode: () => {}, | |
| toggleDebugProfiler: () => {}, | |
| toggleVimEnabled: async () => false, | |
| reloadCommands: () => {}, | |
| openAgentConfigDialog: () => {}, | |
| extensionsUpdateState: new Map(), | |
| dispatchExtensionStateUpdate: (_action: ExtensionUpdateAction) => {}, | |
| addConfirmUpdateExtensionRequest: (_request) => {}, | |
| setConfirmationRequest: (_request) => {}, | |
| removeComponent: () => {}, | |
| toggleBackgroundTasks: () => {}, | |
| toggleShortcutsHelp: () => {}, | |
| toggleVoiceMode: () => {}, | |
| }; | |
| } | |