Tools.AIBridge 1.0.9

dotnet tool install --global Tools.AIBridge --version 1.0.9
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local Tools.AIBridge --version 1.0.9
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Tools.AIBridge&version=1.0.9
                    
nuke :add-package Tools.AIBridge --version 1.0.9
                    

AI Bridge

NuGet License: MIT

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

AI Bridge Simple Mode Demo

🎥 Watch on YouTube →


🌟 The Big Picture

AI Bridge offers two modes depending on your project size:

  1. Simple Mode (Quick Start): Perfect for small projects. You pack your entire codebase, give it to the AI, and get code back.
  2. 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-files to automatically respect your .gitignore rules.
  • 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

  1. Open your AI (Claude, Gemini, Qwen, or ChatGPT).
  2. Upload the System Prompt: ai-bridge/1-SimpleMode/ai-system-prompt.md
  3. Upload the Protocol Skill: ai-bridge/1-SimpleMode/ai-response-skill.md
  4. Upload your Context Files: The *-context.txt files from the artifacts/ folder. (Skip this step if starting a brand new project!)
  5. 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.

  1. Run ai-bridge pack to gather your full context.
  2. Start a new AI chat and upload:
    • ai-bridge/2-AdvancedMode/Phase1-CreateIndex/ai-create-index-system-prompt.md
    • All the *-context.txt files from artifacts/.
  3. 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"]
  1. Start a fresh AI Chat.
  2. Upload the System Prompt and your Index:
    • ai-bridge/2-AdvancedMode/Phase2-DailyChat/ai-index-system-prompt.md
    • ai-bridge/index.xml (Skip uploading this if starting a brand new project)
  3. Upload the 3 Required Skills (so the AI knows how to communicate):
    • ai-bridge/2-AdvancedMode/Phase2-DailyChat/ai-request-skill.md
    • ai-bridge/2-AdvancedMode/Phase2-DailyChat/ai-response-skill.md
    • ai-bridge/2-AdvancedMode/Phase2-DailyChat/ai-update-index-skill.md
  4. Ask for a feature.
  5. 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.
  6. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.9 106 7/19/2026
1.0.8 105 7/5/2026
1.0.7 110 6/25/2026
1.0.6 115 6/17/2026
1.0.5 103 6/13/2026
1.0.4 103 6/13/2026
1.0.3 110 6/13/2026
1.0.2 108 6/10/2026
1.0.1 110 6/10/2026
1.0.0 120 6/8/2026