Skip to content

Commit 6237869

Browse files
authored
chat - support for custom modes from CLI (microsoft#253182)
* chat - support for custom modes from CLI * .
1 parent 28d5751 commit 6237869

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/vs/platform/environment/node/argv.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ export const OPTIONS: OptionDescriptions<Required<NativeParsedArgs>> = {
8383
description: 'Pass in a prompt to run in a chat session in the current working directory.',
8484
options: {
8585
'_': { type: 'string[]', description: localize('prompt', "The prompt to use as chat.") },
86-
'mode': { type: 'string', cat: 'o', alias: 'm', args: 'agent|ask|edit', description: localize('chatMode', "The mode to use for the chat session. Defaults to 'agent'.") },
87-
'add-file': { type: 'string[]', cat: 'o', alias: 'a', description: localize('addFile', "Add files as context to the chat session.") },
86+
'mode': { type: 'string', cat: 'o', alias: 'm', args: 'mode', description: localize('chatMode', "The mode to use for the chat session. Defaults to 'agent'.") },
87+
'add-file': { type: 'string[]', cat: 'o', alias: 'a', args: 'path', description: localize('addFile', "Add files as context to the chat session.") },
8888
'help': { type: 'boolean', cat: 'o', alias: 'h', description: localize('help', "Print usage.") }
8989
}
9090
},

src/vs/workbench/contrib/chat/electron-browser/chat.contribution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { registerChatDeveloperActions } from './actions/chatDeveloperActions.js'
1515
import { INativeWorkbenchEnvironmentService } from '../../../services/environment/electron-browser/environmentService.js';
1616
import { ICommandService } from '../../../../platform/commands/common/commands.js';
1717
import { ACTION_ID_NEW_CHAT, CHAT_OPEN_ACTION_ID, IChatViewOpenOptions } from '../browser/actions/chatActions.js';
18-
import { ChatModeKind, validateChatMode } from '../common/constants.js';
18+
import { ChatModeKind } from '../common/constants.js';
1919
import { ipcRenderer } from '../../../../base/parts/sandbox/electron-browser/globals.js';
2020
import { IWorkspaceTrustRequestService } from '../../../../platform/workspace/common/workspaceTrust.js';
2121
import { URI } from '../../../../base/common/uri.js';
@@ -79,7 +79,7 @@ class ChatCommandLineHandler extends Disposable {
7979

8080
const opts: IChatViewOpenOptions = {
8181
query: args._.length > 0 ? args._.join(' ') : '',
82-
mode: validateChatMode(args.mode) ?? ChatModeKind.Agent,
82+
mode: args.mode ?? ChatModeKind.Agent,
8383
attachFiles: args['add-file']?.map(file => URI.file(resolve(file))), // use `resolve` to deal with relative paths properly
8484
};
8585

0 commit comments

Comments
 (0)