diff options
| author | Allen Hutchison <[email protected]> | 2025-04-22 18:32:03 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-22 18:32:03 -0700 |
| commit | 9bc9c6e6c5b389fc72f9fcdb4452a50c37dc903e (patch) | |
| tree | 02bf39a79ff9b8d11ef10f435f09a8539842e024 /packages/cli/src/gemini.ts | |
| parent | ef7dcdb49ebc79f9d3cda5708a3ca4488a1899dc (diff) | |
Question flag (#125)
Diffstat (limited to 'packages/cli/src/gemini.ts')
| -rw-r--r-- | packages/cli/src/gemini.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/cli/src/gemini.ts b/packages/cli/src/gemini.ts index 56a44e30..0579f059 100644 --- a/packages/cli/src/gemini.ts +++ b/packages/cli/src/gemini.ts @@ -13,9 +13,10 @@ import { GeminiClient } from '@gemini-code/server'; async function main() { const config = loadCliConfig(); + let input = config.getQuestion(); - // Render UI, passing necessary config values and initial input - if (process.stdin.isTTY) { + // Render UI, passing necessary config values. Check that there is no command line question. + if (process.stdin.isTTY && input?.length === 0) { render( React.createElement(App, { config, @@ -24,7 +25,11 @@ async function main() { return; } - const input = await readStdin(); + // If not a TTY, read from stdin + // This is for cases where the user pipes input directly into the command + if (!process.stdin.isTTY) { + input += await readStdin(); + } if (!input) { console.error('No input provided via stdin.'); process.exit(1); |
