Claude-powered CLI for Azure DevOps automation
Project description
Triagent CLI
Claude-powered CLI for Azure DevOps automation.
Overview
Triagent is an interactive command-line tool that uses Claude AI (via Azure AI Foundry) to help automate Azure DevOps operations.
Capabilities
-
Azure DevOps Automation
- Create, update, and query work items
- Create, review, and manage Pull Requests
- Monitor build and release pipelines
- Add PR comments and set votes
-
Kusto Log Analysis
- Generate Kusto queries for Application Insights
- Query AppExceptions, AppRequests, AppDependencies, AppTraces
- Support for multiple Log Analytics workspaces (DEV/QAS/PRD)
-
Defect Investigation
- Automatic investigation workflow for defects/incidents
- Service-to-AppRoleName mapping
- Telemetry correlation across tables
-
Security Controls
- Pre-tool execution validation (blocks dangerous commands)
- Write operation confirmations (configurable)
- Azure CLI and Git operation guards
Architecture
Triagent uses the Claude Agent SDK to provide an AI-powered interactive CLI:
┌─────────────────────────────────────────────────────────┐
│ Triagent CLI │
├─────────────────────────────────────────────────────────┤
│ Interactive REPL │ Slash Commands │ Activity Tracker │
├─────────────────────────────────────────────────────────┤
│ Claude Agent SDK │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────┐ │
│ │ SDK Client │ │ Security │ │ System Prompt │ │
│ │ Options │ │ Hooks │ │ + Team CLAUDE │ │
│ └─────────────┘ └─────────────┘ └─────────────────┘ │
├─────────────────────────────────────────────────────────┤
│ MCP Servers │
│ ┌─────────────────────┐ ┌─────────────────────────┐ │
│ │ triagent (local) │ │ azure-devops (npx) │ │
│ │ - get_team_config │ │ - work items │ │
│ │ - generate_kusto │ │ - pull requests │ │
│ │ - list_tables │ │ - pipelines │ │
│ └─────────────────────┘ └─────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
Components
- TriagentSDKClient: Builds
ClaudeAgentOptionswith hooks, MCP servers, and team-specific prompts - Security Hooks: Pre/post-tool execution validation (blocks dangerous commands, confirms writes)
- MCP Tools: In-process triagent tools + external Azure DevOps MCP server
- Team Configurations: Custom CLAUDE.md files per team with ADO context
Installation
Quick Install (Recommended)
macOS/Linux:
curl -sSL https://raw.githubusercontent.com/sdandey/triagent/main/install.sh | bash
Windows (PowerShell):
irm https://raw.githubusercontent.com/sdandey/triagent/main/install.ps1 | iex
Alternative Methods
# Using pipx (recommended for CLI tools)
pipx install triagent
# Using uv
uv tool install triagent
# Using pip
pip install triagent
Install Specific Version
# macOS/Linux
curl -sSL https://raw.githubusercontent.com/sdandey/triagent/main/install.sh | bash -s -- --version 0.2.0
# Windows
.\install.ps1 -Version "0.2.0"
Quick Start
# Start interactive chat
triagent
# Run setup wizard
triagent
> /init
Web Terminal (Docker)
Run triagent in a browser-based terminal - no local Python installation required.
One-Liner Install (Recommended)
Windows (PowerShell):
irm https://raw.githubusercontent.com/sdandey/triagent/main/start-web.ps1 | iex
macOS/Linux:
curl -sSL https://raw.githubusercontent.com/sdandey/triagent/main/start-web.sh | bash
This downloads, starts the container, and opens http://localhost:7681 in your browser.
Manual Setup
# Build and start (from cloned repo)
docker compose -f docker-compose.web.yml up -d
# Open in browser
open http://localhost:7681
# Stop
docker compose -f docker-compose.web.yml down
See docs/web-terminal.md for more details.
Setup Wizard
The /init command guides you through configuration:
- Model Selection - Choose API provider (Azure Foundry, Anthropic)
- Team Selection - Choose team and ADO project
- MCP Server Setup - Configure Azure DevOps MCP server
- Azure Authentication - Browser-based Azure login
- Prerequisites Check - Verify required tools are installed
Note: The wizard displays installation instructions but does not auto-install tools. See Prerequisites for installation instructions.
Slash Commands
| Command | Description |
|---|---|
/init |
Run setup wizard |
/help |
Show available commands |
/config |
View current configuration |
/config set <key> <value> |
Set a config value |
/team |
Show current team |
/team <name> |
Switch team |
/clear |
Clear conversation history |
/exit |
Exit Triagent |
MCP Tools
Triagent provides custom MCP tools for team-specific operations:
| Tool | Description |
|---|---|
get_team_config |
Returns team configuration for Kusto queries and ADO context |
generate_kusto_query |
Generates Kusto query templates for Application Insights |
list_telemetry_tables |
Lists available telemetry tables with field descriptions |
External MCP server for Azure DevOps operations:
@anthropic-ai/mcp-server-azure-devops@0.1.1
Security
Triagent implements security hooks to protect against dangerous operations:
Blocked Commands
- Destructive bash patterns (
rm -rf /,DROP TABLE, fork bombs) - Direct file system attacks (
> /dev/,chmod 777)
Confirmed Operations
- Azure DevOps writes (work items, PRs, comments)
- Azure CLI writes (pipelines, repos, policies)
- Git operations (commit, push, merge)
Toggle confirmations: /confirm off (use with caution)
Configuration
Configuration is stored in ~/.triagent/:
~/.triagent/
├── config.json # Main configuration
├── credentials.json # API credentials (secure)
├── mcp_servers.json # MCP server config
└── history/ # Conversation history
Session Logs
Triagent logs session activity for troubleshooting and debugging. Logs are stored in platform-specific locations:
| Platform | Location |
|---|---|
| macOS | ~/Library/Logs/triagent/sessions/ |
| Windows | %LOCALAPPDATA%\triagent\logs\sessions\ |
| Linux | ~/.local/share/triagent/logs/sessions/ |
Each session creates a timestamped log file (e.g., session_20260103_143022.log) containing:
- Session start/end events
- User prompts
- Tool calls (MCP tools, bash commands)
- Agent responses and errors
Example Windows path: C:\Users\{username}\AppData\Local\triagent\logs\sessions\
Teams
Triagent supports multiple team configurations with custom CLAUDE.md files:
| Team | Display Name | ADO Project | Features |
|---|---|---|---|
levvia |
Levvia | Project Omnia | Custom prompts |
omnia |
Omnia | Project Omnia | Custom prompts |
omnia-data |
Omnia Data | Audit Cortex 2 | 18 repos, service mappings, telemetry config |
Switch teams: /team <name>
Development
# Clone repository
git clone https://github.com/sdandey/triagent.git
cd triagent
# Install with UV
uv pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Lint
ruff check src/
Prerequisites
Required
- Python 3.11+ - Core runtime
- Node.js 18+ - For MCP servers (Azure DevOps integration)
- Git for Windows - (Windows only) Required by the bundled Claude Code CLI
- Azure DevOps account - For ADO automation
Note: Claude Code CLI is automatically bundled with the
claude-agent-sdkpackage. No separate npm installation is required.
Recommended
-
Azure CLI - For Azure authentication and ADO operations
- macOS:
brew install azure-cli - Windows: Download from https://aka.ms/installazurecliwindows
- Linux:
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
- macOS:
-
Azure CLI Extensions - Install after Azure CLI:
az extension add --name azure-devops az extension add --name application-insights --allow-preview true az extension add --name log-analytics --allow-preview true
API Access (choose one)
- Azure AI Foundry
- Direct Anthropic API
Platform Setup
macOS
-
Install Homebrew (if not installed):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Install Python 3.11+:
brew install python@3.11
-
Install Node.js 18+:
brew install node
-
Install Azure CLI:
brew install azure-cli
-
Install Triagent:
pip install triagent # or use the installer script: curl -sSL https://raw.githubusercontent.com/sdandey/triagent/main/install.sh | bash
-
Configure Azure CLI extensions:
az extension add --name azure-devops az extension add --name application-insights --allow-preview true az extension add --name log-analytics --allow-preview true
-
Login to Azure:
az login
Windows
-
Install prerequisites via PowerShell (Run as Administrator):
irm https://raw.githubusercontent.com/sdandey/triagent/main/install.ps1 | iex
This installs Python, Node.js, Git, and Azure CLI.
-
Install triagent:
pip install triagent
-
Configure Azure CLI extensions (PowerShell):
az extension add --name azure-devops az extension add --name application-insights --allow-preview true az extension add --name log-analytics --allow-preview true
-
Login to Azure:
az login
-
Run triagent:
triagent
Git Bash Users: If you want to run triagent from Git Bash, you need to set environment variables in
~/.bashrc. See docs/windows-installation.md for detailed instructions.
Manual Installation (Alternative)
If you prefer manual installation:
-
Python 3.11+: Download from https://www.python.org/downloads/
- Check "Add Python to PATH" during installation
-
Node.js 18+: Download from https://nodejs.org/
- Use LTS version
-
Git for Windows: Download from https://git-scm.com/download/win
- Required by the bundled Claude Code CLI
-
Azure CLI (optional): Download from https://aka.ms/installazurecliwindows
-
Install triagent:
pip install triagent
Verify Installation
Run these commands to verify your setup:
# Check versions
triagent --version
python --version
node --version
az --version # Optional
# Start triagent and run setup wizard
triagent
> /init
License
MIT License - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file triagent-1.4.0rc22.tar.gz.
File metadata
- Download URL: triagent-1.4.0rc22.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
758c71885bd0d63bd7466273a05f006c50308b81e8c81abc54dba81b99d63fe5
|
|
| MD5 |
b68e837d3d5ebde44498961e919e3583
|
|
| BLAKE2b-256 |
71e48299e9b6f5396ddb8320be7b18b7a4064ec2c0e1ec1e463f366542ba7f0d
|
Provenance
The following attestation bundles were made for triagent-1.4.0rc22.tar.gz:
Publisher:
release.yml on sdandey/triagent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
triagent-1.4.0rc22.tar.gz -
Subject digest:
758c71885bd0d63bd7466273a05f006c50308b81e8c81abc54dba81b99d63fe5 - Sigstore transparency entry: 854514468
- Sigstore integration time:
-
Permalink:
sdandey/triagent@a64d46f6f8bd588a3af5cb2239c253aff8b2189c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sdandey
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a64d46f6f8bd588a3af5cb2239c253aff8b2189c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file triagent-1.4.0rc22-py3-none-any.whl.
File metadata
- Download URL: triagent-1.4.0rc22-py3-none-any.whl
- Upload date:
- Size: 579.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
700ff4c9146829886e8704159c76d7b0f5d36cfb759f33a4b02f8848e4fe2cff
|
|
| MD5 |
6a911d56c6d2d939f51c5604cb70a733
|
|
| BLAKE2b-256 |
69b541449b365fc1b0add21a1339ab445420c7f6162909132f63c6b00c6f8449
|
Provenance
The following attestation bundles were made for triagent-1.4.0rc22-py3-none-any.whl:
Publisher:
release.yml on sdandey/triagent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
triagent-1.4.0rc22-py3-none-any.whl -
Subject digest:
700ff4c9146829886e8704159c76d7b0f5d36cfb759f33a4b02f8848e4fe2cff - Sigstore transparency entry: 854514507
- Sigstore integration time:
-
Permalink:
sdandey/triagent@a64d46f6f8bd588a3af5cb2239c253aff8b2189c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sdandey
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a64d46f6f8bd588a3af5cb2239c253aff8b2189c -
Trigger Event:
workflow_dispatch
-
Statement type: