Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DevOps/Options/ConfigOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ public class ConfigOptions
[Option('o', "org", Required = false, HelpText = "Azure DevOps organization URL (e.g., https://dev.azure.com/myorg).")]
public string OrgUrl { get; set; }

[Option('p', "pat", Required = false, HelpText = "Personal Access Token for authentication.")]
[Option('P', "pat", Required = false, HelpText = "Personal Access Token for authentication.")]
public string Pat { get; set; }

[Option('l', "login", Required = false, HelpText = "Sign in interactively with Microsoft Entra ID (opens a browser).")]
[Option("login", Required = false, HelpText = "Sign in interactively with Microsoft Entra ID (opens a browser).")]
public bool Login { get; set; }

[Option("logout", Required = false, HelpText = "Sign out and clear the cached Entra ID token.")]
Expand All @@ -20,7 +20,7 @@ public class ConfigOptions
[Option("tenant", Required = false, HelpText = "Entra ID tenant ID or domain to sign in against (defaults to your home tenant).")]
public string Tenant { get; set; }

[Option('P', "project", Required = false, HelpText = "Default project name used when --project is omitted from other commands.")]
[Option('p', "project", Required = false, HelpText = "Default project name used when --project is omitted from other commands.")]
public string Project { get; set; }

[Option('T', "team", Required = false, HelpText = "Default team name used to resolve the active iteration (defaults to '{Project} Team').")]
Expand Down
4 changes: 2 additions & 2 deletions DevOps/Options/ListOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace DevOps.Options;
[Verb("list", HelpText = "List work items.")]
public class ListOptions
{
[Option('P', "project", Required = false, HelpText = "Project name. Uses default if configured.")]
[Option('p', "project", Required = false, HelpText = "Project name. Uses default if configured.")]
public string Project { get; set; }

[Option('s', "state", Required = false, HelpText = "Filter by state (e.g., Active, Closed, Resolved).")]
Expand All @@ -20,7 +20,7 @@ public class ListOptions
[Option('q', "query", Required = false, HelpText = "WIQL WHERE clause for advanced filtering.")]
public string Query { get; set; }

[Option('p', "parent", Required = false, HelpText = "Filter by parent work item ID.")]
[Option('P', "parent", Required = false, HelpText = "Filter by parent work item ID.")]
public int? ParentId { get; set; }

[Option("ids", Required = false, HelpText = "Show work item IDs in output.")]
Expand Down
4 changes: 2 additions & 2 deletions DevOps/Options/MineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace DevOps.Options;
[Verb("mine", HelpText = "List work items assigned to me.")]
public class MineOptions
{
[Option('P', "project", Required = false, HelpText = "Project name. Uses default if configured.")]
[Option('p', "project", Required = false, HelpText = "Project name. Uses default if configured.")]
public string Project { get; set; }

[Option('s', "state", Required = false, HelpText = "Filter by state (e.g., Active, Closed, Resolved).")]
Expand All @@ -17,7 +17,7 @@ public class MineOptions
[Option('q', "query", Required = false, HelpText = "Additional WIQL WHERE clause.")]
public string Query { get; set; }

[Option('p', "parent", Required = false, HelpText = "Filter by parent work item ID.")]
[Option('P', "parent", Required = false, HelpText = "Filter by parent work item ID.")]
public int? ParentId { get; set; }

[Option('n', "top", Required = false, Default = 50, HelpText = "Maximum number of work items to fetch (default: 50).")]
Expand Down
8 changes: 4 additions & 4 deletions DevOps/Options/NormalizeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace DevOps.Options;
[Verb("normalize", HelpText = "Normalize work item titles to include the parent type and ID prefix.")]
public class NormalizeOptions
{
[Option('P', "project", Required = false, HelpText = "Project name. Uses default if configured.")]
[Option('p', "project", Required = false, HelpText = "Project name. Uses default if configured.")]
public string Project { get; set; }

[Option('s', "state", Required = false, HelpText = "Filter by state (e.g., Active, New).")]
Expand All @@ -14,12 +14,12 @@ public class NormalizeOptions
[Option('a', "assigned-to", Required = false, Default = "me", HelpText = "Filter by assignee. Use 'me' for the current user, or 'any' for all. Defaults to 'me'.")]
public string AssignedTo { get; set; }

[Option('p', "parent", Required = false, HelpText = "Restrict to children of a specific parent ID.")]
[Option('P', "parent", Required = false, HelpText = "Restrict to children of a specific parent ID.")]
public int? ParentId { get; set; }

[Option('n', "dry-run", Required = false, HelpText = "Preview changes without applying them.")]
[Option("dry-run", Required = false, HelpText = "Preview changes without applying them.")]
public bool DryRun { get; set; }

[Option("top", Required = false, Default = 200, HelpText = "Maximum number of tasks to fetch (default: 200).")]
[Option('n', "top", Required = false, Default = 200, HelpText = "Maximum number of tasks to fetch (default: 200).")]
public int Top { get; set; }
}
2 changes: 1 addition & 1 deletion DevOps/Options/PrListOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public class PrListOptions
[Option('n', "top", Required = false, Default = 25, HelpText = "Maximum number of pull requests to show (default: 25).")]
public int Top { get; set; }

[Option('m', "mine", Required = false, HelpText = "Only pull requests created by me.")]
[Option("mine", Required = false, HelpText = "Only pull requests created by me.")]
public bool Mine { get; set; }
}
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ devops config -o https://dev.azure.com/myorg
devops config --login

# Option B — Personal Access Token
devops config -o https://dev.azure.com/myorg -p <PAT>
devops config -o https://dev.azure.com/myorg -P <PAT>
```

Then the shared settings:

```powershell
devops config -P MyProject # set default project
devops config -p MyProject # set default project
devops config -T "MyProject Team" # set default team (for iteration and area resolution)
devops config -e your@email.com # set email manually if auto-detection fails
devops config --show # display current configuration
Expand All @@ -62,11 +62,11 @@ When you sign in (`--login`) or provide a `--pat`, the CLI automatically fetches
| Option | Alias | Description |
|---|---|---|
| `--org` | `-o` | Azure DevOps organization URL |
| `--login` | `-l` | Sign in interactively with Microsoft Entra ID |
| `--login` | | Sign in interactively with Microsoft Entra ID |
| `--logout` | | Sign out and clear the cached Entra ID token |
| `--tenant` | | Entra ID tenant ID or domain to sign in against (defaults to your home tenant) |
| `--pat` | `-p` | Personal Access Token |
| `--project` | `-P` | Default project (used when `--project` is omitted from other commands) |
| `--pat` | `-P` | Personal Access Token |
| `--project` | `-p` | Default project (used when `--project` is omitted from other commands) |
| `--team` | `-T` | Default team for resolving the active iteration and area path (defaults to `{Project} Team`) |
| `--email` | `-e` | Your email address, used to resolve `--assigned-to me`. Set manually if auto-detection fails |
| `--border` | | Table border style for list output: `minimal` (default), `square`, or `markdown` |
Expand All @@ -78,7 +78,7 @@ When you sign in (`--login`) or provide a `--pat`, the CLI automatically fetches

## Work Item Commands

> **Note on `-p`:** most commands use `-p` as the short alias for `--project`. On `list`, `mine` and `normalize`, `-p` is `--parent` instead (project uses `-P` there), so the more common parent filter gets the short flag. When in doubt, use the long form (`--project` / `--parent`).
> **Note on `-p` / `-P`:** `-p` is always `--project`. The uppercase `-P` is each command's secondary flag: `--parent` on `list`, `mine` and `normalize`; `--priority` on `create` and `update`; `--pat` on `config`.

### `get` — Get work item details

Expand All @@ -104,16 +104,16 @@ devops mine
devops mine -s Active
devops mine -t Bug
devops mine -s "In Progress" -t Task
devops mine -p 1234 # only children of work item 1234
devops mine -P 1234 # only children of work item 1234
```

| Option | Alias | Description |
|---|---|---|
| `--project` | `-P` | Project name (uses default if configured) |
| `--project` | `-p` | Project name (uses default if configured) |
| `--state` | `-s` | Filter by state |
| `--type` | `-t` | Filter by work item type |
| `--query` | `-q` | Additional WIQL WHERE clause |
| `--parent` | `-p` | Filter by parent work item ID |
| `--parent` | `-P` | Filter by parent work item ID |
| `--top` | `-n` | Maximum number of work items to fetch (default: 50) |
| `--output` | `-o` | Output format: `json` or `csv`. Defaults to a table |

Expand All @@ -125,8 +125,8 @@ devops mine -p 1234 # only children of work item 1234
devops list
devops list -s Active
devops list -t Bug -a me
devops list -P MyProject -s "In Progress" -t Task
devops list -p 1234 # only children of work item 1234
devops list -p MyProject -s "In Progress" -t Task
devops list -P 1234 # only children of work item 1234
devops list -n 200 # fetch up to 200 items instead of the default 50
devops list -s Active -o json # machine-readable output for scripting
devops list -q "[System.IterationPath] UNDER 'MyProject\\Sprint 1'"
Expand All @@ -136,12 +136,12 @@ Queries fetch up to `--top` items (default 50). When more match than were fetche

| Option | Alias | Description |
|---|---|---|
| `--project` | `-P` | Project name (uses default if configured) |
| `--project` | `-p` | Project name (uses default if configured) |
| `--state` | `-s` | Filter by state (e.g., `Active`, `Closed`, `Resolved`) |
| `--type` | `-t` | Filter by work item type (e.g., `Task`, `Bug`, `User Story`) |
| `--assigned-to` | `-a` | Filter by assignee. Use `me` for the current user |
| `--query` | `-q` | WIQL WHERE clause for advanced filtering |
| `--parent` | `-p` | Filter by parent work item ID |
| `--parent` | `-P` | Filter by parent work item ID |
| `--top` | `-n` | Maximum number of work items to fetch (default: 50) |
| `--output` | `-o` | Output format: `json` or `csv`. Defaults to a table |

Expand Down Expand Up @@ -232,18 +232,18 @@ Renames Tasks whose title follows the `[Role] Description` pattern (e.g., create
devops normalize # normalize my tasks
devops normalize --dry-run # preview without applying
devops normalize -s Active # only tasks in a given state
devops normalize -p 1234 # only children of work item 1234
devops normalize -P 1234 # only children of work item 1234
devops normalize -a any # all tasks, regardless of assignee
```

| Option | Alias | Description |
|---|---|---|
| `--project` | `-P` | Project name (uses default if configured) |
| `--project` | `-p` | Project name (uses default if configured) |
| `--state` | `-s` | Filter by state |
| `--assigned-to` | `-a` | Filter by assignee. Use `me` (default) or `any` for all |
| `--parent` | `-p` | Restrict to children of a specific parent ID |
| `--dry-run` | `-n` | Preview changes without applying them |
| `--top` | | Maximum number of tasks to fetch (default: 200) |
| `--parent` | `-P` | Restrict to children of a specific parent ID |
| `--dry-run` | | Preview changes without applying them |
| `--top` | `-n` | Maximum number of tasks to fetch (default: 200) |

---

Expand Down Expand Up @@ -394,7 +394,7 @@ devops pr-list --mine
| `--status` | `-s` | `active` (default), `completed`, `abandoned`, or `all` |
| `--target` | `-t` | Filter by target branch (e.g., `main`) |
| `--top` | `-n` | Maximum number of PRs to show (default: 25) |
| `--mine` | `-m` | Only pull requests you created |
| `--mine` | | Only pull requests you created |

---

Expand Down Expand Up @@ -540,7 +540,7 @@ Entra sign-in requires the organization policy *"Allow access via Microsoft Entr
### Personal Access Token

```powershell
devops config -o https://dev.azure.com/myorg -p <PAT>
devops config -o https://dev.azure.com/myorg -P <PAT>
```

Go to **User Settings → Personal Access Tokens → New Token** and grant the following scopes:
Expand Down
Loading