Install
xops is MIT licensed — 100% free for personal and commercial use. Install once and you get the full workflow layer — automation, safety checks, undo, ask, upstream, and (in progress) the operations surface: detection, recommendations, and approved setup across the supported tools.
Requires Node.js ≥ 20 · npm ≥ 8 · git ≥ 2
Installs xops, xgit, x12i-ops, and x12i-git — same package, two ergonomics (xgit is git-first). xnpm and x12i-npm also still work, as compatibility aliases.
Three ways to run xops
Flags reference
xops, xops i, and xops install are equivalent. Steps 1–3 (discover, graph, install) always run. Steps 4–7 only run when you pass the flag.
Every install runs a tarball inspection gate on new registry dependencies (Security). Publish checks live on Safety.
| Flag | What it does |
|---|---|
| Lifecycle | |
| --build | Run npm run build after install, in dependency order |
| --test | Run npm test after build — blocks publish if tests fail |
| --publish | Pack-check → version bump → publish via real npm binary |
| --publish-flow | Shortcut: fix deps, install, publish, push, report |
| --full-flow | Shortcut: fix deps, install, build, test, publish, push, report |
| xops release | Named release playbook — same steps as --full-flow with stack support |
| --push | git add / commit / push after lifecycle — on non-fast-forward, prompts to pull --rebase then push (--yes auto-approves) |
| --yes | Non-interactive: approve dependency fixes and git rebase recovery on push |
| --report | Suppress raw output; show high-level summary with counts and version changes |
| --dry-run | Show planned steps and order without modifying any files |
| --no-version-bump | Publish the current version as-is, skip the minor bump |
| --clean-local | Remove file: overrides for discovered packages from package.json |
| --clean-all | Remove the entire overrides object from package.json |
| --inspect-only | Run pre-install tarball inspection without npm install (CI pre-flight) |
| --skip-inspect | Skip tarball inspection gate (debug only; logs a warning) |
| --force | Re-inspect tarballs; npm cache clean before install; after declined rebase, retry push with --force-with-lease |
| Package export contracts | |
| xops exports check | Inspect package ESM/CJS artifacts and report missing or stale package.json export conditions |
| xops exports fix | When dual artifacts already exist, update type, main, module, types, and exports with undo journaling |
| xops exports fix --dry-run | Preview the exact export-map fix without writing package.json |
| Selection | |
| --package <name> | Select a specific package by exact name (repeatable) |
| --filter <glob> | Select packages by glob pattern, e.g. @x12i/* — multiple filters are OR-based |
| --monorepo | From a package subfolder: discover the full git-root monorepo |
| --here | Force cwd-only discovery (default inside a named package folder) |
| --all | Discover all packages under cwd, including nested git repos (may prompt) |
| Undo & history | |
| --tx | Force transaction journaling on a single command |
| --no-tx | Disable journaling for this run (e.g. in CI where you don't need it) |
| First publish & git setup (opt-in) | |
| --new-public | First-publish as a public npm package — no version bump |
| --new-private | First-publish as a restricted npm package — scoped names only |
| --create-git | Initialize local git repo where missing, run initial commit |
| --repo-mode <mode> | monorepo or multi-repo — required when creating git across multiple packages |
| --git-create-remote | Create a new remote repo via provider API (GitHub, GitLab, Bitbucket) |
| --connect <url>alias: --git-link | Attach local repo to an existing remote |
Package exports
When a package already builds both ESM and CJS artifacts, xops exports checks whether package.json exposes them correctly to ESM hosts, CommonJS consumers, bundlers, and TypeScript.
dist/index.js + dist/index.cjs and subpaths such as dist/package-levels.js + dist/package-levels.cjs.type, main, module, types, and exports conditions for import and require.Common commands
xops release --report
xops ask "publish everything in the right order"
xops scripts init
xops scripts init runbook
xops agent-deploy-guide
xgit status
xgit release --report
xops install
xops install --build
xops --build --test
xops --full-flow
xops --publish-flow
xops install --inspect-only
xops exports check
xops exports fix --dry-run
xops exports fix
xops --full-flow --dry-run
xops --publish --no-version-bump
xops --filter "@x12i/*" --build --publish
xops --filter "@x12i/*" --filter "@exellix/*" --build --test
xops --build --test --new-private --push --report
xops --connect git@github.com:x12i/pkg.git --repo-mode monorepo --push
npx @x12i/ops@latest --build --test
xops ask "publish all @x12i packages and push"
xops history
xops undo --dry-run
xops undo --last
xops upstream auth login
xops upstream submit --file fr.md --package @x12i/ops --repo x12i/npm
xops install --fix
xops install --fix-public --dry-run
xops why-upgrade vite
xops deps unused --include-dev
xops deps usage react
xops validate --build
xops doctor
Monorepo publish scripts
xops scripts init writes scripts/publish-*.sh and wires root package.json publish:* entries. Scripts run from the git repo root with repo .npmrc — no wrapper exports for cache or npmrc.
xops uses an isolated npm cache at ~/.cache/xops/npm with automatic fallback to ~/.cache/xops/npm-clean when the primary cache is not writable (exit 3 if no cache works).
xops scripts run preflightxops scripts run corexops scripts run allxops scripts init runbookxops scripts init runbook --filter "@scope/*"xops scripts init allTypical monorepo flow
Stack releases — 2.30.0
Stack releases honor explicit dependsOn edges in .xops/stacks/<name>.json, even when package.json doesn't contain every operational edge. Publish order is a release contract, not just a runtime import graph.
Stacks can also opt into release-time internal dependency sync: local file: links stay for development, and xops rewrites them to registry ranges for the publish step only. See Safety.
xgit — git-first CLI
xgit ships in the same @x12i/ops package. Use xgit when git is primary; use xops when npm/monorepo lifecycle is primary. Both cross-solve: release, validate, ask, scripts, sibling checks, push rebase recovery.
Exit codes
Since 2.29.1, publish verification is retry-aware: after npm publish succeeds, xops checks the registry for the new version and retries (5 attempts, 3s delay by default) while npm replication catches up — instead of treating a visibility lag as a failed publish and skipping the git push. If npm reports the version was already published, xops verifies it and continues. See Safety.
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Failed — package, registry, validation, or command error |
| 2 | Partial success — e.g. publish OK but git push failed (or rebase declined) |
| 3 | Environment / permissions — cache, global install dir, or node_modules not writable |
| 4 | Approval required — a matched command needs confirmation but none was given in a non-interactive context (--agent, CI=true, non-TTY); the plan is printed, nothing executes |
Passthrough
You don't need to switch binaries for everyday commands. xops detects native npm and git subcommands and forwards them directly.
Disambiguation — same word, different destination
| You type | Routes to | Why |
|---|---|---|
| install | ||
| xops install | xops automation | bare install stays on xops |
| xops install --build | xops automation | xops-only flag detected |
| xops install lodash | npm install lodash | package name arg → native npm |
| xops install -D lodash | npm install -D lodash | npm flag (-D, --save-dev, …) → native npm |
| overloaded verbs | ||
| xops --push | xops lifecycle git push | xops flag — part of the automation run |
| xops push | git push | bare subcommand → passthrough |
| xops --test | xops lifecycle test | xops flag — runs in correct order after build |
| xops test | npm test | bare subcommand → passthrough |
| always xops — never passthrough | ||
| xops ask | xops ask | reserved |
| xops list / ls | xops package discovery | reserved |
| xops history | xops transaction history | reserved |
| xops undo | xops undo | reserved |
| xops doctor | xops doctor | reserved |
| xops scripts | xops scripts subcommand | init, list, run, runbook |
| xgit (git-first — same package) | ||
| xgit status | git status | natural git passthrough |
| xgit push | git push | plain git; lifecycle push uses --push |
| xgit release | xops release playbook | monorepo cross-solve |
| xgit npm run build | npm run build | explicit npm prefix |
xops is 100% free — personal and commercial use. No trial, no tiers, no account required.
xops calls your installed npm and git binaries. It uses your existing .npmrc, lockfiles, auth tokens, and git config.
It does not replace the registry, does not reimplement dependency resolution, and does not intercept or store your credentials.