autosnap-git
v1.0.1
Published
Production-ready CLI for automatic Git snapshots.
Downloads
15
Maintainers
Readme
Autosnap Git
Autosnap Git is a production-ready CLI that automates Git snapshots and gives a clean, friendly view of your commit history.
Features
- Automatic snapshots only when changes exist
- Initializes Git repositories automatically
- Safety checks for secrets and
.env - Human-readable history, diff, and status
- Watch mode with debounce and recursion protection
- Ready for
npm linkor global installs
Install
npm install -g autosnap-gitFor local development:
npm linkUsage
autosnap-gitSnapshots only if there are changes. If nothing changed, Autosnap exits cleanly.
CLI Reference
autosnap-git # auto snapshot
autosnap-git --dry-run # preview without committing
autosnap-git --push # commit + push
autosnap-git --watch # watch for file changes (5s debounce)
autosnap-git --watch --interval 300 # commit after 300s of inactivity
autosnap-git --watch --every 300 # alias for --interval
autosnap-git --prefix fix # commit tag override -> [FIX]:
autosnap-git log # recent commits
autosnap-git log -n 10 # last 10 commits
autosnap-git log --full # detailed commit info
autosnap-git last # show last commit
autosnap-git diff # diff vs last commit
autosnap-git diff --stat # summary diff
autosnap-git status # git status summaryCommit Message Rules
- First commit:
[CHORE]: initialize project snapshot - Later commits use short summaries such as
[UPDATE]: update cli and docs - The snapshot time is still shown in CLI output after a save or dry run
- If you do not pass
--prefix, Autosnap picks a tag from the snapshot size: - small edits ->
[CHORE]: - medium edits ->
[UPDATE]: - broad edits ->
[OVERHAUL]: --prefixsets the tag (e.g.,--prefix fix=>[FIX]: ...)
Watch Mode
--watch uses chokidar to track changes:
- Debounce of 5 seconds
- Ignores
.git,node_modules,dist, andcoverage - Prevents recursive commits
- Automatically infers the tag when
--prefixis omitted - Shows live activity events
Safety
Autosnap respects .gitignore and refuses to commit:
.envfiles- private keys (
*.pem,*.key,id_rsa) - filenames containing
secretorcredentials
On first run, Autosnap prints a warning so you can double-check changes.
Examples
autosnap-git
autosnap-git --prefix dev
autosnap-git log -n 3
autosnap-git diff --stat
autosnap-git --watch --dry-runFAQ
Why didn't Autosnap create a commit?
No changes were detected, or sensitive files were found and blocked.
Does Autosnap respect .gitignore?
Yes. It uses git add . and Git's ignore rules.
How do I stop watch mode?
Press Ctrl+C.
Development
npm install
npm test