-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandDefinitions.cs
More file actions
695 lines (615 loc) · 36.5 KB
/
CommandDefinitions.cs
File metadata and controls
695 lines (615 loc) · 36.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
using System;
using System.Collections.Generic;
namespace NaturalCommands
{
public static class CommandDefinitions
{
public static readonly List<(string Command, string Description)> AvailableCommands = new()
{
("maximize window", "Maximize the active window"),
("move window to left half", "Move the active window to the left half of the screen"),
("move window to right half", "Move the active window to the right half of the screen"),
("move window to other monitor", "Move the active window to the next monitor"),
("open downloads", "Open the Downloads folder"),
("open documents", "Open the Documents folder"),
("open settings", "Open the application settings"),
("open my computer", "Open This PC / show drives and available space"),
("open this pc", "Open This PC / show drives and available space"),
("close tab", "Close the current tab in supported applications"),
("send keys", "Send a key sequence to the active window"),
("launch app", "Launch a specified application"),
("focus app", "Focus a specified application window"),
("show help", "Show help and available commands"),
("identify <target>", "Visually identify and click a target on screen, with disambiguation when needed"),
("show candidates", "Show the last visual identification candidate overlay"),
("choose <number>", "Choose a numbered visual candidate from the current session"),
("emoji set <name> <emoji>", "Set an emoji for a named shortcut (e.g. emoji set happy 😀)"),
("emoji <name>", "Insert the configured emoji for the given name"),
("emoji <emoji>", "Insert the given emoji immediately")
};
public static readonly List<(string Command, string Description)> VisualStudioCommands = new()
{
("build the solution", "Build the entire solution"),
("build the project", "Build the current project"),
("start debugging", "Start debugging the startup project"),
("start application", "Start without debugging"),
("stop debugging", "Stop debugging"),
("close tab", "Close the current document tab"),
("format document", "Format the current document"),
("find in files", "Open the Find in Files dialog"),
("go to definition", "Go to definition of symbol"),
("rename symbol", "Rename the selected symbol"),
("show solution explorer", "Focus Solution Explorer"),
("open recent files", "Show recent files"),
};
public static readonly List<(string Command, string Description)> VSCodeCommands = new()
{
("open file", "Open a file"),
("open folder", "Open a folder"),
("close tab", "Close the current tab"),
("format document", "Format the current document"),
("find in files", "Find in files"),
("go to definition", "Go to definition of symbol"),
("rename symbol", "Rename the selected symbol"),
("show explorer", "Show Explorer"),
("show source control", "Show Source Control"),
("show extensions", "Show Extensions"),
("start debugging", "Start debugging"),
("stop debugging", "Stop debugging"),
};
public static readonly Dictionary<string, string> VisualStudioCanonicalMappings = new(StringComparer.OrdinalIgnoreCase)
{
{ "build the solution", "Build.BuildSolution" },
{ "build solution", "Build.BuildSolution" },
{ "build the project", "Build.BuildProject" },
{ "build project", "Build.BuildProject" },
{ "clean solution", "Build.CleanSolution" },
{ "clean the solution", "Build.CleanSolution" },
{ "start debugging", "Debug.Start" },
{ "start application", "Debug.StartWithoutDebugging" },
{ "stop debugging", "Debug.StopDebugging" },
{ "close tab", "Window.CloseDocumentWindow" },
{ "format document", "Edit.FormatDocument" },
{ "find in files", "Edit.FindinFiles" },
{ "go to definition", "Edit.GoToDefinition" },
{ "rename symbol", "Refactor.Rename" },
{ "show solution explorer", "View.SolutionExplorer" },
{ "open recent files", "File.RecentFiles" }
};
public static readonly Dictionary<string, ActionBase> PopularCommands = new(StringComparer.OrdinalIgnoreCase)
{
{ "debug application", new ExecuteVSCommandAction("Debug.Start") },
{ "run application", new ExecuteVSCommandAction("Debug.StartWithoutDebugging") },
{ "stop application", new ExecuteVSCommandAction("Debug.StopDebugging") }
};
// Windows Terminal specific commands - maps natural language to keyboard shortcuts
public static readonly List<(string Command, string Description)> WindowsTerminalCommands = new()
{
("new tab", "Open a new tab (Ctrl+Shift+T)"),
("close tab", "Close the current tab (Ctrl+Shift+W)"),
("close pane", "Close the current pane (Ctrl+Shift+W)"),
("split horizontal", "Split pane horizontally (Alt+Shift+-)"),
("split vertical", "Split pane vertically (Alt+Shift++)"),
("split down", "Split pane down (Alt+Shift+-)"),
("split right", "Split pane right (Alt+Shift++)"),
("duplicate pane", "Duplicate the current pane (Alt+Shift+D)"),
("next tab", "Switch to the next tab (Ctrl+Tab)"),
("previous tab", "Switch to the previous tab (Ctrl+Shift+Tab)"),
("next pane", "Move focus to the next pane (Alt+Down/Right)"),
("previous pane", "Move focus to the previous pane (Alt+Up/Left)"),
("focus pane up", "Move focus to the pane above (Alt+Up)"),
("focus pane down", "Move focus to the pane below (Alt+Down)"),
("focus pane left", "Move focus to the pane on the left (Alt+Left)"),
("focus pane right", "Move focus to the pane on the right (Alt+Right)"),
("resize pane up", "Resize pane up (Alt+Shift+Up)"),
("resize pane down", "Resize pane down (Alt+Shift+Down)"),
("resize pane left", "Resize pane left (Alt+Shift+Left)"),
("resize pane right", "Resize pane right (Alt+Shift+Right)"),
("open settings", "Open terminal settings (Ctrl+,)"),
("open command palette", "Open command palette (Ctrl+Shift+P)"),
("toggle fullscreen", "Toggle full screen mode (F11)"),
("toggle focus mode", "Toggle focus mode (Ctrl+Shift+Enter)"),
("toggle always on top", "Toggle always on top (Alt+Enter)"),
("find", "Open find dialog (Ctrl+Shift+F)"),
("scroll up", "Scroll up (Ctrl+Shift+Up)"),
("scroll down", "Scroll down (Ctrl+Shift+Down)"),
("scroll page up", "Scroll up one page (Ctrl+Shift+PageUp)"),
("scroll page down", "Scroll down one page (Ctrl+Shift+PageDown)"),
("zoom in", "Increase font size (Ctrl++)"),
("zoom out", "Decrease font size (Ctrl+-)"),
("reset zoom", "Reset font size (Ctrl+0)"),
("copy", "Copy selected text (Ctrl+Shift+C)"),
("paste", "Paste from clipboard (Ctrl+Shift+V)"),
("rename tab", "Rename the current tab (Ctrl+Shift+R)"),
("switch to tab 1", "Switch to tab 1 (Ctrl+Alt+1)"),
("switch to tab 2", "Switch to tab 2 (Ctrl+Alt+2)"),
("switch to tab 3", "Switch to tab 3 (Ctrl+Alt+3)"),
("switch to tab 4", "Switch to tab 4 (Ctrl+Alt+4)"),
("switch to tab 5", "Switch to tab 5 (Ctrl+Alt+5)"),
("shutdown", "Stop/interrupt the current running process (Ctrl+C)"),
("stop", "Stop/interrupt the current running process (Ctrl+C)"),
("stop process", "Stop/interrupt the current running process (Ctrl+C)"),
("kill process", "Kill/interrupt the current running process (Ctrl+C)"),
("cancel", "Cancel/interrupt the current running process (Ctrl+C)"),
};
// Maps natural language commands to Windows Terminal shortcuts
public static readonly Dictionary<string, string> WindowsTerminalShortcuts = new(StringComparer.OrdinalIgnoreCase)
{
// Tab management
{ "new tab", "ctrl+shift+t" },
{ "open new tab", "ctrl+shift+t" },
{ "create tab", "ctrl+shift+t" },
{ "add tab", "ctrl+shift+t" },
{ "close tab", "ctrl+shift+w" },
{ "close pane", "ctrl+shift+w" },
{ "next tab", "ctrl+tab" },
{ "previous tab", "ctrl+shift+tab" },
{ "tab right", "ctrl+tab" },
{ "tab left", "ctrl+shift+tab" },
// Pane splitting
{ "split horizontal", "alt+shift+minus" },
{ "split horizontally", "alt+shift+minus" },
{ "split down", "alt+shift+minus" },
{ "split vertical", "alt+shift+plus" },
{ "split vertically", "alt+shift+plus" },
{ "split right", "alt+shift+plus" },
{ "duplicate pane", "alt+shift+d" },
{ "duplicate", "alt+shift+d" },
// Pane focus navigation
{ "focus pane up", "alt+up" },
{ "focus up", "alt+up" },
{ "pane up", "alt+up" },
{ "focus pane down", "alt+down" },
{ "focus down", "alt+down" },
{ "pane down", "alt+down" },
{ "focus pane left", "alt+left" },
{ "focus left", "alt+left" },
{ "pane left", "alt+left" },
{ "focus pane right", "alt+right" },
{ "focus right", "alt+right" },
{ "pane right", "alt+right" },
{ "next pane", "alt+right" },
{ "previous pane", "alt+left" },
// Pane resizing
{ "resize pane up", "alt+shift+up" },
{ "resize up", "alt+shift+up" },
{ "resize pane down", "alt+shift+down" },
{ "resize down", "alt+shift+down" },
{ "resize pane left", "alt+shift+left" },
{ "resize left", "alt+shift+left" },
{ "resize pane right", "alt+shift+right" },
{ "resize right", "alt+shift+right" },
// Settings and commands
{ "open settings", "ctrl+," },
{ "settings", "ctrl+," },
{ "terminal settings", "ctrl+," },
{ "open command palette", "ctrl+shift+p" },
{ "command palette", "ctrl+shift+p" },
{ "commands", "ctrl+shift+p" },
// View modes
{ "toggle fullscreen", "f11" },
{ "fullscreen", "f11" },
{ "full screen", "f11" },
{ "toggle focus mode", "ctrl+shift+enter" },
{ "focus mode", "ctrl+shift+enter" },
{ "toggle always on top", "alt+enter" },
// Find
{ "find", "ctrl+shift+f" },
{ "search", "ctrl+shift+f" },
{ "find text", "ctrl+shift+f" },
// Scrolling
{ "scroll up", "ctrl+shift+up" },
{ "scroll down", "ctrl+shift+down" },
{ "scroll page up", "ctrl+shift+pageup" },
{ "scroll page down", "ctrl+shift+pagedown" },
{ "page up", "ctrl+shift+pageup" },
{ "page down", "ctrl+shift+pagedown" },
// Zoom
{ "zoom in", "ctrl+plus" },
{ "zoom out", "ctrl+minus" },
{ "reset zoom", "ctrl+0" },
{ "increase font", "ctrl+plus" },
{ "decrease font", "ctrl+minus" },
{ "reset font", "ctrl+0" },
// Copy/Paste
{ "copy", "ctrl+shift+c" },
{ "paste", "ctrl+shift+v" },
// Tab rename
{ "rename tab", "ctrl+shift+r" },
{ "rename", "ctrl+shift+r" },
// Switch to specific tabs
{ "switch to tab 1", "ctrl+alt+1" },
{ "tab 1", "ctrl+alt+1" },
{ "switch to tab 2", "ctrl+alt+2" },
{ "tab 2", "ctrl+alt+2" },
{ "switch to tab 3", "ctrl+alt+3" },
{ "tab 3", "ctrl+alt+3" },
{ "switch to tab 4", "ctrl+alt+4" },
{ "tab 4", "ctrl+alt+4" },
{ "switch to tab 5", "ctrl+alt+5" },
{ "tab 5", "ctrl+alt+5" },
{ "switch to tab 6", "ctrl+alt+6" },
{ "tab 6", "ctrl+alt+6" },
{ "switch to tab 7", "ctrl+alt+7" },
{ "tab 7", "ctrl+alt+7" },
{ "switch to tab 8", "ctrl+alt+8" },
{ "tab 8", "ctrl+alt+8" },
{ "switch to tab 9", "ctrl+alt+9" },
{ "tab 9", "ctrl+alt+9" },
// Additional useful commands
{ "clear", "ctrl+shift+k" },
{ "clear terminal", "ctrl+shift+k" },
{ "clear screen", "ctrl+shift+k" },
{ "new window", "ctrl+shift+n" },
{ "open new window", "ctrl+shift+n" },
// Process control - Ctrl+C to interrupt/stop running process
{ "shutdown", "ctrl+c" },
{ "stop", "ctrl+c" },
{ "stop process", "ctrl+c" },
{ "kill", "ctrl+c" },
{ "kill process", "ctrl+c" },
{ "terminate", "ctrl+c" },
{ "cancel", "ctrl+c" },
{ "interrupt", "ctrl+c" },
{ "abort", "ctrl+c" },
{ "break", "ctrl+c" },
{ "stop server", "ctrl+c" },
{ "stop application", "ctrl+c" },
{ "stop running", "ctrl+c" },
};
// Windows Explorer specific commands - maps natural language to keyboard shortcuts
public static readonly List<(string Command, string Description)> WindowsExplorerCommands = new()
{
// UI Automation commands - open menus for manual navigation
("view menu", "Open the View dropdown (use arrows to navigate)"),
("sort menu", "Open the Sort dropdown (use arrows to navigate)"),
("new menu", "Open the New dropdown (use arrows to navigate)"),
// Navigation
("go back", "Navigate back (Alt+Left)"),
("go forward", "Navigate forward (Alt+Right)"),
("go up", "Navigate to parent folder (Alt+Up)"),
("home", "Go to Quick Access/Home (Alt+Home)"),
// Panes
("preview pane", "Toggle preview pane (Alt+P)"),
("details pane", "Toggle details pane (Alt+Shift+P)"),
// Selection
("select all", "Select all items (Ctrl+A)"),
// File operations
("new folder", "Create new folder (Ctrl+Shift+N)"),
("rename", "Rename selected item (F2)"),
("delete", "Delete selected items (Delete)"),
("permanent delete", "Permanently delete (Shift+Delete)"),
("properties", "Show properties (Alt+Enter)"),
("copy path", "Copy path (Ctrl+Shift+C)"),
("copy", "Copy (Ctrl+C)"),
("cut", "Cut (Ctrl+X)"),
("paste", "Paste (Ctrl+V)"),
// Address bar
("address bar", "Focus the address bar (Alt+D)"),
// Search
("search", "Focus search box (Ctrl+E)"),
// Other
("refresh", "Refresh the current view (F5)"),
("new window", "Open new window (Ctrl+N)"),
("new tab", "Open new tab (Ctrl+T)"),
("close tab", "Close current tab (Ctrl+W)"),
("undo", "Undo (Ctrl+Z)"),
("redo", "Redo (Ctrl+Y)"),
("full screen", "Toggle full screen (F11)"),
("show hidden files", "Toggle hidden files (Ctrl+H)"),
};
// Maps natural language commands to Windows Explorer shortcuts
// Windows 11 - uses UI Automation for View/Sort buttons, keyboard for other commands
public static readonly Dictionary<string, string> WindowsExplorerShortcuts = new(StringComparer.OrdinalIgnoreCase)
{
// UI Automation commands - special prefix "uia:" indicates to use UI Automation
{ "view menu", "uia:view" },
{ "open view menu", "uia:view" },
{ "show view menu", "uia:view" },
{ "view options", "uia:view" },
{ "view", "uia:view" },
{ "sort menu", "uia:sort" },
{ "open sort menu", "uia:sort" },
{ "sort options", "uia:sort" },
{ "sort", "uia:sort" },
{ "new menu", "uia:new" },
{ "open new menu", "uia:new" },
{ "new options", "uia:new" },
{ "show new menu", "uia:new" },
// Navigation - these work directly
{ "go back", "alt+left" },
{ "back", "alt+left" },
{ "navigate back", "alt+left" },
{ "previous folder", "alt+left" },
{ "go forward", "alt+right" },
{ "forward", "alt+right" },
{ "navigate forward", "alt+right" },
{ "next folder", "alt+right" },
{ "go up", "alt+up" },
{ "parent folder", "alt+up" },
{ "go to parent", "alt+up" },
{ "navigate up", "alt+up" },
{ "up one level", "alt+up" },
// Panes - these work
{ "preview pane", "alt+p" },
{ "show preview pane", "alt+p" },
{ "toggle preview pane", "alt+p" },
{ "preview", "alt+p" },
{ "details pane", "alt+shift+p" },
{ "show details pane", "alt+shift+p" },
{ "toggle details pane", "alt+shift+p" },
// Selection
{ "select all", "ctrl+a" },
{ "select everything", "ctrl+a" },
// File operations
{ "new folder", "ctrl+shift+n" },
{ "create folder", "ctrl+shift+n" },
{ "create new folder", "ctrl+shift+n" },
{ "rename", "f2" },
{ "rename file", "f2" },
{ "rename item", "f2" },
{ "delete", "delete" },
{ "delete file", "delete" },
{ "delete item", "delete" },
{ "permanent delete", "shift+delete" },
{ "permanently delete", "shift+delete" },
{ "properties", "alt+enter" },
{ "show properties", "alt+enter" },
{ "file properties", "alt+enter" },
{ "copy path", "ctrl+shift+c" },
{ "copy file path", "ctrl+shift+c" },
{ "copy as path", "ctrl+shift+c" },
{ "copy", "ctrl+c" },
{ "cut", "ctrl+x" },
{ "paste", "ctrl+v" },
// Address bar
{ "address bar", "alt+d" },
{ "focus address bar", "alt+d" },
{ "go to address", "alt+d" },
{ "edit path", "alt+d" },
// Search
{ "search", "ctrl+e" },
{ "find", "ctrl+f" },
{ "search files", "ctrl+e" },
// Refresh
{ "refresh", "f5" },
{ "reload", "f5" },
// New window/tab
{ "new window", "ctrl+n" },
{ "new tab", "ctrl+t" },
{ "close tab", "ctrl+w" },
// Undo/Redo
{ "undo", "ctrl+z" },
{ "redo", "ctrl+y" },
// Full screen
{ "full screen", "f11" },
{ "fullscreen", "f11" },
// Quick access/Home
{ "home", "alt+home" },
{ "go home", "alt+home" },
{ "quick access", "alt+home" },
// Hidden files toggle
{ "show hidden files", "ctrl+h" },
{ "hidden files", "ctrl+h" },
{ "toggle hidden files", "ctrl+h" },
};
// .NET CLI commands that can be run in Windows Terminal
public static readonly List<(string Command, string TerminalCommand, string Description)> DotNetCommands = new()
{
// Build commands
("dotnet build", "dotnet build", "Build a .NET project"),
("build", "dotnet build", "Build a .NET project"),
("build project", "dotnet build", "Build a .NET project"),
("build solution", "dotnet build", "Build a .NET project/solution"),
("dotnet build release", "dotnet build -c Release", "Build in Release configuration"),
("build release", "dotnet build -c Release", "Build in Release configuration"),
// Clean commands
("dotnet clean", "dotnet clean", "Clean build outputs of a .NET project"),
("clean", "dotnet clean", "Clean build outputs of a .NET project"),
("clean project", "dotnet clean", "Clean build outputs of a .NET project"),
("clean solution", "dotnet clean", "Clean build outputs of a .NET project/solution"),
// Run commands
("dotnet run", "dotnet run", "Build and run a .NET project"),
("run", "dotnet run", "Build and run a .NET project"),
("run project", "dotnet run", "Build and run a .NET project"),
("run application", "dotnet run", "Build and run a .NET project"),
("dotnet run release", "dotnet run -c Release", "Run in Release configuration"),
("run release", "dotnet run -c Release", "Run in Release configuration"),
// Test commands
("dotnet test", "dotnet test", "Run unit tests"),
("test", "dotnet test", "Run unit tests"),
("run tests", "dotnet test", "Run unit tests"),
("run unit tests", "dotnet test", "Run unit tests"),
("dotnet test verbose", "dotnet test -v n", "Run unit tests with normal verbosity"),
("test verbose", "dotnet test -v n", "Run unit tests with normal verbosity"),
// Restore commands
("dotnet restore", "dotnet restore", "Restore dependencies"),
("restore", "dotnet restore", "Restore dependencies"),
("restore packages", "dotnet restore", "Restore NuGet packages"),
("restore dependencies", "dotnet restore", "Restore dependencies"),
// Publish commands
("dotnet publish", "dotnet publish", "Publish a .NET project for deployment"),
("publish", "dotnet publish", "Publish a .NET project for deployment"),
("publish project", "dotnet publish", "Publish a .NET project for deployment"),
("dotnet publish release", "dotnet publish -c Release", "Publish in Release configuration"),
("publish release", "dotnet publish -c Release", "Publish in Release configuration"),
// Pack commands
("dotnet pack", "dotnet pack", "Create a NuGet package"),
("pack", "dotnet pack", "Create a NuGet package"),
("create package", "dotnet pack", "Create a NuGet package"),
("dotnet pack release", "dotnet pack -c Release", "Create a NuGet package in Release configuration"),
("pack release", "dotnet pack -c Release", "Create a NuGet package in Release configuration"),
// Watch commands
("dotnet watch", "dotnet watch", "Start a file watcher that runs a command when files change"),
("watch", "dotnet watch", "Start a file watcher that runs a command when files change"),
("dotnet watch run", "dotnet watch run", "Watch and run on file changes"),
("watch run", "dotnet watch run", "Watch and run on file changes"),
("dotnet watch test", "dotnet watch test", "Watch and run tests on file changes"),
("watch test", "dotnet watch test", "Watch and run tests on file changes"),
// Format commands
("dotnet format", "dotnet format", "Apply style preferences to a project or solution"),
("format", "dotnet format", "Apply style preferences to a project or solution"),
("format code", "dotnet format", "Apply style preferences to a project or solution"),
// New project commands
("dotnet new console", "dotnet new console", "Create a new console application"),
("new console", "dotnet new console", "Create a new console application"),
("dotnet new classlib", "dotnet new classlib", "Create a new class library"),
("new class library", "dotnet new classlib", "Create a new class library"),
("dotnet new webapi", "dotnet new webapi", "Create a new Web API project"),
("new web api", "dotnet new webapi", "Create a new Web API project"),
("dotnet new mvc", "dotnet new mvc", "Create a new MVC web application"),
("new mvc", "dotnet new mvc", "Create a new MVC web application"),
("dotnet new blazor", "dotnet new blazor", "Create a new Blazor web application"),
("new blazor", "dotnet new blazor", "Create a new Blazor web application"),
("dotnet new list", "dotnet new list", "List available project templates"),
("new list", "dotnet new list", "List available project templates"),
("list templates", "dotnet new list", "List available project templates"),
// Solution commands
("dotnet solution list", "dotnet sln list", "List projects in a solution"),
("solution list", "dotnet sln list", "List projects in a solution"),
("list projects", "dotnet sln list", "List projects in a solution"),
// Package commands
("dotnet add package", "dotnet add package ", "Add a NuGet package (prompts for name)"),
("add package", "dotnet add package ", "Add a NuGet package (prompts for name)"),
("dotnet list package", "dotnet list package", "List NuGet packages"),
("list packages", "dotnet list package", "List NuGet packages"),
("list nuget packages", "dotnet list package", "List NuGet packages"),
("dotnet remove package", "dotnet remove package ", "Remove a NuGet package (prompts for name)"),
("remove package", "dotnet remove package ", "Remove a NuGet package (prompts for name)"),
// Tool commands
("dotnet tool list", "dotnet tool list", "List installed .NET tools"),
("list tools", "dotnet tool list", "List installed .NET tools"),
("dotnet tool install", "dotnet tool install ", "Install a .NET tool (prompts for name)"),
("install tool", "dotnet tool install ", "Install a .NET tool (prompts for name)"),
("dotnet tool update", "dotnet tool update ", "Update a .NET tool (prompts for name)"),
("update tool", "dotnet tool update ", "Update a .NET tool (prompts for name)"),
// Info commands
("dotnet info", "dotnet --info", "Display .NET information"),
("dotnet version", "dotnet --version", "Display .NET SDK version"),
("dotnet list sdks", "dotnet --list-sdks", "Display installed SDKs"),
("list sdks", "dotnet --list-sdks", "Display installed SDKs"),
("dotnet list runtimes", "dotnet --list-runtimes", "Display installed runtimes"),
("list runtimes", "dotnet --list-runtimes", "Display installed runtimes"),
// EF Core commands (common if EF tools installed)
("dotnet ef migrations add", "dotnet ef migrations add ", "Add a new EF Core migration (prompts for name)"),
("add migration", "dotnet ef migrations add ", "Add a new EF Core migration (prompts for name)"),
("dotnet ef migrations list", "dotnet ef migrations list", "List EF Core migrations"),
("list migrations", "dotnet ef migrations list", "List EF Core migrations"),
("dotnet ef database update", "dotnet ef database update", "Update database to latest migration"),
("update database", "dotnet ef database update", "Update database to latest migration"),
("dotnet ef database drop", "dotnet ef database drop", "Drop the database"),
("drop database", "dotnet ef database drop", "Drop the database"),
// User secrets
("dotnet user-secrets init", "dotnet user-secrets init", "Initialize user secrets for the project"),
("init user secrets", "dotnet user-secrets init", "Initialize user secrets for the project"),
("dotnet user-secrets list", "dotnet user-secrets list", "List user secrets"),
("list user secrets", "dotnet user-secrets list", "List user secrets"),
("list secrets", "dotnet user-secrets list", "List user secrets"),
// Dev certs
("dotnet dev-certs https trust", "dotnet dev-certs https --trust", "Trust the HTTPS development certificate"),
("trust dev cert", "dotnet dev-certs https --trust", "Trust the HTTPS development certificate"),
("trust https certificate", "dotnet dev-certs https --trust", "Trust the HTTPS development certificate"),
};
// Maps natural language to dotnet commands (for fuzzy matching)
public static readonly Dictionary<string, (string TerminalCommand, string Description)> DotNetCommandMappings = new(StringComparer.OrdinalIgnoreCase)
{
// Build
{ "dotnet build", ("dotnet build", "Build a .NET project") },
{ "build", ("dotnet build", "Build a .NET project") },
{ "build project", ("dotnet build", "Build a .NET project") },
{ "build solution", ("dotnet build", "Build a .NET project/solution") },
{ "build the project", ("dotnet build", "Build a .NET project") },
{ "build the solution", ("dotnet build", "Build a .NET project/solution") },
{ "dotnet build release", ("dotnet build -c Release", "Build in Release configuration") },
{ "build release", ("dotnet build -c Release", "Build in Release configuration") },
{ "build in release", ("dotnet build -c Release", "Build in Release configuration") },
// Clean
{ "dotnet clean", ("dotnet clean", "Clean build outputs") },
{ "clean", ("dotnet clean", "Clean build outputs") },
{ "clean project", ("dotnet clean", "Clean build outputs") },
{ "clean solution", ("dotnet clean", "Clean build outputs") },
{ "clean the project", ("dotnet clean", "Clean build outputs") },
{ "clean the solution", ("dotnet clean", "Clean build outputs") },
// Run
{ "dotnet run", ("dotnet run", "Build and run a .NET project") },
{ "run", ("dotnet run", "Build and run a .NET project") },
{ "run project", ("dotnet run", "Build and run a .NET project") },
{ "run application", ("dotnet run", "Build and run a .NET project") },
{ "run the project", ("dotnet run", "Build and run a .NET project") },
{ "run the application", ("dotnet run", "Build and run a .NET project") },
{ "dotnet run release", ("dotnet run -c Release", "Run in Release configuration") },
{ "run release", ("dotnet run -c Release", "Run in Release configuration") },
{ "run in release", ("dotnet run -c Release", "Run in Release configuration") },
// Test
{ "dotnet test", ("dotnet test", "Run unit tests") },
{ "test", ("dotnet test", "Run unit tests") },
{ "run tests", ("dotnet test", "Run unit tests") },
{ "run unit tests", ("dotnet test", "Run unit tests") },
{ "run the tests", ("dotnet test", "Run unit tests") },
{ "execute tests", ("dotnet test", "Run unit tests") },
// Restore
{ "dotnet restore", ("dotnet restore", "Restore dependencies") },
{ "restore", ("dotnet restore", "Restore dependencies") },
{ "restore packages", ("dotnet restore", "Restore NuGet packages") },
{ "restore dependencies", ("dotnet restore", "Restore dependencies") },
{ "restore nuget", ("dotnet restore", "Restore NuGet packages") },
// Publish
{ "dotnet publish", ("dotnet publish", "Publish for deployment") },
{ "publish", ("dotnet publish", "Publish for deployment") },
{ "publish project", ("dotnet publish", "Publish for deployment") },
{ "publish application", ("dotnet publish", "Publish for deployment") },
// Pack
{ "dotnet pack", ("dotnet pack", "Create a NuGet package") },
{ "pack", ("dotnet pack", "Create a NuGet package") },
{ "create package", ("dotnet pack", "Create a NuGet package") },
{ "create nuget package", ("dotnet pack", "Create a NuGet package") },
// Watch
{ "dotnet watch", ("dotnet watch", "Watch for file changes") },
{ "watch", ("dotnet watch", "Watch for file changes") },
{ "dotnet watch run", ("dotnet watch run", "Watch and run on changes") },
{ "watch run", ("dotnet watch run", "Watch and run on changes") },
{ "watch and run", ("dotnet watch run", "Watch and run on changes") },
{ "dotnet watch test", ("dotnet watch test", "Watch and test on changes") },
{ "watch test", ("dotnet watch test", "Watch and test on changes") },
{ "watch tests", ("dotnet watch test", "Watch and test on changes") },
// Format
{ "dotnet format", ("dotnet format", "Format code") },
{ "format", ("dotnet format", "Format code") },
{ "format code", ("dotnet format", "Format code") },
{ "format the code", ("dotnet format", "Format code") },
// Info
{ "dotnet info", ("dotnet --info", "Display .NET information") },
{ "dotnet version", ("dotnet --version", "Display .NET SDK version") },
{ "version", ("dotnet --version", "Display .NET SDK version") },
{ "dotnet list sdks", ("dotnet --list-sdks", "Display installed SDKs") },
{ "list sdks", ("dotnet --list-sdks", "Display installed SDKs") },
{ "dotnet list runtimes", ("dotnet --list-runtimes", "Display installed runtimes") },
{ "list runtimes", ("dotnet --list-runtimes", "Display installed runtimes") },
// Common new project templates
{ "new console", ("dotnet new console", "Create a new console application") },
{ "new class library", ("dotnet new classlib", "Create a new class library") },
{ "new web api", ("dotnet new webapi", "Create a new Web API project") },
{ "new mvc", ("dotnet new mvc", "Create a new MVC web application") },
{ "new blazor", ("dotnet new blazor", "Create a new Blazor web application") },
{ "list templates", ("dotnet new list", "List available project templates") },
// Solution and package commands
{ "solution list", ("dotnet sln list", "List projects in a solution") },
{ "list projects", ("dotnet sln list", "List projects in a solution") },
{ "list packages", ("dotnet list package", "List NuGet packages") },
{ "list nuget packages", ("dotnet list package", "List NuGet packages") },
{ "list tools", ("dotnet tool list", "List installed .NET tools") },
// EF Core
{ "add migration", ("dotnet ef migrations add ", "Add a new EF Core migration") },
{ "list migrations", ("dotnet ef migrations list", "List EF Core migrations") },
{ "update database", ("dotnet ef database update", "Update database to latest migration") },
{ "drop database", ("dotnet ef database drop", "Drop the database") },
// User secrets
{ "init user secrets", ("dotnet user-secrets init", "Initialize user secrets") },
{ "list user secrets", ("dotnet user-secrets list", "List user secrets") },
{ "list secrets", ("dotnet user-secrets list", "List user secrets") },
// Dev certs
{ "trust dev cert", ("dotnet dev-certs https --trust", "Trust HTTPS dev certificate") },
{ "trust https certificate", ("dotnet dev-certs https --trust", "Trust HTTPS dev certificate") },
};
}
}