sniper-py
Python bindings for moesniper — escape-proof precision file editor for LLM agents.
Installation
pip install moesniper
Overview
moesniper provides native Python bindings to the moesniper Rust CLI — an escape-proof precision file editor designed for LLM agents. All file edits are:
- Hex-encoded to prevent shell corruption
- Atomic (temp file + rename — never inconsistent)
- Tracked via automatic backups and multi-step undo
- Paced with metabolic resource guards to prevent runaway edits
Usage
import moesniper
# Replace line 5 with plaintext content. The binding handles encoding internally.
result = moesniper.edit("file.rs", start=5, end=5, content="hello")
print(result["status"]) # "ok"
print(result["lines_inserted"]) # 1
Features
| Feature | Description |
|---|---|
| Hex-encoded payloads | All content is hex strings, zero shell injection risk |
| Atomic writes | Files are never in an inconsistent state during edit |
| Multi-step undo | Each edit creates a backup; undo restores previous state |
| Dry-run preview | Preview diffs before applying changes |
| Indentation safety | Validates and auto-corrects indentation on edits |
| Resource pacing | Built-in metabolic guards prevent runaway edits |
License
MIT (source)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moesniper-0.7.13-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: moesniper-0.7.13-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 451.0 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3002917b3c81ce540d60089e4807875d1660014cb694842d475b5cb682580f1c
|
|
| MD5 |
69c90e34736fd5399183df9a68cb40dd
|
|
| BLAKE2b-256 |
e2ac966984eab779d635af0402d794946d551fd5c61544e9efb2f94026d99fba
|
File details
Details for the file moesniper-0.7.13-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: moesniper-0.7.13-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 421.7 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ffd76c656950900d9f8a7cdb66049212f3d87908ddde23f6a09253200e03c9f
|
|
| MD5 |
c4d2eaaf7916cf06511e05480358e2b4
|
|
| BLAKE2b-256 |
e49c6cda38d154348cc7fc49e71b6ddc3701979724be882619a67c1b5ceb20e9
|