feat: Add /docs command and update UI (#1297)
This commit is contained in:
parent
4cfab0a893
commit
cb76b08e31
|
@ -74,7 +74,7 @@ export const Footer: React.FC<FooterProps> = ({
|
||||||
</Text>
|
</Text>
|
||||||
) : (
|
) : (
|
||||||
<Text color={Colors.AccentRed}>
|
<Text color={Colors.AccentRed}>
|
||||||
no sandbox <Text color={Colors.Gray}>(see docs)</Text>
|
no sandbox <Text color={Colors.Gray}>(see /docs)</Text>
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
|
|
|
@ -38,8 +38,7 @@ export const Tips: React.FC<TipsProps> = ({ config }) => {
|
||||||
<Text bold color={Colors.AccentPurple}>
|
<Text bold color={Colors.AccentPurple}>
|
||||||
/help
|
/help
|
||||||
</Text>{' '}
|
</Text>{' '}
|
||||||
for more information. Full documentation can be found at
|
for more information.
|
||||||
https://github.com/google-gemini/gemini-cli/blob/main/docs/index.md.
|
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|
|
@ -182,6 +182,28 @@ export const useSlashCommandProcessor = (
|
||||||
setShowHelp(true);
|
setShowHelp(true);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
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',
|
name: 'clear',
|
||||||
description: 'clear the screen and conversation history',
|
description: 'clear the screen and conversation history',
|
||||||
|
|
Loading…
Reference in New Issue