Atomic
Atomic is a fast, minimal CLI tool that automates local Git commits around the scripts you already run β tests, formatters, docs, builds, anything. Define commands once in a TOML file. Let Atomic run them and snapshot your work with zero friction.
Use it as:
- A commit automation tool
- A task runner that remembers to save your work
- A Git-integrated wrapper for dev scripts
- A shell-based CI runner for solo workflows
π§ Why Use Atomic?
Atomic solves a common annoyance: you run cargo test
, npm run format
, or ./scripts/setup.sh
β but forget to commit. Or you commit inconsistently.
Now, your routine commands can automatically commit your changes, so you never lose progress.
π Installation
From Source
From Crates.io
Note: minimum supported Rust version is 1.74. Windows 10/11 only (Linux coming soon).
βοΈ How It Works
- Define your dev commands in
atomic.toml
. - Run them with
atomic <command>
. - Atomic runs the command (plus any pre/post hooks).
- If it changes your Git state, it locally auto-commits.
π Sample atomic.toml
[]
= "cargo check"
[]
= "echo Running Clippy"
= "cargo clippy"
= "echo Clippy finished"
[]
= ["check", "clippy", "cargo fmt"]
[]
= "./scripts/gen_docs.py"
= ["hello", "from", "Atomic!"]
= true
β Supported Use Cases
- Auto-committing after build/test/lint
- Pre/post hooks around scripts or shell commands
- Cross-platform script runner (Windows PowerShell, batch, Python, etc.)
- Command chaining (
["cargo check", "cargo test"]
) - Git-integrated plugin system
- Project scaffolding with starter templates
π Pre/Post Hooks
Add before
and after
to wrap any command:
[]
= "echo Testing..."
= "cargo test"
= "echo Done."
π Plugins
Run script-based plugins (any language):
[]
= "./scripts/clean_temp.py"
= ["--force"]
= true
Call with:
If silent = true
, logs go to atomic-logs/cleanup.log
.
π§ͺ Commands
Atomic Commands
Command | Description |
---|---|
atomic init |
Create an example atomic.toml with built-in Rust tasks |
atomic init --template rust |
Use the built-in Rust starter template |
atomic <command> |
Run a [custom.<command>] entry from your config |
atomic --plugin <name> |
Run a [plugin.<name>] script |
atomic --list |
List all available commands from your TOML |
atomic config show |
Show resolved TOML config in the terminal |
atomic remote "message" |
Stage, squash, and force-push all changes as a single commit with your message (replaces all remote history!) |
You can use kebab-case or snake_case for commandsβboth are supported.
How atomic remote
Works
- Auto-stages all changes (staged and unstaged).
- Commits them if needed, using your message.
- Squashes all your local commits into one, using your message.
- Force-pushes the branch, so the remote will always show just your one commit.
β οΈ WARNING:
atomic remote
force-pushes and rewrites your branch history on the remote.
Never use on shared or protected branches!
Always communicate with your team before rewriting remote history.
Examples:
## π Templates
Built-in templates:
rust
example
They include:
- Common Rust commands (check, clippy, test)
- Plugin examples
- Commented TOML
πΎ Git Auto-Commits
When you run any custom
or plugin
command that alters the Git tree, Atomic will auto-commit it locally with a timestamp:
[2024-03-27 13:52:12] command: cargo fmt
You don't have to think about git add
or git commit
. It just saves your progress.
π Script Support
Works with:
.sh
,.bat
,.cmd
,.ps1
,.py
,.exe
- Shell chaining:
&&
,||
,;
- Auto OS detection
π Built With
πΊ Roadmap
- Linux support
- Plugin chaining (
plugin.build && plugin.deploy
) - Template variables with default values (
{{ var | default("fallback") }}
) - Git hook integration
- Command caching or skip-if-clean behavior
- Web UI (log viewer or dashboard)
Contribute or suggest features on GitHub.
π Support
βοΈ Author
Built by ExtremelyRyan. MIT licensed. Star the repo if you use it!
π Project Metadata
- Crate name:
cargo-atomic
- Binary name:
atomic
- License: MIT
- Categories: CLI Tools, Git Automation, Rust Dev Utilities