Tools.AIBridge
1.0.9
dotnet tool install --global Tools.AIBridge --version 1.0.9
dotnet new tool-manifest
dotnet tool install --local Tools.AIBridge --version 1.0.9
#tool dotnet:?package=Tools.AIBridge&version=1.0.9
nuke :add-package Tools.AIBridge --version 1.0.9
AI Bridge
Pack your code → Paste into any AI chatbot → Apply changes back. No API keys, no extensions, no lock-in.
AI Bridge is a lightweight CLI tool that bridges your local codebase and browser-based AI chatbots (Claude, Gemini, Qwen, ChatGPT). It works with any language or technology — .NET, Node.js, Python, React, Go, Rust, or any project with a sensible folder structure.
🎬 Quick Demo
🌟 The Big Picture
AI Bridge offers two modes depending on your project size:
- Simple Mode (Quick Start): Perfect for small projects. You pack your entire codebase, give it to the AI, and get code back.
- Advanced Mode (Index Flow): Designed for large codebases. You map your project once, and then only upload the specific files the AI requests — saving tokens and reducing noise.
⚙️ Prerequisites & Installation
- .NET 10 SDK installed on your machine.
- Git installed and on your PATH. AI Bridge uses
git ls-filesto automatically respect your.gitignorerules. - A browser AI account (Claude, Gemini, Qwen, or ChatGPT).
💡 Model Recommendation: We highly recommend using thinking or reasoning "High" models (e.g., Claude 4.6 Sonnet, Gemini 3.1 Pro, Qwen 3.7 Max/Plus). Writing high-quality code and safely navigating complex logic requires exceptional reasoning capabilities. Weaker models may struggle to provide bug-free implementations.
Install the tool globally using the .NET CLI:
dotnet tool install --global Tools.AIBridge
(To update later: dotnet tool update --global Tools.AIBridge) — View on NuGet →
<details> <summary><b>⚡ TL;DR — Try it in 60 seconds</b></summary>
dotnet tool install --global Tools.AIBridge
cd /path/to/your-project
ai-bridge init
ai-bridge pack
# Upload ai-bridge/1-SimpleMode/*.md + ai-bridge/artifacts/*-context.txt to your AI
# Copy the AI's XML response, then:
ai-bridge apply --paste
</details>
🚀 Getting Started
Open your terminal, navigate to your project directory, and run the init command.
cd /path/to/your-project
ai-bridge init
What it does:
It creates a clean, tracked ai-bridge/ folder in your project containing two paths you can take, plus a safe artifacts/ sandbox for the AI's inputs and outputs.
YourProjectRoot/
├── .aiignore <-- Custom exclusion rules (Tracked)
└── ai-bridge/ <-- The AI Bridge workspace
├── 1-SimpleMode/ <-- Templates for quick, small tasks
├── 2-AdvancedMode/ <-- Templates for large project mapping
└── artifacts/ <-- Scratchpad for context and AI responses
Excluding Files with .aiignore
The .aiignore file (created by ai-bridge init) works like .gitignore — add glob patterns to exclude files from being packed into AI context. Use it for test fixtures, generated code, large data files, or anything the AI doesn't need to see.
🟢 Simple Mode (For Small Projects)
Use this mode if your codebase is small enough to fit comfortably inside a single AI prompt window.
flowchart LR
A["🗂️ Codebase"] -- "ai-bridge pack" --> B["📄 *-context.txt"]
B -- "Upload + Prompts" --> C["🤖 AI Chatbot"]
C -- "Copy XML Response" --> D["ai-bridge apply --paste"]
D --> E["✅ Files Updated"]
1. Pack Your Project
Run the pack command to bundle your codebase into text files.
ai-bridge pack
This generates *-context.txt files inside ai-bridge/artifacts/. (It automatically respects .gitignore, skips binary files, and applies .aiignore).
2. Chat with the AI
- Open your AI (Claude, Gemini, Qwen, or ChatGPT).
- Upload the System Prompt:
ai-bridge/1-SimpleMode/ai-system-prompt.md - Upload the Protocol Skill:
ai-bridge/1-SimpleMode/ai-response-skill.md - Upload your Context Files: The
*-context.txtfiles from theartifacts/folder. (Skip this step if starting a brand new project!) - Ask the AI to write your feature or fix a bug.
3. Apply the Changes
Option 1 — Clipboard: Copy the AI's XML response and run:
ai-bridge apply --paste
Option 2 — File: Save the XML to ai-bridge/artifacts/ai-response.xml and run:
ai-bridge apply
🔴 Advanced Mode (For Large Projects)
If you have a large codebase, uploading your entire project every time wastes tokens and degrades AI reasoning. Advanced Mode solves this by creating a lightweight index.xml map of your project.
Phase 1: Create the Index (One-Time Setup)
Starting a brand new project? Skip Phase 1 entirely and jump straight to Phase 2 — no index needed when there's no existing code to map.
Before chatting, the AI needs to map out your existing project.
- Run
ai-bridge packto gather your full context. - Start a new AI chat and upload:
ai-bridge/2-AdvancedMode/Phase1-CreateIndex/ai-create-index-system-prompt.md- All the
*-context.txtfiles fromartifacts/.
- The AI will output an XML map of your project. Save this output exactly as
ai-bridge/index.xml.
Phase 2: The Daily Workflow
Now that you have an index, you never need to upload huge context files again!
flowchart LR
A["💬 Ask feature"] -->|AI requests files| B["ai-bridge apply --paste"]
B -->|Upload context| C["🤖 AI generates code"]
C -->|Copy response| D["ai-bridge apply --paste"]
D --> E["✅ Updated"]
- Start a fresh AI Chat.
- Upload the System Prompt and your Index:
ai-bridge/2-AdvancedMode/Phase2-DailyChat/ai-index-system-prompt.mdai-bridge/index.xml(Skip uploading this if starting a brand new project)
- Upload the 3 Required Skills (so the AI knows how to communicate):
ai-bridge/2-AdvancedMode/Phase2-DailyChat/ai-request-skill.mdai-bridge/2-AdvancedMode/Phase2-DailyChat/ai-response-skill.mdai-bridge/2-AdvancedMode/Phase2-DailyChat/ai-update-index-skill.md
- Ask for a feature.
- Fulfill the Request:
- The AI will output an XML request for files (e.g.,
<ai-request><file>src/app.js</file></ai-request>). - Copy the request and run
ai-bridge apply --paste. - The tool will automatically gather those files and bundle them into
ai-bridge/artifacts/ai-requested-context.txt. - Upload or paste that context back into the AI chat.
- The AI will output an XML request for files (e.g.,
- The AI generates the final code changes. Copy them and run
ai-bridge apply --paste.
📖 Command Reference
| Command | Description |
|---|---|
ai-bridge init |
Scaffolds the ai-bridge/ workspace, .aiignore, and templates |
ai-bridge pack |
Packs source files into *-context.txt for AI consumption |
ai-bridge pack --incremental |
Packs only files changed since the last index update |
ai-bridge apply |
Applies ai-response.xml patches from the artifacts folder |
ai-bridge apply --paste |
Reads the AI response directly from clipboard |
ai-bridge apply --watch |
Watches ai-response.xml and auto-applies on save |
ai-bridge apply --dry-run |
Shows what would change without writing to disk |
ai-bridge update |
Refreshes 1-SimpleMode/ and 2-AdvancedMode/ templates to match the installed tool version |
ai-bridge index status |
Shows files changed since the last index update |
🛠️ Ecosystem Detection
When you run ai-bridge pack, it groups files intelligently based on your ecosystem to keep contexts organized:
| Ecosystem | Detected By | Grouping |
|---|---|---|
| .NET | .csproj files |
One context file per project |
| Node.js | package.json |
One context file per package |
| Python | pyproject.toml |
One context file per package |
| Go | go.mod |
One context file per module |
| Rust | Cargo.toml |
One context file per crate |
| Other | (fallback) | One context file per top-level folder |
📋 Clipboard Support
ai-bridge apply --paste uses native OS commands — no external dependencies required.
| Platform | Clipboard Tool | Notes |
|---|---|---|
| Windows | Built-in (powershell.exe / clip.exe) |
Works out of the box. |
| macOS | Built-in (pbpaste / pbcopy) |
Works out of the box. |
| Linux (X11) | xclip |
Install: sudo apt install xclip |
| Linux (Wayland) | wl-clipboard |
Install: sudo apt install wl-clipboard |
| WSL2 | Windows bridge | Works automatically. |
| Headless / SSH | stdin fallback | Prompts you to manually paste into terminal. |
🔄 Updating Templates
Because the AI prompts are closely tied to the CLI's parsing engine, you may need to update them when you upgrade the ai-bridge tool. If the tool detects a version mismatch, simply run:
ai-bridge update
This will refresh your 1-SimpleMode and 2-AdvancedMode folders with the latest prompts.
🤝 Contributing
See CONTRIBUTING.md for build instructions and how to submit a PR.
📄 License
This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.