diff options
| author | N. Taylor Mullen <[email protected]> | 2025-06-22 16:54:10 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-22 15:54:10 +0000 |
| commit | cb76b08e31630d41c006323e8de211d7f14aaebd (patch) | |
| tree | d44fc99d2157c4dde0e1d1e88c09d0d5653c7814 | |
| parent | 4cfab0a8931decca8c953de1e5715e40ee31ee9a (diff) | |
feat: Add /docs command and update UI (#1297)
| -rw-r--r-- | packages/cli/src/ui/components/Footer.tsx | 2 | ||||
| -rw-r--r-- | packages/cli/src/ui/components/Tips.tsx | 3 | ||||
| -rw-r--r-- | packages/cli/src/ui/hooks/slashCommandProcessor.ts | 22 |
3 files changed, 24 insertions, 3 deletions
diff --git a/packages/cli/src/ui/components/Footer.tsx b/packages/cli/src/ui/components/Footer.tsx index 779eefcd..e43e9e5e 100644 --- a/packages/cli/src/ui/components/Footer.tsx +++ b/packages/cli/src/ui/components/Footer.tsx @@ -74,7 +74,7 @@ export const Footer: React.FC<FooterProps> = ({ </Text> ) : ( <Text color={Colors.AccentRed}> - no sandbox <Text color={Colors.Gray}>(see docs)</Text> + no sandbox <Text color={Colors.Gray}>(see /docs)</Text> </Text> )} </Box> diff --git a/packages/cli/src/ui/components/Tips.tsx b/packages/cli/src/ui/components/Tips.tsx index 5d73bff1..fc10acaf 100644 --- a/packages/cli/src/ui/components/Tips.tsx +++ b/packages/cli/src/ui/components/Tips.tsx @@ -38,8 +38,7 @@ export const Tips: React.FC<TipsProps> = ({ config }) => { <Text bold color={Colors.AccentPurple}> /help </Text>{' '} - for more information. Full documentation can be found at - https://github.com/google-gemini/gemini-cli/blob/main/docs/index.md. + for more information. </Text> </Box> ); diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts index 66dfe213..c78859bc 100644 --- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts @@ -183,6 +183,28 @@ export const useSlashCommandProcessor = ( }, }, { + name: 'docs', + description: 'open full Gemini CLI documentation in your browser', + action: async (_mainCommand, _subCommand, _args) => { + const docsUrl = + 'https://github.com/google-gemini/gemini-cli/blob/main/docs/index.md'; + if (process.env.SANDBOX && process.env.SANDBOX !== 'sandbox-exec') { + addMessage({ + type: MessageType.INFO, + content: `Please open the following URL in your browser to view the documentation:\n${docsUrl}`, + timestamp: new Date(), + }); + } else { + addMessage({ + type: MessageType.INFO, + content: `Opening documentation in your browser: ${docsUrl}`, + timestamp: new Date(), + }); + await open(docsUrl); + } + }, + }, + { name: 'clear', description: 'clear the screen and conversation history', action: async (_mainCommand, _subCommand, _args) => { |
