Migration assistant CLI (eai-supmig)
PyPI package eai-supmig ships a contract-first migration assistant for legacy Google repo superbuilds. Import package: eai_supmig.
V1 scope
- Multi-repo workspace with manifest in separate Git repository
- Manifest parsing with
<include>resolution from.repo/manifests/(orrepo manifestwhen available) - First-party under
src/, third-party underextlib/,extlibs/, orlibs/ - Conan detection (shallow scan)
- Build environment matrix capture
- Migration contract (YAML) + human summaries
- Optional
tools/ai-rulessubmodule and Cursor rule materialization - If
tools/ai-rules/is already a git checkout, bootstrap reuses it (no submodule add) - Grounded AI prompt files for follow-on work
Not a full migration engine — preparation and standardization only.
Install
pip install eai-supmig
# or from this clone:
pip install -e ".[dev]"
Commands
| Command | Purpose |
|---|---|
eai-supmig assess | Inspect workspace; write .migration/migration-contract.yaml and summary |
eai-supmig plan | Read contract; write .migration/migration-plan.md |
eai-supmig bootstrap | Create folders, optional submodule, Cursor wrappers, next-steps |
eai-supmig reset | Remove migration artifacts for a clean restart (tools/ai-rules/ never deleted) |
eai-supmig prompt | Write prompts/01-analyze-legacy-superbuild.md (+ optional follow-up) |
eai-supmig doctor | Validate prerequisites and artifacts |
eai-supmig workflow | Show entry path, gates, Phase 0 sign-off, next milestone |
eai-supmig workflow preferences | Set auto-commit at checkpoints (--auto-commit / --no-auto-commit) |
eai-supmig workflow sign-off | Record human Phase 0 approval after deliverables are complete |
eai-supmig workflow parity-sign-off src/... | Record per-project Phase 3 or 6 parity validation in the project status doc |
eai-supmig workflow complete <gate> | Mark a later gate complete (manual until auto-detection exists) |
eai-supmig workflow target [src/...] | Show or set the current first-party project (--scaffold creates status doc) |
eai-supmig workflow complete-project [gate] | Mark project progress for a gate and advance to the next project |
eai-supmig --version prints the installed CLI version (--json for machine-readable output).
Module invocation: python -m eai_supmig assess (same subcommands).
All commands accept --workspace PATH (default: current directory) and support --json where useful.
Assess parameters: the first assess run stores --os, --compilers, --build-types, and
--manual-deps in .migration/assess-params.yaml and in migration-contract.yaml metadata.
Later assess calls with no flags reuse those values and print a reuse note.
Workflow tracking: each CLI run appends to .migration/cli-journal.yaml and refreshes
.migration/workflow-state.yaml with entry path (inventory-first vs bootstrap-first),
gates complete, Phase 0 deliverables, human sign-off, src migration order,
current project, and next milestone (policy Phase N).
Use eai-supmig workflow for a full summary; after Phase 0 review run
eai-supmig workflow sign-off. During Phase 2+, set the active project with
eai-supmig workflow target src/... (scaffolds docs/migration/projects/<slug>.md
by default) and record progress with eai-supmig workflow complete-project. For
vs_parity and retire_legacy, parity sign-off is tracked separately from Phase 0:
check the boxes in the project status doc or run eai-supmig workflow parity-sign-off
(--phase 3 for VS parity, --phase 6 for final validation). When every
project finishes a gate, that workspace gate is marked complete automatically. The CLI
prints a Phase 2+ handoff to @prompts/02-execute-next-step.md after sign-off and
target changes.
Shown after other commands and in doctor --json under workflow.
When your shell is already inside the consumer workspace, Next: lines omit
--workspace (including from subdirectories under a Google repo checkout).
After prompt, the CLI prints how to start a new agent chat with
@prompts/01-analyze-legacy-superbuild.md as the opening message.
The analyze prompt requires a dual-source dependency graph: CMake and Visual
Studio .sln / .vcxproj inputs merged into docs/migration/dependency-graph.md
(see legacy-superbuild-assessment.md).
First-party vs third-party: docs/migration/inventory.md (created at bootstrap or
prompt) states that extlib/ / libs/ are integrated, not migrated like src/.
The analyze prompt and generated plan repeat this scope so Phase 0 output is not misread.
Clean restart: eai-supmig reset deletes .migration/, prompts/, and
docs/migration/ (plus materialized Cursor adapter rules). It never removes
tools/ai-rules/ — including a manual git clone used for upstream development.
Use eai-supmig reset --dry-run first, then re-run assess/plan/prompt or bootstrap.
Only the ## Migration order section of inventory.md defines execution order;
manifest listing tables are not migration sequence.
Version control
Commit migration artifacts at checkpoints so multi-day work stays consistent across
machines and agents. After most commands, eai-supmig prints a Commit checkpoint
section when git has pending changes.
What to commit
| Path | Commit? | When |
|---|---|---|
prompts/ | Yes | After eai-supmig prompt — freezes handoff text across machines |
docs/migration/ | Yes | After Phase 0 deliverables; again after sign-off and per-project updates |
Bootstrap integration (AGENTS.md, .gitmodules, .cursor/rules/) | Yes | After bootstrap when adopting the workflow |
src/ and root build files | Yes | Small scoped commits per project gate |
.migration/ | Optional | Regeneratable; commit for audit if your team wants shared workflow state |
Do not commit tools/ai-rules/ source edits in the consumer — upstream policy
changes belong in superbuild-workflow.