Skip to main content

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 ClaudeAgentOptions with 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:

  1. Model Selection - Choose API provider (Azure Foundry, Anthropic)
  2. Team Selection - Choose team and ADO project
  3. MCP Server Setup - Configure Azure DevOps MCP server
  4. Azure Authentication - Browser-based Azure login
  5. 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-sdk package. No separate npm installation is required.

Recommended

  • Azure CLI - For Azure authentication and ADO operations

  • 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

  1. Install Homebrew (if not installed):

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. Install Python 3.11+:

    brew install python@3.11
    
  3. Install Node.js 18+:

    brew install node
    
  4. Install Azure CLI:

    brew install azure-cli
    
  5. Install Triagent:

    pip install triagent
    # or use the installer script:
    curl -sSL https://raw.githubusercontent.com/sdandey/triagent/main/install.sh | bash
    
  6. 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
    
  7. Login to Azure:

    az login
    

Windows

  1. 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.

  2. Install triagent:

    pip install triagent
    
  3. 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
    
  4. Login to Azure:

    az login
    
  5. 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:

  1. Python 3.11+: Download from https://www.python.org/downloads/

    • Check "Add Python to PATH" during installation
  2. Node.js 18+: Download from https://nodejs.org/

    • Use LTS version
  3. Git for Windows: Download from https://git-scm.com/download/win

    • Required by the bundled Claude Code CLI
  4. Azure CLI (optional): Download from https://aka.ms/installazurecliwindows

  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

triagent-1.4.0rc22.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

triagent-1.4.0rc22-py3-none-any.whl (579.0 kB view details)

Uploaded Python 3

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

Hashes for triagent-1.4.0rc22.tar.gz
Algorithm Hash digest
SHA256 758c71885bd0d63bd7466273a05f006c50308b81e8c81abc54dba81b99d63fe5
MD5 b68e837d3d5ebde44498961e919e3583
BLAKE2b-256 71e48299e9b6f5396ddb8320be7b18b7a4064ec2c0e1ec1e463f366542ba7f0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for triagent-1.4.0rc22.tar.gz:

Publisher: release.yml on sdandey/triagent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for triagent-1.4.0rc22-py3-none-any.whl
Algorithm Hash digest
SHA256 700ff4c9146829886e8704159c76d7b0f5d36cfb759f33a4b02f8848e4fe2cff
MD5 6a911d56c6d2d939f51c5604cb70a733
BLAKE2b-256 69b541449b365fc1b0add21a1339ab445420c7f6162909132f63c6b00c6f8449

See more details on using hashes here.

Provenance

The following attestation bundles were made for triagent-1.4.0rc22-py3-none-any.whl:

Publisher: release.yml on sdandey/triagent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page