summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/commands
diff options
context:
space:
mode:
authorAbhi <[email protected]>2025-07-23 16:11:23 -0400
committerGitHub <[email protected]>2025-07-23 20:11:23 +0000
commitbbe95f1eaa8f5351c58e0866ba938415db7891e4 (patch)
tree045bd725f24d5b197b5cebaad3a4074c14a99ba1 /packages/cli/src/ui/commands
parent2d1eafae95b7a140ac42ea5899f2f4ff6bca80ae (diff)
feat(commands): Implement argument handling for custom commands via a prompt pipeline (#4702)
Diffstat (limited to 'packages/cli/src/ui/commands')
-rw-r--r--packages/cli/src/ui/commands/types.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/cli/src/ui/commands/types.ts b/packages/cli/src/ui/commands/types.ts
index df7b2f21..9a1088fd 100644
--- a/packages/cli/src/ui/commands/types.ts
+++ b/packages/cli/src/ui/commands/types.ts
@@ -14,6 +14,15 @@ import { SessionStatsState } from '../contexts/SessionContext.js';
// Grouped dependencies for clarity and easier mocking
export interface CommandContext {
+ // Invocation properties for when commands are called.
+ invocation?: {
+ /** The raw, untrimmed input string from the user. */
+ raw: string;
+ /** The primary name of the command that was matched. */
+ name: string;
+ /** The arguments string that follows the command name. */
+ args: string;
+ };
// Core services and configuration
services: {
// TODO(abhipatel12): Ensure that config is never null.
@@ -132,7 +141,7 @@ export interface SlashCommand {
// The action to run. Optional for parent commands that only group sub-commands.
action?: (
context: CommandContext,
- args: string,
+ args: string, // TODO: Remove args. CommandContext now contains the complete invocation.
) =>
| void
| SlashCommandActionReturn