Skip to content

Commit e988e73

Browse files
committed
Rename IsCopilotCli to IsCopilot in AiCliDetector
Renames the IsCopilotCli property to IsCopilot and updates its detection logic to use the GITHUB_COPILOT_RUNTIME environment variable instead of GITHUB_COPILOT_CLI. Updates all references and documentation accordingly.
1 parent 58b4bbe commit e988e73

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ There are also individual properties to check for each specific AI CLI
177177
<!-- snippet: AiCliDetectorProps -->
178178
<a id='snippet-AiCliDetectorProps'></a>
179179
```cs
180-
var isCopilotCli = AiCliDetector.IsCopilotCli;
180+
var isCopilot = AiCliDetector.IsCopilot;
181181
var isAider = AiCliDetector.IsAider;
182182
var isClaudeCode = AiCliDetector.IsClaudeCode;
183183
```

src/DiffEngine.Tests/AiCliDetectorTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ public void Props()
88

99
#region AiCliDetectorProps
1010

11-
var isCopilotCli = AiCliDetector.IsCopilotCli;
11+
var isCopilot = AiCliDetector.IsCopilot;
1212
var isAider = AiCliDetector.IsAider;
1313
var isClaudeCode = AiCliDetector.IsClaudeCode;
1414

1515
#endregion
1616

17+
Assert.True(isCopilot);
1718
// ReSharper restore UnusedVariable
1819
}
1920
}

src/DiffEngine/AiCliDetector.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ public static class AiCliDetector
55
static AiCliDetector()
66
{
77
var variables = Environment.GetEnvironmentVariables();
8-
9-
// GitHub Copilot CLI
8+
9+
// GitHub Copilot
1010
// https://docs.github.com/en/copilot/using-github-copilot/using-github-copilot-in-the-command-line
11-
IsCopilotCli = variables.Contains("GITHUB_COPILOT_CLI");
11+
IsCopilot = variables.Contains("GITHUB_COPILOT_RUNTIME");
1212

1313
// Aider
1414
// https://aider.chat/docs/config/dotenv.html
@@ -18,12 +18,12 @@ static AiCliDetector()
1818
// https://docs.anthropic.com/en/docs/build-with-claude/claude-cli
1919
IsClaudeCode = variables.Contains("CLAUDE_CODE") || variables.Contains("ANTHROPIC_CLI");
2020

21-
Detected = IsCopilotCli ||
21+
Detected = IsCopilot ||
2222
IsAider ||
2323
IsClaudeCode;
2424
}
2525

26-
public static bool IsCopilotCli { get; }
26+
public static bool IsCopilot { get; }
2727

2828
public static bool IsAider { get; }
2929

0 commit comments

Comments
 (0)