No description
Find a file
loki5512344 55670030c3
feat: MVP — move files, rewrite imports, atomically
- core: gitignore-aware index (ignore crate), forward/reverse import graph,
  relative-specifier math, pure-data move plans
- apply: rewrite-first + rename-last with fsync, temp+rename, full rollback
  (incl. stale-plan detection before any write); unified diff for dry-run
- cli: mv + check commands, human output, --json envelope with stable error
  codes (SOURCE_NOT_FOUND, TARGET_EXISTS, ...) and hints; exit codes 0/1/2
- parser/core split into submodules to keep files <=250 lines
- tests: 37 unit + 10 e2e + 2 doctests; fixtures tests/typescript/{basic,normal,complex}
- docs: SKILL.md synced (no --force in Phase 1), EXAMPLES.md
- plan: AI/agent support done; Phase 1.5 = Java niche
2026-09-10 11:41:03 +02:00
docs feat: MVP — move files, rewrite imports, atomically 2026-09-10 11:41:03 +02:00
src feat: MVP — move files, rewrite imports, atomically 2026-09-10 11:41:03 +02:00
tests feat: MVP — move files, rewrite imports, atomically 2026-09-10 11:41:03 +02:00
.gitignore chore: project skeleton — module contracts, docs plan, GPLv3 2026-09-09 21:43:42 +02:00
Cargo.lock chore: project skeleton — module contracts, docs plan, GPLv3 2026-09-09 21:43:42 +02:00
Cargo.toml chore: project skeleton — module contracts, docs plan, GPLv3 2026-09-09 21:43:42 +02:00
LICENSE chore: project skeleton — module contracts, docs plan, GPLv3 2026-09-09 21:43:42 +02:00
README.md chore: project skeleton — module contracts, docs plan, GPLv3 2026-09-09 21:43:42 +02:00
todo.md feat: MVP — move files, rewrite imports, atomically 2026-09-10 11:41:03 +02:00

jmove

Move source files. Keep every import intact.

jmove is a fast, single-binary CLI that moves/renames source files in a project and rewrites all import statements that reference them — no IDE, no language server, no runtime dependencies. Built for humans and AI agents.

Why

git mv moves the file but breaks every relative import pointing at it. IDE renames fix imports but need an IDE. Existing CLI alternatives either shell out to heavy language servers (bun/ts-morph, Rope, gopls, rust-analyzer) or refuse to preview what they will change.

jmove's answer:

  • Dry-run + unified diff — see every change before it hits disk.
  • Atomic apply with rollback — imports are rewritten first, the file moves last; any failure restores everything.
  • AI-agent mode — --json everywhere, stable error codes, exit codes, and a machine-readable skill doc (docs/SKILL.md).
  • Pure Rust, one binary — no external toolchains to install.
  • Java support — the package/directory coupling nobody else automates outside IntelliJ.

Install

cargo install jmove

Usage

# Preview what a move would change
jmove mv src/utils/parser.ts src/core/parser.ts --dry-run

# Apply it
jmove mv src/utils/parser.ts src/core/parser.ts

# Java: jmove updates `package`, all `import`s and moves the file
jmove mv src/com/example/utils/Parser.java src/com/example/core/Parser.java

# Find broken imports (exit code 2 if any)
jmove check

# AI-agent workflow
jmove mv src/foo.ts src/bar/foo.ts --dry-run --json
jmove mv src/foo.ts src/bar/foo.ts --json
jmove check --json

See docs/EXAMPLES.md for more, and docs/SKILL.md if you are an AI agent.

Roadmap

TypeScript/JavaScript first, then Java (open niche), Python, Go. split (automatic file decomposition) is planned — no tool does it. Full plan: docs/PLAN.md.

License

GPL-3.0-only. See LICENSE.