atomwrite 0.1.34

Atomic file operations CLI for LLM agents — read, write, edit, search, replace with NDJSON output
Documentation
[workspace]
members = ["xtask"]

[package]
name = "atomwrite"
version = "0.1.34"
edition = "2024"
rust-version = "1.88"
description = "Atomic file operations CLI for LLM agents — read, write, edit, search, replace with NDJSON output"
authors = ["Danilo Aguiar <daniloaguiarbr@proton.me>"]
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/danilo-aguiar-br/atomwrite"
homepage = "https://github.com/danilo-aguiar-br/atomwrite"
documentation = "https://docs.rs/atomwrite"
keywords = ["cli", "atomic-write", "llm", "ndjson", "file-operations"]
categories = ["command-line-utilities", "filesystem"]
exclude = [
    ".claude/",
    ".vscode/",
    "docs_prd/",
    "docs_rules/",
    "CLAUDE.md",
    "AGENTS.md",
    "MEMORY.md",
    "graphrag.sqlite",
    "graphrag.sqlite-shm",
    "graphrag.sqlite-wal",
    ".ingest-queue.sqlite",
    ".ingest-queue.sqlite-shm",
    ".ingest-queue.sqlite-wal",
    "gaps.md",
    ".setting.cyber/",
]

[dependencies]
notify = { version = "7", optional = true }
# Features: derive (API), env (#[arg(env)]), wrap_help, string (runtime parsers).
# color + suggestions are also clap defaults; listed explicitly per rules_rust_cli_com_clap.
clap = { version = "4", features = ["derive", "env", "wrap_help", "string", "color", "suggestions", "cargo"] }
clap_complete = "4"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_path_to_error = "0.1"
mimalloc = { version = "0.1", default-features = false }
memchr = "2"
schemars = "1"
thiserror = "2"
anyhow = "1"
tempfile = "3"
walkdir = "2"
blake3 = { version = "1", features = ["mmap", "rayon"] }
rayon = "1"
crossbeam-channel = "0.5"
regex = "1"
tracing = { version = "0.1", features = ["release_max_level_info"] }
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "json", "fmt", "ansi", "std", "registry", "tracing-log"] }
tracing-appender = "0.2"
tracing-error = "0.2"
memmap2 = "0.9"
grep-regex = "0.1"
grep-searcher = "0.1"
grep-matcher = "0.1"
ignore = "0.4"
similar = "3"
filetime = "0.2"
human-panic = "2"
grex = "1.4"
fend-core = "1.5"
ast-grep-core = { version = "0.43", optional = true }
ast-grep-language = { version = "0.43", optional = true }
same-file = "1"
unicode-normalization = "0.1"
sys-locale = "0.3"
rust-i18n = "4"
# v0.1.12 — new dependencies for resolving the Top 12 gaps + v14 Tier 3
reflink-copy = "0.1"   # G64: O(1) copy-on-write backup on APFS/btrfs/XFS
content_inspector = "0.2"  # G41: accurate binary/text detection (UTF-16LE aware)
strsim = "0.11"        # G116: fuzzy match cascade strategy 9 (context-aware)
heck = "0.5"           # v14 Tier 3: identifier case conversion (case subcommand)
serde_yaml = { version = "0.9", optional = true }     # G44: multi-rule YAML for transform subcommand
directories = "6"      # GAP-072: XDG config paths for .atomwrite.toml
toml = "0.8"           # GAP-072: serde deserialize for .atomwrite.toml config
indexmap = { version = "2", features = ["serde"] }  # v14 Tier 3: preserve JSON key order
toml_edit = "0.22"     # v14 Tier 3: TOML editor preserving comments/formatting
# v0.1.12 — tree-sitter-language-pack for G72 real syntax check + v14 query/outline.
# Downloads parsers on first use (cache local); keeps install footprint small while
# enabling AST validation across 305 languages. See src/syntax_check.rs and
# src/commands/query.rs/outline.rs.
tree-sitter-language-pack = { version = "1.8", default-features = false, features = ["download", "dynamic-loading"], optional = true }
# v0.1.19 G122: direct tree-sitter dep for S-expression Query/QueryCursor APIs (language-pack only re-exports Language).
tree-sitter = { version = "0.26", optional = true }
unic-langid = "0.9"
fluent-langneg = "0.14"

[target.'cfg(unix)'.dependencies]
nix = { version = "0.31", features = ["fs"] }
libc = "0.2"
signal-hook = "0.4"
xattr = "1"            # G39: extended attribute preservation (macOS/Linux)
# fd-lock 4 is not used directly: the project's #![deny(unsafe_code)] policy
# is incompatible with fd-lock's RwLockWriteGuard self-referential pattern.
# G54 advisory locking is implemented via nix::fcntl::flock (Unix) and a
# no-op stub (Windows) in src/lock.rs.

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_Storage_FileSystem", "Win32_System_Console"] }
ctrlc = "3.5"

[target.'cfg(target_os = "linux")'.dependencies]
rustix = { version = "0.38", features = ["fs"] }  # G114: ftruncate for in-place inode-preserving writes
nix = { version = "0.31", features = ["fs"] }
libc = "0.2"
signal-hook = "0.4"

[dev-dependencies]
assert_cmd = "2"
predicates = "3"
tempfile = "3"
insta = { version = "1", features = ["json"] }
proptest = "1"
regex = "1"
criterion = { version = "0.5", features = ["html_reports"] }
tracing-test = "0.2"
filetime = "0.2"

[[bench]]
name = "hash_benchmark"
harness = false

[[bench]]
name = "read_benchmark"
harness = false

# ---------------------------------------------------------------------------
# Performance profiles (Rules Rust eficiência / economia)
# Order of optimization: algorithm → hot-path work → allocations → build opts
# → SIMD/parallelism last. Measure with criterion/samply before micro-opts.
# ---------------------------------------------------------------------------

# Production binary: max speed, cross-crate LTO, single CGU, small strip.
# overflow-checks kept ON after audit (file sizes / counts must not wrap silently).
# Not using target-cpu=native here — crates.io / multi-host distribution must
# stay portable (x86-64 baseline). Local dedicated builds may pass RUSTFLAGS.
# PGO/BOLT/multivers intentionally omitted: one-shot CLI; boot+FS dominate over
# long-lived PGO datasets (document when re-evaluating with representative trees).
[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
strip = "symbols"
panic = "abort"
overflow-checks = true
debug = false

# Criterion must match production codegen (default [profile.bench] is opt-level=3
# but does NOT enable fat LTO / CGU=1 — microbenches would lie vs the shipped binary).
[profile.bench]
inherits = "release"

# Optional size-focused binary: cargo build --profile min-size
# (agents / constrained installs). Same LTO/CGU/strip as release.
[profile.min-size]
inherits = "release"
opt-level = "z"

# Speed up proc-macro / build.rs compiles without weakening the final binary.
[profile.release.build-override]
opt-level = 0
codegen-units = 16

[profile.dev.build-override]
opt-level = 0

# Dev: optimize dependencies (serde, regex, ignore, …) while keeping crate debug.
[profile.dev.package."*"]
opt-level = 2

# docs.rs build (nightly sandbox). May 2026+: without `targets`, only default-target is built.
# Multiplatform CLI: document primary desktop triples explicitly (max 10 on docs.rs).
[package.metadata.docs.rs]
all-features = true
default-target = "x86_64-unknown-linux-gnu"
targets = [
    "x86_64-unknown-linux-gnu",
    "x86_64-apple-darwin",
    "aarch64-apple-darwin",
    "x86_64-pc-windows-msvc",
]
rustdoc-args = ["--cfg", "docsrs"]

[badges.maintenance]
status = "actively-developed"

[features]
default = ["core", "ast", "lang-rust", "lang-ts", "lang-py"]
core = []
ast = ["dep:ast-grep-core", "dep:ast-grep-language", "dep:tree-sitter", "dep:tree-sitter-language-pack", "dep:serde_yaml"]
lang-rust = []
lang-ts = []
lang-py = []
lang-go = []
lang-full = ["lang-rust", "lang-ts", "lang-py", "lang-go"]
watch = ["dep:notify"]
semantic = []
full = ["default", "lang-full", "watch", "semantic"]
# Opt-in property tests that may take longer than the default budget.
# Run with: cargo test --features slow-tests
slow-tests = []
# Optional i18n language packs (top-20 economic). Default binary ships only en + pt-BR.
# Features are placeholders until complete human-reviewed translations land — do not
# enable incomplete locales in release builds.
i18n-cjk = []
i18n-rtl = []
i18n-europe = []
i18n-full = ["i18n-cjk", "i18n-rtl", "i18n-europe"]