A bidirectional synchronization tool for Azure DevOps work items.
Project description
Tool Sync: Bidirectional Azure DevOps Synchronization
Overview
Tool Sync is a powerful and flexible command-line tool that provides bidirectional synchronization between Azure DevOps work items and local files. Unlike other tools that are often unidirectional or limited to specific work item types, Tool Sync allows you to keep any type of work item (User Stories, Bugs, Tasks, etc.) in sync with local files in your Git repository.
This enables a "Work-Items-as-Code" approach, where your Azure DevOps project can be treated as a single source of truth that is perfectly mirrored in a local directory, allowing you to leverage the power of your favorite text editors and version control systems to manage your work.
Features
- Bidirectional Synchronization: Changes made locally or in Azure DevOps are reflected on the other side.
- Generic Work Item Support: Sync any type of work item, not just Test Cases or User Stories.
- Configurable Mappings: Define which work item types to sync, where to store them, and in what format.
- Local File Representation: Work items are stored as local files (e.g., Markdown with YAML front matter), making them easy to read, edit, and version control.
- "Last Write Wins" Strategy: The tool uses a timestamp-based "last write wins" strategy to handle updates.
Installation
tool-sync offers two installation options depending on your needs.
Standard Installation (Synchronization only)
For the core synchronization features, you can install the package directly using pip:
pip install tool-sync
This will provide you with the tool_sync sync command and all necessary functionality to synchronize your work items.
Installation with Analysis Features
To use the AI-powered analysis server with assistants like Cline, you need to install the package with the [analysis] extra. This includes additional libraries for vector indexing and language processing.
pip install "tool-sync[analysis]"
Configuration
Tool Sync requires a config.yml file in the root of your project. This file defines the connection to your Azure DevOps project and how different work item types should be synchronized.
Here is a more detailed example config.yml demonstrating multiple mappings:
# 1. Azure DevOps Connection Details
azure_devops:
organization_url: "https://dev.azure.com/your_org"
project_name: "your_project"
personal_access_token: "your_pat_goes_here"
# 2. Synchronization Mappings
# Define a list of rules for what to sync and where.
sync_mappings:
# Example 1: Sync User Stories for a specific team (Team A)
- name: "User Stories for Team A"
work_item_type: "User Story"
local_path: "work_items/team_a/stories"
area_path: 'your_project\\Team A' # Syncs only items from this Area Path
file_format: "md"
fields_to_sync:
- System.State
- Microsoft.VSTS.Common.Priority
template: |
---
id: {{ id }}
type: {{ type }}
title: '{{ title }}'
state: {{ fields['System.State'] | default('New') }}
priority: {{ fields['Microsoft.VSTS.Common.Priority'] | default(2) }}
created_date: '{{ created_date }}'
changed_date: '{{ changed_date }}'
---
# {{ title }}
{{ description }}
# Example 2: Sync all Bugs across the entire project
- name: "All Bugs"
work_item_type: "Bug"
local_path: "work_items/bugs"
# Note: No area_path is specified, so it will sync all bugs from the project.
file_format: "md"
# You can use a different template for different work item types
template: |
---
id: {{ id }}
title: '{{ title }}'
state: {{ fields['System.State'] | default('New') }}
severity: {{ fields['Microsoft.VSTS.Common.Severity'] | default('3 - Medium') }}
---
**Bug Description:**
{{ description }}
# Example 3: Sync Tasks for the "Backend" team
- name: "Backend Team Tasks"
work_item_type: "Task"
local_path: "work_items/backend/tasks"
area_path: 'your_project\\Backend Team' # Note the different Area Path
file_format: "md"
fields_to_sync:
- System.State
- System.AssignedTo
Configuration Options
azure_devops:organization_url: The URL of your Azure DevOps organization (e.g.,https://dev.azure.com/my-org).project_name: The name of your Azure DevOps project.personal_access_token: Your Personal Access Token (PAT) for authenticating with the Azure DevOps API.
sync_mappings: A list of mappings, where each mapping defines a sync relationship.name: A descriptive name for the mapping.work_item_type: The type of work item to sync (e.g., "User Story", "Bug").local_path: The local directory where the files for these work items will be stored.area_path(Optional): The Azure DevOps Area Path to filter by. If provided, only work items under this path will be synchronized.fields_to_sync(Optional): A list of additional Azure DevOps fields to sync (e.g.,System.State,System.Tags).file_format: The file extension for the local files (e.g.,md,json).conflict_resolution: (Future feature) The strategy to use when a conflict is detected.template: The Jinja2 template to use for generating the content of the local files.
Usage
To run the synchronization, simply execute the following command in your terminal:
tool_sync sync
The tool will read your config.yml, connect to Azure DevOps, and perform the synchronization based on your defined mappings.
Creating New Work Items
You can create a new work item in Azure DevOps by creating a new file in the corresponding local directory. The file should follow the format defined in your template, but without an id field in the front matter.
For example, to create a new User Story, you could create a new file work_items/user_stories/my-new-story.md with the following content:
---
type: User Story
state: New
created_date: '2023-10-27T10:00:00Z'
changed_date: '2023-10-27T10:00:00Z'
title: 'My New User Story'
---
# My New User Story
This is the description of my new user story.
The next time you run tool_sync sync, the tool will detect this new file, create a corresponding User Story in Azure DevOps, and then update the local file with the newly assigned ID.
AI-Powered Analysis with Cline
tool_sync is more than just a synchronization tool. It includes a powerful AI analysis engine that can be used as a local MCP (Model Context Protocol) server for AI assistants like the Cline VS Code extension.
This allows you to have rich, context-aware conversations about your project's data, ask complex questions, find patterns, and identify root causes.
How It Works
The analysis engine uses a Retrieval-Augmented Generation (RAG) pipeline. When you start the server, it can index all your local work item files into a local vector database. When you ask a question via Cline, the server finds the most relevant documents and provides them as context to the LLM, leading to highly accurate and relevant answers.
Using the Analysis Engine with Cline
To use the AI-powered analysis features, you will need an MCP client like the Cline VS Code extension. The following steps will guide you through the setup and usage.
Step 1: Configure the Cline MCP Server
This is the most crucial step. You need to tell Cline how to start the tool_sync server.
-
Find the settings file: In VS Code, click on the MCP Servers icon in the activity bar. This will open a new panel.
-
Open the configuration: In the MCP Servers panel, go to the Installed tab, find your
tool_sync_analyzerserver (it may appear here after the first attempt to use it), or simply click the "Configure MCP Servers" button or link. This will open thecline_mcp_settings.jsonfile. -
Update the configuration: Paste the following JSON into the file. You must replace the placeholder path with the absolute path to the Python executable in your virtual environment.
{ "mcpServers": { "tool_sync_analyzer": { "command": "C:\\path\\to\\your\\project\\.venv\\Scripts\\python.exe", "args": [ "-m", "tool_sync.main", "analyze" ], "env": { "ANONYMIZED_TELEMETRY": "False" }, "disabled": false, "timeout": 3600 } } }
Configuration Notes:
command: This must be the full, absolute path to your Python executable. On Windows, use double backslashes (\\). To find the path, activate your virtual environment and runwhere python(Windows) orwhich python(Linux/macOS).env: This block is important.ANONYMIZED_TELEMETRY: "False"prevents some known stability issues with thechromadbdependency.timeout: Increasing the timeout to3600seconds can help prevent the server from stopping during long-running tasks like indexing.
-
Restart VS Code: It's good practice to restart VS Code to ensure Cline picks up the new configuration.
Step 2: Verify the Connection
After restarting VS Code, open the Cline chat. Type @ and a list of available tools should appear. If you see @tool_sync_analyzer in the list, the connection was successful!
Step 3: Index Your Work Items
Before you can ask questions, the server needs to build its knowledge base from your local files.
In the Cline chat, send the following command:
@tool_sync_analyzer index_documents work_items_path='work_items/'
You should receive a success message like: "Successfully indexed documents. The knowledge base is ready."
Step 4: Ask Questions!
Now you can query your knowledge base. Ask questions related to the content of your work item files.
Example prompts for Cline:
@tool_sync_analyzer query_documents question='What is the most common cause of login errors?'@tool_sync_analyzer query_documents question='Summarize all defects related to the new API'
The server will respond with the most relevant documents it found, providing rich, project-specific context for your questions.
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 tool_sync-0.4.0.tar.gz.
File metadata
- Download URL: tool_sync-0.4.0.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e98019fa4893f03dbbdc7c16387b8326827e384d1341d0b6dcbe4ce37e0d951
|
|
| MD5 |
68cb6c5fbc2bf91ec52fb213df652f5e
|
|
| BLAKE2b-256 |
c503bc5556d4bcc4f4e864c4e6e5c8442b37c8fe7ecc9d65402c57a048ab6dbb
|
Provenance
The following attestation bundles were made for tool_sync-0.4.0.tar.gz:
Publisher:
publish-to-pypi.yml on fabioribeiroquispe/tool_sync
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tool_sync-0.4.0.tar.gz -
Subject digest:
3e98019fa4893f03dbbdc7c16387b8326827e384d1341d0b6dcbe4ce37e0d951 - Sigstore transparency entry: 435152191
- Sigstore integration time:
-
Permalink:
fabioribeiroquispe/tool_sync@773dc48ac001ffb75932704ebf062e166ddfc632 -
Branch / Tag:
refs/heads/feature/clarify-analysis-install - Owner: https://github.com/fabioribeiroquispe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@773dc48ac001ffb75932704ebf062e166ddfc632 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tool_sync-0.4.0-py3-none-any.whl.
File metadata
- Download URL: tool_sync-0.4.0-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac378b6f6e29db3b38395a20aa76a057b2c8c261232bda3f40cbc6797535ef14
|
|
| MD5 |
d8b27edea2f8a74f780e753fad421f73
|
|
| BLAKE2b-256 |
6cb0a0fa22cbc3bbe30056a33f04f6546cf626c329a967f2929e4aad9370f9b8
|
Provenance
The following attestation bundles were made for tool_sync-0.4.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on fabioribeiroquispe/tool_sync
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tool_sync-0.4.0-py3-none-any.whl -
Subject digest:
ac378b6f6e29db3b38395a20aa76a057b2c8c261232bda3f40cbc6797535ef14 - Sigstore transparency entry: 435152215
- Sigstore integration time:
-
Permalink:
fabioribeiroquispe/tool_sync@773dc48ac001ffb75932704ebf062e166ddfc632 -
Branch / Tag:
refs/heads/feature/clarify-analysis-install - Owner: https://github.com/fabioribeiroquispe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@773dc48ac001ffb75932704ebf062e166ddfc632 -
Trigger Event:
push
-
Statement type: