Skip to content

Commit 034b1a3

Browse files
committed
Adds walkthrough for AI features
1 parent d753078 commit 034b1a3

10 files changed

+173
-16
lines changed

contributions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14030,7 +14030,7 @@
1403014030
"when": "gitlens:views:scm:grouped:welcome && gitlens:install:new"
1403114031
},
1403214032
{
14033-
"contents": "In GitLens 16, we've grouped many related views—Commits, Branches, Stashes, etc—here for easier view management.\n\n[Continue](command:gitlens.views.scm.grouped.welcome.dismiss)\n\nPrefer them separate? [Restore views to previous locations](command:gitlens.views.scm.grouped.welcome.restore)\n\nUse the tabs above to navigate, or detach the views you want to keep separated. You can regroup them anytime using the 'x' in the view header.",
14033+
"contents": "GitLens groups many related views—Commits, Branches, Stashes, etc—here for easier view management.\n\n[Continue](command:gitlens.views.scm.grouped.welcome.dismiss)\n\nPrefer them separate? [Restore views to previous locations](command:gitlens.views.scm.grouped.welcome.restore)\n\nUse the tabs above to navigate, or detach the views you want to keep separated. You can regroup them anytime using the 'x' in the view header.",
1403414034
"when": "gitlens:views:scm:grouped:welcome && !gitlens:install:new"
1403514035
},
1403614036
{

docs/telemetry-events.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@ or
20242024
'context.itemType': 'file' | 'folder',
20252025
'context.period': 'all' | `${number}|D` | `${number}|M` | `${number}|Y`,
20262026
'context.showAllBranches': boolean,
2027-
'context.sliceBy': 'author' | 'branch',
2027+
'context.sliceBy': 'branch' | 'author',
20282028
'context.webview.host': 'editor' | 'view',
20292029
'context.webview.id': string,
20302030
'context.webview.instanceId': string,
@@ -2041,7 +2041,7 @@ or
20412041
'context.itemType': 'file' | 'folder',
20422042
'context.period': 'all' | `${number}|D` | `${number}|M` | `${number}|Y`,
20432043
'context.showAllBranches': boolean,
2044-
'context.sliceBy': 'author' | 'branch',
2044+
'context.sliceBy': 'branch' | 'author',
20452045
'context.webview.host': 'editor' | 'view',
20462046
'context.webview.id': string,
20472047
'context.webview.instanceId': string,
@@ -2058,7 +2058,7 @@ or
20582058
'context.itemType': 'file' | 'folder',
20592059
'context.period': 'all' | `${number}|D` | `${number}|M` | `${number}|Y`,
20602060
'context.showAllBranches': boolean,
2061-
'context.sliceBy': 'author' | 'branch',
2061+
'context.sliceBy': 'branch' | 'author',
20622062
'context.webview.host': 'editor' | 'view',
20632063
'context.webview.id': string,
20642064
'context.webview.instanceId': string,
@@ -2078,7 +2078,7 @@ or
20782078
'context.itemType': 'file' | 'folder',
20792079
'context.period': 'all' | `${number}|D` | `${number}|M` | `${number}|Y`,
20802080
'context.showAllBranches': boolean,
2081-
'context.sliceBy': 'author' | 'branch',
2081+
'context.sliceBy': 'branch' | 'author',
20822082
'context.webview.host': 'editor' | 'view',
20832083
'context.webview.id': string,
20842084
'context.webview.instanceId': string,
@@ -2110,7 +2110,7 @@ or
21102110
'context.itemType': 'file' | 'folder',
21112111
'context.period': 'all' | `${number}|D` | `${number}|M` | `${number}|Y`,
21122112
'context.showAllBranches': boolean,
2113-
'context.sliceBy': 'author' | 'branch',
2113+
'context.sliceBy': 'branch' | 'author',
21142114
'context.webview.host': 'editor' | 'view',
21152115
'context.webview.id': string,
21162116
'context.webview.instanceId': string,
@@ -2148,7 +2148,8 @@ or
21482148
```typescript
21492149
{
21502150
'command': string,
2151-
'name': 'open/help-center/start-integrations' | 'open/help-center/accelerate-pr-reviews' | 'open/help-center/streamline-collaboration' | 'open/help-center/interactive-code-history' | 'open/help-center/community-vs-pro' | 'open/help-center/home-view' | 'open/devex-platform' | 'open/drafts' | 'open/home' | 'connect/integrations' | 'open/autolinks' | 'open/graph' | 'open/launchpad' | 'create/worktree' | 'open/help-center' | 'plus/sign-up' | 'plus/upgrade' | 'plus/reactivate' | 'open/walkthrough' | 'open/inspect',
2151+
'detail': string,
2152+
'name': 'open/ai-custom-instructions-settings' | 'open/ai-enable-setting' | 'open/ai-settings' | 'open/help-center/ai-features' | 'open/help-center/start-integrations' | 'open/help-center/accelerate-pr-reviews' | 'open/help-center/streamline-collaboration' | 'open/help-center/interactive-code-history' | 'open/help-center/community-vs-pro' | 'open/help-center/home-view' | 'open/devex-platform' | 'open/drafts' | 'open/home' | 'connect/integrations' | 'open/autolinks' | 'open/graph' | 'open/launchpad' | 'create/worktree' | 'open/help-center' | 'plus/sign-up' | 'plus/upgrade' | 'plus/reactivate' | 'open/walkthrough' | 'open/inspect' | 'switch/ai-model',
21522153
'type': 'command'
21532154
}
21542155
```
@@ -2157,7 +2158,8 @@ or
21572158

21582159
```typescript
21592160
{
2160-
'name': 'open/help-center/start-integrations' | 'open/help-center/accelerate-pr-reviews' | 'open/help-center/streamline-collaboration' | 'open/help-center/interactive-code-history' | 'open/help-center/community-vs-pro' | 'open/help-center/home-view' | 'open/devex-platform' | 'open/drafts' | 'open/home' | 'connect/integrations' | 'open/autolinks' | 'open/graph' | 'open/launchpad' | 'create/worktree' | 'open/help-center' | 'plus/sign-up' | 'plus/upgrade' | 'plus/reactivate' | 'open/walkthrough' | 'open/inspect',
2161+
'detail': string,
2162+
'name': 'open/ai-custom-instructions-settings' | 'open/ai-enable-setting' | 'open/ai-settings' | 'open/help-center/ai-features' | 'open/help-center/start-integrations' | 'open/help-center/accelerate-pr-reviews' | 'open/help-center/streamline-collaboration' | 'open/help-center/interactive-code-history' | 'open/help-center/community-vs-pro' | 'open/help-center/home-view' | 'open/devex-platform' | 'open/drafts' | 'open/home' | 'connect/integrations' | 'open/autolinks' | 'open/graph' | 'open/launchpad' | 'create/worktree' | 'open/help-center' | 'plus/sign-up' | 'plus/upgrade' | 'plus/reactivate' | 'open/walkthrough' | 'open/inspect' | 'switch/ai-model',
21612163
'type': 'url',
21622164
'url': string
21632165
}
@@ -2167,7 +2169,7 @@ or
21672169

21682170
```typescript
21692171
{
2170-
'context.key': 'integrations' | 'homeView' | 'gettingStarted' | 'visualizeCodeHistory' | 'prReviews' | 'streamlineCollaboration'
2172+
'context.key': 'integrations' | 'homeView' | 'gettingStarted' | 'visualizeCodeHistory' | 'prReviews' | 'streamlineCollaboration' | 'aiFeatures'
21712173
}
21722174
```
21732175

package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21131,7 +21131,7 @@
2113121131
},
2113221132
{
2113321133
"view": "gitlens.views.scm.grouped",
21134-
"contents": "In GitLens 16, we've grouped many related views—Commits, Branches, Stashes, etc—here for easier view management.\n\n[Continue](command:gitlens.views.scm.grouped.welcome.dismiss)\n\nPrefer them separate? [Restore views to previous locations](command:gitlens.views.scm.grouped.welcome.restore)\n\nUse the tabs above to navigate, or detach the views you want to keep separated. You can regroup them anytime using the 'x' in the view header.",
21134+
"contents": "GitLens groups many related views—Commits, Branches, Stashes, etc—here for easier view management.\n\n[Continue](command:gitlens.views.scm.grouped.welcome.dismiss)\n\nPrefer them separate? [Restore views to previous locations](command:gitlens.views.scm.grouped.welcome.restore)\n\nUse the tabs above to navigate, or detach the views you want to keep separated. You can regroup them anytime using the 'x' in the view header.",
2113521135
"when": "gitlens:views:scm:grouped:welcome && !gitlens:install:new"
2113621136
},
2113721137
{
@@ -21626,7 +21626,7 @@
2162621626
},
2162721627
{
2162821628
"id": "welcome-home-view",
21629-
"title": "(New) The Home View",
21629+
"title": "Home View",
2163021630
"description": "Compact yet powerful, the Home View helps you quickly start work on issues, create PRs, and manage branches—all from a single intelligent view.\n\nImprove workflow visibility with clear paths to take action on:\n\n- What am I actively working on now?\n- What should I work on next?\n- What have I worked on recently?\n\nThe Home View is the perfect companion for developers looking to reduce tedious context switching and stay focused on their work in VS Code.\n\n\n[Open the Home View](command:gitlens.walkthrough.showHomeView)\n$(gitlens-play-button)  [Watch a video on the Home view](command:gitlens.walkthrough.openHomeViewVideo)",
2163121631
"media": {
2163221632
"markdown": "walkthroughs/welcome/home.md"
@@ -21678,6 +21678,17 @@
2167821678
"completionEvents": [
2167921679
"onContext:gitlens:walkthroughState:integrations == true"
2168021680
]
21681+
},
21682+
{
21683+
"id": "ai-features",
21684+
"title": "Built-in AI",
21685+
"description": "GitLens AI features help you instantly generate commits, explain code, and much more to optimize your development processes.\n\n- **Generate Commit & Stash Messages**: Quickly create descriptive commit and stash messages.\n- **Explain Changes**: Instantly understand what changed in commits, branches, stashes, and WIP with concise, AI-generated explanations.\n- **Open Pull Requests**: Automatically generate clear PR titles and descriptions that explain your branch changes and speed up review cycles.\n- **Generate Changelogs**: Effortlessly summarize repository changes for release notes or documentation updates.\n\n[Configure GitLens AI](command:gitlens.walkthrough.switchAIModel)",
21686+
"media": {
21687+
"markdown": "walkthroughs/welcome/ai-features.md"
21688+
},
21689+
"completionEvents": [
21690+
"onContext:gitlens:walkthroughState:aiFeatures == true"
21691+
]
2168121692
}
2168221693
]
2168321694
}

src/commands/walkthroughs.ts

Lines changed: 97 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { Source, Sources } from '../constants.telemetry';
55
import type { Container } from '../container';
66
import type { SubscriptionUpgradeCommandArgs } from '../plus/gk/models/subscription';
77
import type { LaunchpadCommandArgs } from '../plus/launchpad/launchpad';
8-
import { command, executeCommand } from '../system/-webview/command';
8+
import { command, executeCommand, executeCoreCommand } from '../system/-webview/command';
99
import { openWalkthrough as openWalkthroughCore } from '../system/-webview/vscode';
1010
import { openUrl } from '../system/-webview/vscode/uris';
1111
import type { ConnectCloudIntegrationsCommandArgs } from './cloudIntegrations';
@@ -411,3 +411,99 @@ export class WalkthroughShowHomeViewCommand extends GlCommandBase {
411411
executeCommand(command);
412412
}
413413
}
414+
415+
// gitlens.switchAIModel
416+
@command()
417+
export class WalkthroughSwitchAIModelCommand extends GlCommandBase {
418+
constructor(private readonly container: Container) {
419+
super('gitlens.walkthrough.switchAIModel');
420+
}
421+
422+
execute(): void {
423+
const command: GlCommands = 'gitlens.switchAIModel';
424+
this.container.telemetry.sendEvent('walkthrough/action', {
425+
type: 'command',
426+
name: 'switch/ai-model',
427+
command: command,
428+
});
429+
executeCommand(command);
430+
}
431+
}
432+
433+
// command:workbench.action.openSettings?%22gitlens.ai%22
434+
@command()
435+
export class WalkthroughEnableAiSetting extends GlCommandBase {
436+
constructor(private readonly container: Container) {
437+
super('gitlens.walkthrough.enableAiSetting');
438+
}
439+
440+
execute(): void {
441+
// should open to the VS Code settings page to the GitLens AI settings
442+
443+
this.container.telemetry.sendEvent('walkthrough/action', {
444+
type: 'command',
445+
name: 'open/ai-enable-setting',
446+
command: 'workbench.action.openSettings',
447+
detail: '@id:gitlens.ai.enabled',
448+
});
449+
executeCoreCommand('workbench.action.openSettings', '@id:gitlens.ai.enabled');
450+
}
451+
}
452+
453+
// command:workbench.action.openSettings?%22gitlens.ai%22
454+
@command()
455+
export class WalkthroughOpenAiCustomInstructionsSettings extends GlCommandBase {
456+
constructor(private readonly container: Container) {
457+
super('gitlens.walkthrough.openAiCustomInstructionsSettings');
458+
}
459+
460+
execute(): void {
461+
// should open to the VS Code settings page to the GitLens AI settings
462+
463+
this.container.telemetry.sendEvent('walkthrough/action', {
464+
type: 'command',
465+
name: 'open/ai-custom-instructions-settings',
466+
command: 'workbench.action.openSettings',
467+
detail: '@ext:eamodio.gitlens gitlens.ai custom instructions',
468+
});
469+
executeCoreCommand('workbench.action.openSettings', '@ext:eamodio.gitlens gitlens.ai custom instructions');
470+
}
471+
}
472+
473+
// command:workbench.action.openSettings?%22gitlens.ai%22
474+
@command()
475+
export class WalkthroughOpenAiSettings extends GlCommandBase {
476+
constructor(private readonly container: Container) {
477+
super('gitlens.walkthrough.openAiSettings');
478+
}
479+
480+
execute(): void {
481+
// should open to the VS Code settings page to the GitLens AI settings
482+
483+
this.container.telemetry.sendEvent('walkthrough/action', {
484+
type: 'command',
485+
name: 'open/ai-settings',
486+
command: 'workbench.action.openSettings',
487+
detail: 'gitlens.ai',
488+
});
489+
executeCoreCommand('workbench.action.openSettings', 'gitlens.ai');
490+
}
491+
}
492+
493+
// https://help.gitkraken.com/gitlens/gitlens-ai
494+
@command()
495+
export class WalkthroughOpenLearnAboutAiFeatures extends GlCommandBase {
496+
constructor(private readonly container: Container) {
497+
super('gitlens.walkthrough.openLearnAboutAiFeatures');
498+
}
499+
500+
execute(): void {
501+
const url = urls.aiFeatures;
502+
this.container.telemetry.sendEvent('walkthrough/action', {
503+
type: 'url',
504+
name: 'open/help-center/ai-features',
505+
url: url,
506+
});
507+
void openUrl(url);
508+
}
509+
}

src/constants.commands.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,16 @@ type InternalTimelineWebviewViewCommands = 'gitlens.views.timeline.openInTab';
8484

8585
type InternalWalkthroughCommands =
8686
| 'gitlens.walkthrough.connectIntegrations'
87+
| 'gitlens.walkthrough.enableAiSetting'
8788
| 'gitlens.walkthrough.gitlensInspect'
8889
| 'gitlens.walkthrough.openAcceleratePrReviews'
90+
| 'gitlens.walkthrough.openAiCustomInstructionsSettings'
91+
| 'gitlens.walkthrough.openAiSettings'
8992
| 'gitlens.walkthrough.openCommunityVsPro'
9093
| 'gitlens.walkthrough.openHelpCenter'
9194
| 'gitlens.walkthrough.openHomeViewVideo'
9295
| 'gitlens.walkthrough.openInteractiveCodeHistory'
96+
| 'gitlens.walkthrough.openLearnAboutAiFeatures'
9397
| 'gitlens.walkthrough.openStartIntegrations'
9498
| 'gitlens.walkthrough.openStreamlineCollaboration'
9599
| 'gitlens.walkthrough.openWalkthrough'
@@ -101,6 +105,7 @@ type InternalWalkthroughCommands =
101105
| 'gitlens.walkthrough.showGraph'
102106
| 'gitlens.walkthrough.showHomeView'
103107
| 'gitlens.walkthrough.showLaunchpad'
108+
| 'gitlens.walkthrough.switchAIModel'
104109
| 'gitlens.walkthrough.worktree.create'
105110
| 'gitlens.walkthrough.openDevExPlatform';
106111

src/constants.telemetry.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,10 @@ interface WalkthroughEvent {
902902
}
903903

904904
type WalkthroughActionNames =
905+
| 'open/ai-custom-instructions-settings'
906+
| 'open/ai-enable-setting'
907+
| 'open/ai-settings'
908+
| 'open/help-center/ai-features'
905909
| 'open/help-center/start-integrations'
906910
| 'open/help-center/accelerate-pr-reviews'
907911
| 'open/help-center/streamline-collaboration'
@@ -921,11 +925,12 @@ type WalkthroughActionNames =
921925
| 'plus/upgrade'
922926
| 'plus/reactivate'
923927
| 'open/walkthrough'
924-
| 'open/inspect';
928+
| 'open/inspect'
929+
| 'switch/ai-model';
925930

926931
type WalkthroughActionEvent =
927-
| { type: 'command'; name: WalkthroughActionNames; command: string }
928-
| { type: 'url'; name: WalkthroughActionNames; url: string };
932+
| { type: 'command'; name: WalkthroughActionNames; command: string; detail?: string }
933+
| { type: 'url'; name: WalkthroughActionNames; url: string; detail?: string };
929934

930935
interface WalkthroughCompletionEvent {
931936
'context.key': WalkthroughContextKeys;

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ export const urls = Object.freeze({
183183
interactiveCodeHistory: `https://help.gitkraken.com/gitlens/gitlens-start-here/?${utm}#interactive-code-history`,
184184
startIntegrations: `https://help.gitkraken.com/gitlens/gitlens-start-here/?${utm}#improve-workflows-with-integrations`,
185185
streamlineCollaboration: `https://help.gitkraken.com/gitlens/gitlens-start-here/?${utm}#streamline-collaboration`,
186+
aiFeatures: `https://help.gitkraken.com/gitlens/gl-gk-ai/?${utm}`,
186187
});
187188

188189
export type WalkthroughSteps =

src/telemetry/walkthroughStateProvider.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export type WalkthroughContextKeys =
1515
| 'visualizeCodeHistory'
1616
| 'prReviews'
1717
| 'streamlineCollaboration'
18-
| 'integrations';
18+
| 'integrations'
19+
| 'aiFeatures';
1920

2021
type WalkthroughUsage = {
2122
subscriptionStates?: SubscriptionState[] | Readonly<SubscriptionState[]>;
@@ -117,6 +118,29 @@ const walkthroughRequiredMapping: Readonly<Map<WalkthroughContextKeys, Walkthrou
117118
],
118119
},
119120
],
121+
[
122+
'aiFeatures',
123+
{
124+
usage: [
125+
`command:${'gitlens.walkthrough.openAiSettings' satisfies GlCommands}:executed`,
126+
`command:${'gitlens.ai.explainBranch' satisfies GlCommands}:executed`,
127+
`command:${'gitlens.ai.explainCommit' satisfies GlCommands}:executed`,
128+
`command:${'gitlens.ai.explainStash' satisfies GlCommands}:executed`,
129+
`command:${'gitlens.ai.explainWip' satisfies GlCommands}:executed`,
130+
`command:${'gitlens.ai.generateChangelog' satisfies GlCommands}:executed`,
131+
`command:${'gitlens.ai.generateCommitMessage' satisfies GlCommands}:executed`,
132+
`command:${'gitlens.graph.ai.explainBranch' satisfies GlCommands}:executed`,
133+
`command:${'gitlens.graph.ai.explainCommit' satisfies GlCommands}:executed`,
134+
`command:${'gitlens.graph.ai.explainStash' satisfies GlCommands}:executed`,
135+
`command:${'gitlens.graph.ai.explainWip' satisfies GlCommands}:executed`,
136+
`command:${'gitlens.graph.ai.generateChangelogFrom' satisfies GlCommands}:executed`,
137+
`command:${'gitlens.graph.ai.generateCommitMessage' satisfies GlCommands}:executed`,
138+
`command:${'gitlens.scm.ai.generateCommitMessage' satisfies GlCommands}:executed`,
139+
`command:${'gitlens.views.ai.generateChangelog' satisfies GlCommands}:executed`,
140+
`command:${'gitlens.views.ai.generateChangelogFrom' satisfies GlCommands}:executed`,
141+
],
142+
},
143+
],
120144
]);
121145

122146
export class WalkthroughStateProvider implements Disposable {

walkthroughs/welcome/ai-features.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<img src="./thumbnails/ai-features.jpg" alt="Generate Commit Message in Home View"/>
2+
3+
GitLens AI features use GitHub Copilot, if available, or GitKraken AI, which is included with your GitLens Pro subscription — no setup required.
4+
5+
GitLens also supports many "bring your own key" (BYOK) AI providers and models, including OpenAI, Anthropic, Gemini, etc, and local models via Ollama.
6+
7+
You can change the selected AI provider and model from the Integrations menu in the Home view or from the [Command Palette](command:gitlens.walkthrough.switchAIModel).
8+
9+
Community users can generate commit messages for free using GitHub Copilot or a BYOK provider with a free GitKraken account.
10+
11+
If you want to [disable](command:gitlens.walkthrough.enableAiSetting) or modify AI features, including [custom prompt instructions](command:gitlens.walkthrough.openAiCustomInstructionsSettings), you can do so in [Settings](command:gitlens.walkthrough.openAiSettings).
12+
13+
[Learn more about GitKraken AI](command:gitlens.walkthrough.openLearnAboutAiFeatures)
Loading

0 commit comments

Comments
 (0)