diff options
| author | Allen Hutchison <[email protected]> | 2025-04-29 13:29:57 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-29 13:29:57 -0700 |
| commit | 28767b369f6d59ef822954f22667bdf87507e756 (patch) | |
| tree | 34a38bd646ac650588ad59b5b9166df27dbf9eb3 /packages/cli/src/ui/utils/commandUtils.ts | |
| parent | 4793e86f04d84b8fe8887e3db08b8694315d38a1 (diff) | |
Refactor useGeminiStream to pull slash commands and passthrough comma… (#215)
* Refactor useGeminiStream to pull slash commands and passthrough commands into their own processors.
* whitespace lint errors.
* Add sugestions from code review.
Diffstat (limited to 'packages/cli/src/ui/utils/commandUtils.ts')
| -rw-r--r-- | packages/cli/src/ui/utils/commandUtils.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/cli/src/ui/utils/commandUtils.ts b/packages/cli/src/ui/utils/commandUtils.ts index 8c7934dc..4f731bb3 100644 --- a/packages/cli/src/ui/utils/commandUtils.ts +++ b/packages/cli/src/ui/utils/commandUtils.ts @@ -15,3 +15,12 @@ export const isPotentiallyAtCommand = (query: string): boolean => // Check if starts with @ OR has a space, then @, then a non-space character. query.startsWith('@') || /\s@\S/.test(query); + +/** + * Checks if a query string represents a slash command (starts with '/'). + * + * @param query The input query string. + * @returns True if the query is a slash command, false otherwise. + */ +export const isSlashCommand = (query: string): boolean => + query.trim().startsWith('/'); |
