Simple like ChatGPT, accurate like a formula, safe like an audit trail.
PowerPair is an Office.js Excel add-in. Type plain English in the sidebar, the AI returns a structured action (a formula, a chart, a sort, a bulk write) which Excel previews and then applies. The AI never computes numbers itself; it generates Excel formulas and lets Excel compute. Workflows, scheduling, and a recording feature are on the roadmap (see "What's next" below).
This repo is the working scaffold for the Phase-1 MVP.
The add-in is hosted on GitHub Pages. To use it:
- Save the manifest from this URL (right-click → Save link as
manifest.xml): https://raw.githubusercontent.com/CentroxTechnologies/test-excel-js-plugin/main/addin/manifest.xml - Go to https://office.com, sign in, open Excel for the web, create a blank workbook.
- Use the search bar at the top (
Alt + Q) → type "add-in" → click Get Add-ins. - In the dialog, click More Add-ins → Upload My Add-in → pick the
manifest.xmlyou saved. - Home tab → click Open PowerPair. The sidebar opens on the right.
If the upload option is missing, your Microsoft account is a personal tier, Microsoft removed sideload from personal accounts on Excel for Web. Workaround: get a free Microsoft 365 Developer Program tenant at https://developer.microsoft.com/microsoft-365/dev-program and sign in with the sandbox admin account.
Add some sample data first, Name, Sales, Region, Quarter columns work great. Or click any suggestion chip above the input to skip the setup.
Demo commands worth running first:
| Command | What you'll see |
|---|---|
Build me a quarterly budget template starting at A1 |
11 rows × 6 cols of categories + formulas appear on screen |
Make a sales tracker template |
6 rows of seed data with line totals + grand total |
Add a "Q4 vs Q1 growth %" column |
New column with growth-percentage formulas |
Highlight the Net profit row in green |
Single row repaints |
Make a column chart of all four quarters |
Real Excel chart pops in |
Sort by Total descending |
Rows reorder live |
| Click the 💾 Save as Workflow button | Roadmap message: workflows + scheduling are Phase 2 |
Each AI action shows a preview card, review it, click Apply, watch the sheet update.
You type a command in the sidebar
│
▼
taskpane.js reads sheet context (headers, data, active cell)
│
▼
POST /api/process to FastAPI backend (or local pattern-matcher if USE_LOCAL_ENGINE=true)
│
▼
ai_engine.py builds a prompt, calls GPT-4o (or Claude), parses JSON response
│
▼
validator.py checks the action is structurally sane
│
▼
Sidebar renders a preview card with Apply / Cancel
│
▼ on Apply
Office.js writes the formula / values / format / chart back to Excel
Six action types the AI can emit: insert_formula, write_values, format_cells, create_chart, sort_range, show_insight. Adding a seventh is a 4-step recipe documented in DEV-GUIDE.md.
The plugin works without a backend, it has a frontend pattern-matcher (the "local engine") that handles ~7 canned commands (sum, average, count, max, min, sort, format, chart). For natural-language commands like "build me a quarterly budget" you need the real backend.
cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .envOpen backend/.env and paste your OpenAI key in place of your-openai-key-here. Set AI_PROVIDER=anthropic if you'd rather use Claude.
uvicorn main:app --reload --port 8001{"status":"ok"} from curl http://localhost:8001/api/health confirms it's up.
Two paths depending on whether you want the deployed plugin or your local copy to talk to the backend:
Option A, local dev loop (fastest):
cd addin && npm install && npm run cert && npm start, serves the add-in over HTTPS onlocalhost:3000- Edit
addin/manifest.xml, swap thehttps://centroxtechnologies.github.io/test-excel-js-pluginURLs back tohttps://localhost:3000(or use a separate local-dev manifest) - Sideload that manifest in Excel
- In
addin/src/taskpane/taskpane.js, setUSE_LOCAL_ENGINE = false - Refresh the sidebar, every command now hits your backend
Option B, keep using the deployed plugin:
- Set
USE_LOCAL_ENGINE = falseinaddin/src/taskpane/taskpane.js - Push the change to the
gh-pagesbranch and the live site picks up the new code automatically - Backend must be reachable from the deployed plugin. Localhost works from HTTPS pages on most browsers (special exception); if it breaks, run
ngrok http 8001and put the ngrok URL inBACKEND_URLat the top oftaskpane.js
| Mode | Where it runs | Good for | Limits |
|---|---|---|---|
USE_LOCAL_ENGINE = true |
Browser only | Quick demos, offline testing, no API costs | Only 7 hardcoded patterns; doesn't understand "build me a budget" |
USE_LOCAL_ENGINE = false |
FastAPI backend → OpenAI/Anthropic | Full natural-language commands, bulk write_values, chained reasoning | Needs backend running + API key + key has credits |
Flag lives at the top of addin/src/taskpane/taskpane.js.
officejs/
├── README.md # ← you are here
├── DEV-GUIDE.md # how to extend the codebase
├── start.sh # boots backend + addin server in one command
├── addin/ # the Office.js add-in
│ ├── manifest.xml # Office Add-in manifest, points to GitHub Pages URL
│ ├── package.json # http-server + dev cert tooling
│ └── src/
│ ├── taskpane/
│ │ ├── taskpane.html # sidebar shell
│ │ ├── taskpane.js # UI + Office.js + local engine
│ │ └── taskpane.css
│ ├── commands/ # ribbon command handler
│ └── assets/ # icon PNGs
└── backend/ # FastAPI service
├── main.py # /api/health + /api/process
├── ai_engine.py # Provider abstraction (OpenAI, Anthropic), system prompt
├── validator.py # validates AI output before sheet write
├── models.py # Pydantic request/response models
├── requirements.txt
└── .env.example # copy to .env and add your API key
Not yet implemented:
- Saved workflows: record a sequence of commands as a named macro, replay on new data, edit later.
- Scheduling: cron triggers and email notifications for workflow runs.
- Real validation pipeline: reference checks, type checks, range completeness, test execution, reasonableness checks.
- Multi-LLM routing: task classifier picks the right model per request (GPT-mini, Claude, Gemini, Azure OpenAI).
- Audit trail: DB-persisted log of every action.
- Confidence-driven UX: auto-apply for high-confidence, sidebar-only for low-confidence.
- Edge cases: merged cells, multiple header rows, hidden rows, pivot tables, mixed-type columns.
How to add a new action type, switch providers, etc.: see DEV-GUIDE.md.
Sidebar shows blank page or "can't reach server". First time only: open https://centroxtechnologies.github.io/test-excel-js-plugin/taskpane/taskpane.html in a browser to confirm the page loads. If it doesn't, GitHub Pages may still be deploying; wait a moment and retry.
Sidebar shows "Couldn't process that". Backend isn't reachable. Either flip USE_LOCAL_ENGINE = true in taskpane.js (and redeploy gh-pages) or start the backend with uvicorn main:app --port 8001.
API key not configured. Open backend/.env, replace your-openai-key-here with a real key from https://platform.openai.com/api-keys, then restart the backend.
Manifest validation fails when uploading. cd addin && npm run validate to see specifics. The <Id> GUID in manifest.xml must be unique per add-in, if you fork and deploy a separate copy, run uuidgen and replace it.
CORS errors in the browser console. The backend allows * by default; if you've changed it, add the GitHub Pages origin (https://centroxtechnologies.github.io) back to allow_origins in backend/main.py.
Local engine doesn't recognize a command. Expected, it only handles ~7 patterns. To get full natural-language support, switch to the real backend (USE_LOCAL_ENGINE = false) per the steps above.
Personal Microsoft account can't see "Upload My Add-in". Microsoft removed sideload for personal accounts on Excel for Web. Use a Microsoft 365 Developer Program sandbox tenant (free), or use Excel Desktop instead.