{"_id":"@amoghvj/txr","_rev":"4-67594c850f9b241455d5123d27c61a72","name":"@amoghvj/txr","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@amoghvj/txr","version":"0.1.0","keywords":["cli","transaction","undo","rollback","shell"],"author":{"name":"Amogh Vijay"},"license":"MIT","_id":"@amoghvj/txr@0.1.0","maintainers":[{"name":"amoghvj","email":"amoghvj@gmail.com"}],"homepage":"https://github.com/amoghvj/agent-cli#readme","bugs":{"url":"https://github.com/amoghvj/agent-cli/issues"},"bin":{"txr":"dist/index.js"},"dist":{"shasum":"cc99eb3b72a3dd5661a3304fb04bb5b086d1d04c","tarball":"https://registry.npmjs.org/@amoghvj/txr/-/txr-0.1.0.tgz","fileCount":4,"integrity":"sha512-CZ20IUg+pXnY99CtxvuiALKYdbH711eURtPkWbZ7LkYOI80SdpWr+k6z5H90PeNuKvwPrTVKxvO7IFVlU8bmzA==","signatures":[{"sig":"MEYCIQDNuPaF4rsEWvEinooqrx/z/CYNpZwVnSqfV0uEURWaOQIhAP88BihI9zqzwbl0Y27l10ReqZpuCA6wspYcEfUmqcOJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":59406},"main":"dist/index.js","type":"module","engines":{"node":">=18.0.0"},"scripts":{"dev":"tsup src/index.ts --format esm --watch","test":"vitest run","build":"tsup src/index.ts --format esm --clean","prepack":"npm run build","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run typecheck && npm run test"},"_npmUser":{"name":"amoghvj","email":"amoghvj@gmail.com"},"repository":{"url":"git+https://github.com/amoghvj/agent-cli.git","type":"git"},"_npmVersion":"10.9.4","description":"Transactional command runner — undo any shell command","directories":{},"_nodeVersion":"24.11.0","dependencies":{"nanoid":"^3.3.11","commander":"^14.0.0","minimatch":"^10.2.5","isomorphic-git":"^1.30.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^4.1.9","typescript":"^6.0.3","@types/node":"^26.0.0"},"_npmOperationalInternal":{"tmp":"tmp/txr_0.1.0_1782218021467_0.7604525442682579","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@amoghvj/txr","version":"0.1.1","keywords":["cli","transaction","undo","rollback","shell"],"author":{"name":"Amogh Vijay"},"license":"MIT","_id":"@amoghvj/txr@0.1.1","maintainers":[{"name":"amoghvj","email":"amoghvj@gmail.com"}],"homepage":"https://github.com/amoghvj/agent-cli#readme","bugs":{"url":"https://github.com/amoghvj/agent-cli/issues"},"bin":{"txr":"dist/index.js"},"dist":{"shasum":"f30f2837e407a4f6e32ca822ee3c4dd325f155ea","tarball":"https://registry.npmjs.org/@amoghvj/txr/-/txr-0.1.1.tgz","fileCount":6,"integrity":"sha512-cR968URiK2x6W4vknt6KcJBxxdxVZokXCDQ67qlvkVOyLsMO2jp7AuJ0b7ABBUJHTy44A4wuUC6p+1b63+n5Ew==","signatures":[{"sig":"MEQCIDB4dnzaO95uMnqc7R0i3YpeHyBuLqVZrSMe6/aZclH8AiBqJ+ZdE2PLrl3iR4zTCyFo868+3ufeNRMhd74sZkN7ug==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":63468},"main":"dist/index.js","type":"module","engines":{"node":">=18.0.0"},"scripts":{"dev":"tsup src/index.ts --format esm --watch","test":"vitest run","build":"tsup src/index.ts --format esm --clean","prepack":"npm run build","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run typecheck && npm run test"},"_npmUser":{"name":"amoghvj","email":"amoghvj@gmail.com"},"repository":{"url":"git+https://github.com/amoghvj/agent-cli.git","type":"git"},"_npmVersion":"10.9.4","description":"Transactional command runner — undo any shell command","directories":{},"_nodeVersion":"24.11.0","dependencies":{"nanoid":"^3.3.11","commander":"^14.0.0","minimatch":"^10.2.5","isomorphic-git":"^1.30.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^4.1.9","typescript":"^6.0.3","@types/node":"^26.0.0"},"_npmOperationalInternal":{"tmp":"tmp/txr_0.1.1_1782222286445_0.28932979132082814","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@amoghvj/txr","version":"0.1.2","keywords":["cli","transaction","undo","rollback","shell"],"author":{"name":"Amogh Vijay"},"license":"MIT","_id":"@amoghvj/txr@0.1.2","maintainers":[{"name":"amoghvj","email":"amoghvj@gmail.com"}],"homepage":"https://github.com/amoghvj/agent-cli#readme","bugs":{"url":"https://github.com/amoghvj/agent-cli/issues"},"bin":{"txr":"dist/index.js"},"dist":{"shasum":"36ebff9365869b9ba17cc00368424ab08735c979","tarball":"https://registry.npmjs.org/@amoghvj/txr/-/txr-0.1.2.tgz","fileCount":6,"integrity":"sha512-X0MMKOWdynxHf8u5NVnH7fniBGalj/CHuCnY+X/GT8jYKQ6Wr9sR7/Z5HyUMZou42Pd6xHBo3kEx5E85mhc+4A==","signatures":[{"sig":"MEQCIHwmaYIBEMUO2mmJdfi7S0tC2EjlxmK8WxpMRyIowuP4AiA7sRCuEvjwHEuM6Y3R06STmAIbjDoOgyjuYgd2p/vVAQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":63540},"main":"dist/index.js","type":"module","engines":{"node":">=18.0.0"},"scripts":{"dev":"tsup src/index.ts --format esm --watch","test":"vitest run","build":"tsup src/index.ts --format esm --clean","prepack":"npm run build","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run typecheck && npm run test"},"_npmUser":{"name":"amoghvj","email":"amoghvj@gmail.com"},"repository":{"url":"git+https://github.com/amoghvj/agent-cli.git","type":"git"},"_npmVersion":"10.9.4","description":"Transactional command runner — undo any shell command","directories":{},"_nodeVersion":"24.11.0","dependencies":{"nanoid":"^3.3.11","commander":"^14.0.0","minimatch":"^10.2.5","isomorphic-git":"^1.30.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^4.1.9","typescript":"^6.0.3","@types/node":"^26.0.0"},"_npmOperationalInternal":{"tmp":"tmp/txr_0.1.2_1782222555093_0.08337684056868255","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@amoghvj/txr","version":"0.2.0","description":"Transactional command runner — undo any shell command","type":"module","main":"dist/index.js","bin":{"txr":"dist/index.js"},"engines":{"node":">=18.0.0"},"repository":{"type":"git","url":"git+https://github.com/amoghvj/agent-cli.git"},"bugs":{"url":"https://github.com/amoghvj/agent-cli/issues"},"homepage":"https://github.com/amoghvj/agent-cli#readme","scripts":{"prepack":"npm run build","prepublishOnly":"npm run typecheck && npm run test","build":"tsup src/index.ts --format esm --clean","dev":"tsup src/index.ts --format esm --watch","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit"},"keywords":["cli","transaction","undo","rollback","shell"],"author":{"name":"Amogh Vijay"},"license":"MIT","devDependencies":{"@types/node":"^26.0.0","tsup":"^8.5.1","typescript":"^6.0.3","vitest":"^4.1.9"},"dependencies":{"commander":"^14.0.0","glob":"^13.0.6","isomorphic-git":"^1.30.1","minimatch":"^10.2.5","nanoid":"^3.3.11"},"_id":"@amoghvj/txr@0.2.0","_nodeVersion":"24.11.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-wIS6nCBc9W+Nem/fWMszBGF6ilqGFu1kVvbjGGW5eXUeJ54F9QXPA2pZ3XBR1X+I54WrdMtBRMxng+YOCcqfuw==","shasum":"85a8f5a6fc7db388a7034b9520c10c4360d83af5","tarball":"https://registry.npmjs.org/@amoghvj/txr/-/txr-0.2.0.tgz","fileCount":11,"unpackedSize":89240,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHT8u7JzZdE+mD/6nJOCCnrek7x1kVMWMr9ExBlXbcLlAiBd0ay8o0ZYpHIiGHIoq2iZVLLZ2ytGBtv4XpUdKMN/tA=="}]},"_npmUser":{"name":"amoghvj","email":"amoghvj@gmail.com"},"directories":{},"maintainers":[{"name":"amoghvj","email":"amoghvj@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/txr_0.2.0_1782238788580_0.46262078662543904"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-23T12:33:41.254Z","modified":"2026-06-23T18:19:48.839Z","0.1.0":"2026-06-23T12:33:41.608Z","0.1.1":"2026-06-23T13:44:46.606Z","0.1.2":"2026-06-23T13:49:15.226Z","0.2.0":"2026-06-23T18:19:48.742Z"},"bugs":{"url":"https://github.com/amoghvj/agent-cli/issues"},"author":{"name":"Amogh Vijay"},"license":"MIT","homepage":"https://github.com/amoghvj/agent-cli#readme","keywords":["cli","transaction","undo","rollback","shell"],"repository":{"type":"git","url":"git+https://github.com/amoghvj/agent-cli.git"},"description":"Transactional command runner — undo any shell command","maintainers":[{"name":"amoghvj","email":"amoghvj@gmail.com"}],"readme":"# txr - Transactional Command Runner\n\n`txr` is a standalone CLI tool that provides transactional execution of shell commands. It acts as a safety net, allowing you to run commands (like `npm install`, generators, or scripts) and undo them completely if they don't produce the desired outcome. \n\nIt works independently of any user Git repository, maintaining its own internal state store to track and rollback filesystem changes with strict safety guarantees.\n\n## Philosophy\n\n* **One executed command = one transaction.**\n* **Correctness over convenience:** `txr` will strictly refuse to undo if a file was externally modified. It never guesses.\n* **Linear History:** There are no branches or merges. It works like an editor's undo stack.\n* **Invisible Storage:** The internal Git repo is hidden and purely used as an efficient storage engine.\n\n## Installation\n\n`txr` is available as a global npm package.\n\n```bash\nnpm install -g @amoghvj/txr\n```\n\nOnce installed, the `txr` command will be available anywhere on your system.\n\n## Usage Instructions\n\n### 1. Initialize a Workspace\n\nBefore running transactional commands, initialize `txr` in your project root. This creates a `.txr/` hidden directory to store history and internal state.\n\n```bash\ntxr init\n```\n\nBy default, `txr` runs in **workspace scope**. This means it only tracks files inside your project directory. If you run a command that modifies files outside the project (like `npm install -g` or writing to an absolute path), `txr` will detect this, flag it as a scope violation, and ask for confirmation before running (and it won't track those external changes).\n\nIf you want `txr` to track *everything* a command does, no matter where it writes on your system, initialize with global scope:\n\n```bash\ntxr init --global\n```\n\n**Using `txr` everywhere on your system:**\nIf you want to use `txr run` in *any* folder on your computer without typing `init` for every new project, you can initialize a single global state store in your user's home directory:\n\n```bash\ncd ~\ntxr init --global\n```\nWith this setup, `txr` will place the `.txr` folder in your home directory (`~/.txr`). Whenever you use `txr run` anywhere on your machine, it will traverse up the folder tree, find `~/.txr`, and record the transaction there. Because you used `--global`, it will gladly track changes across your entire filesystem.\n\n### 2. Run Commands\n\nExecute any command through `txr`. It will automatically track the filesystem changes and record a transaction.\n\n```bash\ntxr run \"npm install express\"\ntxr run \"npx create-react-app frontend\"\ntxr run \"node script.js\"\n```\n\n**Non-transactional Commands:**\n`txr` analyzes commands before running. If you try to run a command that modifies state outside the filesystem (like databases or containers), it will warn you:\n\n```bash\ntxr run \"docker compose up -d\"\n# ⚠ WARNING: This command may modify state outside the transaction engine.\n# Continue? [y/N]\n```\nYou can bypass the prompt with `-y`: `txr run -y \"docker compose up -d\"`. These commands are logged in history but don't create a transaction.\n\n### 3. Undo a Transaction\n\nIf a command broke your project, simply undo the most recent transaction. This restores all created, modified, or deleted files to their exact previous state.\n\n```bash\ntxr undo\n```\n\n*Note: If any touched file was manually edited outside of `txr` after the transaction, `txr undo` will safely abort to prevent data loss.*\n\n### 4. Redo a Transaction\n\nIf you undid a transaction by mistake, you can redo it (as long as you haven't run any new commands since).\n\n```bash\ntxr redo\n```\n\n### 5. Check Status and History\n\nView the current active transaction and attribution tier:\n\n```bash\ntxr status\n```\n\nView an audit log of all commands run through `txr`:\n\n```bash\ntxr history\n```\n\n## Advanced Options\n\n* `txr clear`: Permanently reset the internal state and delete all transaction history in the active `.txr` folder. Useful if the system enters an unrecoverable state or you want to start fresh. Use `-y` to skip confirmation.\n* `txr run --transactional \"cmd\"`: Force a command to be tracked as transactional, even if the classifier flags it as unsafe.\n* `txr run --no-transaction \"cmd\"`: Force a command to run directly without tracking or generating a transaction.\n\n## Attribution Tiers\n\n`txr` uses different methods to track process changes depending on your OS and privileges:\n* **Tier 3 (Hybrid / Scoped Diff):** Default for unprivileged execution. It tracks process lifetimes and diffs declared watch paths.\n* **Tier 2 (Linux ptrace):** *Planned.* Exact syscall interception without root.\n* **Tier 1 (ETW / eBPF):** *Planned.* Exact low-overhead tracking requiring Admin/Root.\n\n## Configuration\n\nYou can tweak settings in `.txr/metadata/config.json`, such as:\n* `watchPaths`: Array of directories to track for changes (defaults to `[\".\"]`).\n* `ignorePaths`: Glob patterns to ignore (e.g., `node_modules/.cache`).\n","readmeFilename":"README.md"}