Skip to content

adtk search

The search command group provides text search across code repositories, work items, WIQL queries, and saved queries.

FlagShortDefaultDescription
--project-pProject name (optional, scopes the search)
--top25Max results to return

Search code across all repositories in the organization or project.

Terminal window
adtk search code <query> [--project myproject] [--top 25]

Example:

Terminal window
adtk search code "func handleAuth" -p MyProject
FILE PATH REPOSITORY PROJECT
auth.go /src/handlers/auth.go backend-api MyProject
middleware.go /src/middleware/middleware.go backend-api MyProject
2 results

Search work items by text across all fields.

Terminal window
adtk search work-items <query> [--project myproject] [--top 25]

Example:

Terminal window
adtk search work-items "login redirect bug" -p MyProject
ID TYPE TITLE STATE PROJECT
42 Bug Fix login page redirect Active MyProject
78 Task Investigate redirect loop on login Closed MyProject
2 results

Execute a WIQL (Work Item Query Language) query directly.

Terminal window
adtk search wiql <query> [--project myproject] [--top 25]

Example:

Terminal window
adtk search wiql "SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.State] = 'Active' AND [System.WorkItemType] = 'Bug' ORDER BY [System.ChangedDate] DESC" -p MyProject --top 10
ID TYPE TITLE STATE
42 Bug Fix login page redirect Active
67 Bug Memory leak in background worker Active
2 work items

Run a saved query by its ID or path. Returns work items matching the saved query definition.

Terminal window
adtk search query <id-or-path> [--project myproject] [--top 25]

Example:

Terminal window
adtk search query "My Saved Queries/Active Bugs" -p MyProject
ID TYPE TITLE STATE
42 Bug Fix login page redirect Active
67 Bug Memory leak in background worker Active
2 work items