Skip to content

Commit f7e8a8f

Browse files
ADO Lens 0.13.0
Several projects of one organization in one connection. - Fixed: adding a second project of the same Azure DevOps (login, the settings window, `adolens login`) replaced the first one, without a word - the connection is named after the organization. Another project is now added to the connection; the default stays. - A connection holds a default project and others (`moreProjects`): `adolens config --add-project / --remove-project`, `--project` makes one the default (the previous default stays among the others), the settings window has a field "Other projects of this organization", and `adolens connections`, `ado_settings` show them. - Without `project=`, `ado_search` (work items, wiki, code), `ado_file`, `ado_pr` (lists, merged), `ado_pipeline` (builds, deployments, artifacts, runs), `ado_label` and finding the environments look in every project of the connection: lists under each project's name, a build, file or pipeline in the first project that has it. Creating work items, sprints, boards and backlogs use the default project unless one is named; Claude gets the list of projects in its instructions.
1 parent a2a8c44 commit f7e8a8f

18 files changed

Lines changed: 234 additions & 14 deletions

‎CHANGELOG.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 0.13.0 — 2026-11-13
4+
5+
Several projects of one organization in one connection.
6+
7+
- Fixed: adding a second project of the same Azure DevOps (login, the settings window, `adolens login`) replaced the
8+
first one, without a word - the connection is named after the organization. Another project is now added to the
9+
connection; the default stays.
10+
- A connection holds a default project and others (`moreProjects`): `adolens config --add-project / --remove-project`,
11+
`--project` makes one the default (the previous default stays among the others), the settings window has a field
12+
"Other projects of this organization", and `adolens connections`, `ado_settings` show them.
13+
- Without `project=`, `ado_search` (work items, wiki, code), `ado_file`, `ado_pr` (lists, merged), `ado_pipeline`
14+
(builds, deployments, artifacts, runs), `ado_label` and finding the environments look in every project of the
15+
connection: lists under each project's name, a build, file or pipeline in the first project that has it. Creating
16+
work items, sprints, boards and backlogs use the default project unless one is named; Claude gets the list of
17+
projects in its instructions.
18+
319
## 0.12.2 — 2026-11-04
420

521
- Fixed: newer Claude Desktop versions keep their configuration in `%LOCALAPPDATA%\Claude-Data\<app>\` and leave only a

‎README.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,13 @@ when a project has more than one active repository, and leave out work branches
171171
adolens config --connection contoso --env "ERP:dev=DEV (sbx01)" --env "ERP:staging=UAT (sbx03)" --env "ERP:master=PROD" --env "Common:master=PROD"
172172
```
173173

174+
**Several projects of one organization.** A connection holds a default project and as many others as needed (work
175+
items and code in both, e.g. one for X++ and one for C# applications): signing in again with another project of the same
176+
organization adds it, `adolens config --connection contoso --add-project Apps` too, and the settings window has a field
177+
for them. Search, files, pull requests, pipelines and finding the environments look in all of them, each answer under its
178+
project's name; creating work items and sprints, boards and backlogs use the default unless Claude passes `project=`
179+
(it gets the list of projects).
180+
174181
**Code in another project.** When the work items live in one project and the code, pull requests and pipelines in
175182
another, set it once: `adolens config --connection contoso --code-project ERP` (or ask Claude: `ado_settings
176183
codeProject=ERP`). `ado_file`, `ado_search` (code), `ado_pr`, `ado_pipeline` and `ado_label` then look there.

‎README.pl.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,13 @@ więcej niż jedno aktywne repozytorium, i pomijają gałęzie robocze (`000000_
172172
adolens config --connection contoso --env "ERP:dev=DEV (sbx01)" --env "ERP:staging=UAT (sbx03)" --env "ERP:master=PROD" --env "Common:master=PROD"
173173
```
174174

175+
**Kilka projektów jednej organizacji.** Połączenie ma projekt domyślny i dowolnie wiele innych (work itemy i kod w
176+
obu, np. jeden na X++, drugi na aplikacje w C#): ponowne zalogowanie z innym projektem tej samej organizacji dopisuje go,
177+
tak samo `adolens config --connection contoso --add-project Aplikacje`, a okno ustawień ma na nie pole. Wyszukiwanie,
178+
pliki, pull requesty, pipeline'y i wykrywanie środowisk patrzą we wszystkie, każda odpowiedź pod nazwą swojego projektu;
179+
tworzenie work itemów oraz sprinty, tablice i backlogi używają domyślnego, chyba że Claude poda `project=` (dostaje listę
180+
projektów).
181+
175182
**Kod w innym projekcie.** Gdy work itemy są w jednym projekcie, a kod, pull requesty i pipeline'y w innym, ustaw to
176183
raz: `adolens config --connection contoso --code-project ERP` (albo poproś Claude'a: `ado_settings codeProject=ERP`).
177184
Wtedy `ado_file`, `ado_search` (kod), `ado_pr`, `ado_pipeline` i `ado_label` szukają tam.

‎src/AdoLens/AdoLens.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<AssemblyTitle>ADO Lens for Azure DevOps</AssemblyTitle>
2626
<Description>Azure DevOps (work items, boards, wiki, Git and TFVC, pipelines) served to AI assistants over MCP</Description>
2727
<Copyright>Copyright © 2026 WillowDev</Copyright>
28-
<Version>0.12.2</Version>
28+
<Version>0.13.0</Version>
2929
</PropertyGroup>
3030

3131
<ItemGroup>

‎src/AdoLens/Cli.cs‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ logout remove the stored PAT of a connection --connection <name>
2727
connections list the connections
2828
config show or change settings
2929
--connection <name> --project <name> --team <name> (defaults of a connection)
30+
--add-project <name> / --remove-project <name> (more projects of the organization; --project sets the default)
3031
--code-project <name> (code, pull requests and pipelines in another project; "" clears)
3132
--default-connection <name> --mode po|dev|full --usage-log true|false
3233
--show-tokens true|false --tool-loading auto|demand|all --add-toolset <set> --remove-toolset <set> --confirm-above <n>
@@ -172,7 +173,10 @@ public async Task<int> LoginAsync()
172173
project = PickProject(projects);
173174
if (project is not null && projects.Count > 0 && !projects.Contains(project, StringComparer.OrdinalIgnoreCase))
174175
Console.WriteLine($"note: project '{project}' is not visible with this PAT");
175-
conn.Project = project is null ? null : projects.FirstOrDefault(p => p.Equals(project, StringComparison.OrdinalIgnoreCase)) ?? project;
176+
project = project is null ? null : projects.FirstOrDefault(p => p.Equals(project, StringComparison.OrdinalIgnoreCase)) ?? project;
177+
// Another project of the same organization is added to the connection, never put in place of its default.
178+
var added = project is not null && stored?.Project is { } before && !before.Equals(project, StringComparison.OrdinalIgnoreCase);
179+
if (project is not null) conn.AddProject(project);
176180
if (cl.Opt("team") is { } team) conn.Team = NullIfEmpty(team);
177181

178182
CredentialStore.Write(name, org, pat);
@@ -183,7 +187,10 @@ public async Task<int> LoginAsync()
183187

184188
Console.WriteLine($"connection '{name}' saved{(settings.DefaultConnection == name ? " (default)" : "")}: {SettingsPath}");
185189
Console.WriteLine($"PAT saved in Windows Credential Manager: {CredentialStore.TargetFor(name)}");
186-
if (conn.Project is { } p)
190+
if (added)
191+
Console.WriteLine($"project {project} added to connection '{name}' (projects: {string.Join(", ", conn.AllProjects())}; default {conn.Project} - " +
192+
$"change with 'adolens config --connection {name} --project {project}')");
193+
else if (conn.Project is { } p)
187194
Console.WriteLine($"default project: {p}");
188195
return 0;
189196
}
@@ -245,7 +252,7 @@ public int Connections()
245252
{
246253
var pat = CredentialStore.Read(name) is not null ? "PAT stored" : "no stored PAT";
247254
Console.WriteLine($"{(name.Equals(settings.DefaultConnection, StringComparison.OrdinalIgnoreCase) ? "*" : " ")} {name,-16} " +
248-
$"https://dev.azure.com/{c.Organization} project {c.Project ?? "-"}{(c.CodeProject is { } cp ? $" code in {cp}" : "")} team {c.Team ?? "-"} ({pat})" +
255+
$"https://dev.azure.com/{c.Organization} project {c.Project ?? "-"}{(c.MoreProjects.Count > 0 ? $" (+ {string.Join(", ", c.MoreProjects)})" : "")}{(c.CodeProject is { } cp ? $" code in {cp}" : "")} team {c.Team ?? "-"} ({pat})" +
249256
(c.Environments.Count > 0 ? $"\n {"",-16} environments: {string.Join(", ", c.Environments.Select(e => $"{e.Key} = {e.Value}"))}" : "") +
250257
(c.LabelLanguages.Count > 0 ? $"\n {"",-16} label languages: {string.Join(", ", c.LabelLanguages)}" : ""));
251258
}
@@ -262,7 +269,9 @@ public int Config()
262269
{
263270
if (!settings.Connections.TryGetValue(name, out var conn))
264271
throw new ArgumentException($"no connection named '{name}' - add it with 'adolens login --connection {name}'");
265-
if (cl.Opt("project") is { } p) { conn.Project = NullIfEmpty(p); changed = true; }
272+
if (cl.Opt("project") is { } p) { conn.SetDefaultProject(p); changed = true; }
273+
while (cl.Opt("add-project") is { } ap) { conn.AddProject(ap); changed = true; }
274+
while (cl.Opt("remove-project") is { } rp) { conn.MoreProjects.RemoveAll(x => x.Equals(rp.Trim(), StringComparison.OrdinalIgnoreCase)); changed = true; }
266275
if (cl.Opt("team") is { } t) { conn.Team = NullIfEmpty(t); changed = true; }
267276
if (cl.Opt("code-project") is { } cp) { conn.CodeProject = NullIfEmpty(cp); changed = true; }
268277
while (cl.Opt("env") is { } e)

‎src/AdoLens/CommandLine.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public sealed partial class CommandLine
2323
["pr"] = ["connection=", "project=", "repo=", "list=", "detail=", "merged=", "since=", "top="],
2424
["pipeline"] = ["connection=", "project=", "definition=", "branch=", "top=", "detail=", "artifacts", "artifact=", "part=", "save", "to=", "deployments", "stage="],
2525
["changes"] = ["connection=", "repo=", "file=", "detail="],
26-
["config"] = ["env=", "remove-env=", "connection=", "default-connection=", "project=", "code-project=", "team=", "mode=", "usage-log=", "add-toolset=", "remove-toolset=", "confirm-above=", "show-tokens=", "tool-loading=", "language=", "label-languages=", "download-dir="],
26+
["config"] = ["env=", "remove-env=", "connection=", "default-connection=", "project=", "add-project=", "remove-project=", "code-project=", "team=", "mode=", "usage-log=", "add-toolset=", "remove-toolset=", "confirm-above=", "show-tokens=", "tool-loading=", "language=", "label-languages=", "download-dir="],
2727
["item"] = ["connection=", "include=", "detail="],
2828
["query"] = ["connection=", "project=", "wiql=", "query=", "top="],
2929
["create"] = ["connection=", "project=", "type=", "title=", "description=", "criteria=", "assign=", "parent=", "iteration=", "area=", "tags=", "state=", "field=", "template="],

‎src/AdoLens/EnvironmentFlow.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void From(string key, string source)
3636
if (!list.Contains(source)) list.Add(source);
3737
}
3838
static string Day(DateTime? d) => d?.ToLocalTime().ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture) ?? "?";
39-
var projects = new[] { session.Config.CodeProject, project }.Where(p => !string.IsNullOrWhiteSpace(p)).Select(p => p!)
39+
var projects = new[] { session.Config.CodeProject, project }.Concat(session.Config.Projects).Where(p => !string.IsNullOrWhiteSpace(p)).Select(p => p!)
4040
.Distinct(StringComparer.OrdinalIgnoreCase).ToList();
4141
var keys = new List<string>();
4242
// Long-lived branches of the repositories in use (a commit in the last half year); feature and work branches are

‎src/AdoLens/Knowledge.cs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ public static partial class Knowledge
1919
/// <summary>One search over work items, wiki pages and code of a project, grouped; each part fails on its own.</summary>
2020
public static async Task<string> SearchAsync(Lens lens, string? connection, string? project, string text, string? scope, int top, CancellationToken ct = default)
2121
{
22+
// Several projects in the connection and none named: ask each one.
23+
if (project is null && lens.For(connection).SearchProjects(null) is { Count: > 1 } projects)
24+
return await ProjectFanOut.EachAsync(projects, p => SearchAsync(lens, connection, p, text, scope, top, ct));
2225
if (string.IsNullOrWhiteSpace(text)) throw new ArgumentException("text is required");
2326
var session = lens.For(connection);
2427
var name = session.Project(project);
@@ -284,6 +287,9 @@ sealed record FileRef(bool Tfvc, string Path, string? RepoId, string? RepoName,
284287
public static async Task<string> FileAsync(Lens lens, string? connection, string? project, string path, string? repo, string? version,
285288
string? part, bool history, int top, string? detail, CancellationToken ct = default)
286289
{
290+
// Several projects in the connection and none named: ask each one.
291+
if (project is null && lens.For(connection).SearchProjects(null) is { Count: > 1 } projects)
292+
return await ProjectFanOut.FirstAsync(projects, p => FileAsync(lens, connection, p, path, repo, version, part, history, top, detail, ct));
287293
var session = lens.For(connection);
288294
var name = session.CodeProject(project);
289295
var (file, choices) = await ResolveAsync(session, name, path, repo, ct);

‎src/AdoLens/Labels.cs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ internal static string SearchWords(string seen) =>
7373

7474
public static async Task<string> FindAsync(Lens lens, string? connection, string? project, string text, string? branch, CancellationToken ct = default)
7575
{
76+
// Several projects in the connection and none named: ask each one.
77+
if (project is null && lens.For(connection).SearchProjects(null) is { Count: > 1 } projects)
78+
return await ProjectFanOut.FirstAsync(projects, p => FindAsync(lens, connection, p, text, branch, ct));
7679
if (string.IsNullOrWhiteSpace(text)) throw new ArgumentException("give the text of the message (as seen on screen) or a label id like @Model:Id");
7780
var session = lens.For(connection);
7881
var name = session.CodeProject(project);

‎src/AdoLens/Lens.cs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ public sealed record Session(Config Config, AdoClient Client, MetadataService Me
1818
public string CodeProject(string? project) =>
1919
!string.IsNullOrWhiteSpace(project) ? project.Trim() : Config.CodeProject ?? Project(null);
2020

21+
/// <summary>
22+
/// The projects to look in when none is named: all of the connection, the code project first. One project (or one
23+
/// named): just that one.
24+
/// </summary>
25+
public IReadOnlyList<string> SearchProjects(string? project) =>
26+
!string.IsNullOrWhiteSpace(project) || Config.Projects.Count < 2 ? [CodeProject(project)]
27+
: Config.Projects.OrderBy(p => p.Equals(Config.CodeProject, StringComparison.OrdinalIgnoreCase) ? 0 : 1).ToList();
28+
2129
/// <summary>The project given, else the connection's default project.</summary>
2230
public string Project(string? project) =>
2331
!string.IsNullOrWhiteSpace(project) ? project.Trim()

0 commit comments

Comments
 (0)