euni Commands (English)
Operational playbook for excel-unidiff-cli (euni).
Goal: decide quickly which command to run, in what order, and how to interpret results.
Command Map
euni init-policy- Create
.euni.ymltemplate in--repo.
- Create
euni check- Non-destructive check for policy drift + Unicode findings on tracked files.
euni apply- Apply policy drift fixes via
git config --localonly. - Use
--dry-runbefore writing. - Use
--repair-unicode-deletesto restore staged/worktree deleted tracked paths incore.precomposeunicode=falsemode. - The repair keeps staged non-delete changes (
worktree-only deleteis restored withgit restore --worktree). - Caution: this restores deleted tracked paths in scope; do not use when deletions are intentional.
- Apply policy drift fixes via
euni doctor- Combined diagnosis (
check+ scan-like Unicode analysis).
- Combined diagnosis (
euni scan- Unicode path analysis on tracked + untracked files (no policy input).
euni version- Print
euni <version> (<commit>).
- Print
Core Rules
- Subcommand required; no standalone
helpcommand. --recursivedefault isfalse(root repo only).- Write operations are only
applyandinit-policy. scandoes not accept--policy.versionaccepts no options.--formatistextorjsononly.
Recommended Flows
1) First-time setup
bash1euni init-policy --repo . 2euni check --repo . --recursive --policy ./.euni.yml
2) Drift remediation loop
bash1euni apply --repo . --recursive --policy ./.euni.yml --dry-run 2euni apply --repo . --recursive --policy ./.euni.yml 3euni check --repo . --recursive --policy ./.euni.yml
3) Unicode phantom delete repair (one command)
bash1euni apply --repo . --recursive --policy ./.euni.yml --repair-unicode-deletes
4) Hard-case diagnosis
bash1euni doctor --repo . --recursive --policy ./.euni.yml 2euni scan --repo . --recursive --format json
CI Recipe (Deterministic Gate)
bash1euni check \ 2 --repo . \ 3 --recursive \ 4 --policy ./.euni.yml \ 5 --non-interactive \ 6 --format json > euni-report.json
Gate expectations:
- Validate against
schema/euni-report.schema.json. - Ensure process exit code matches
report.exitCode. - Treat
exit 1as findings (operational failure),exit 2as execution/runtime failure. - Upload
euni-report.jsonas artifact.
JSON contract:
stdout: exactly one JSON object.stderr: logs/progress/error details.
Exit Codes
0: no findings, no errors.1: findings present.2: execution error.
Precedence: if any execution error exists, exit is 2.
UG Code Triage (Quick)
Common findings (exit 1):
UG004: config drift detected.UG005: NFC collision detected.UG011: combining mark in path.UG012: non-standard FS entry (symlink/reparse/mount).UG013: ambiguous policy path key (case-only collision).UG014: unicode delete repair signal (dry-run plan or runtime safety skip).
Common execution errors (exit 2):
UG001: invalid/inaccessible--repo.UG002: git command/runtime failure.UG003: policy load failure.UG006: submodule uninitialized/inaccessible.UG007: invalid policy structure/unsupported keys.UG008:.euni.ymlexists without--force.UG009: unsupported command/option usage.UG010: gitdir/top-level outside--repoboundary.
Local Source Run Note
When running via go run, non-zero app exits may appear as process exit 1 (Go tool wrapper behavior).
For strict 0/1/2 contract checks, build and run the binary directly:
bash1go build -o ./bin/euni ./cmd/euni 2./bin/euni check --repo . --policy ./.euni.yml 3echo $?