Skip to content

django23/asimov

 
 

Repository files navigation

Asimov

Tests Homebrew macOS 14+ License: MIT Shell: Bash

Those people who think they know everything are a great annoyance to those of us who do.
— Isaac Asimov

Asimov automatically excludes development dependencies from macOS Time Machine backups. It scans your home directory for known dependency directories (e.g. node_modules/, vendor/, .venv/), verifies that the corresponding config file exists alongside them, and tells Time Machine to skip them. No more wasting backup space on files you can restore with a single command.

Requirements: macOS with Bash (e.g. macOS 14+).

Quick start

brew install asimov
sudo brew services start asimov   # run daily via launchd

That's it. Asimov will now run once a day and exclude any dependency directories it finds.

To run on-demand instead:

asimov

To see what would be excluded without changing Time Machine (dry run):

asimov --dry-run

Use asimov --help for options and asimov --version for the version.

Option Description
--dry-run Print what would be excluded without changing Time Machine
--help Show usage and options, then exit
--version Show version and exit

Supported ecosystems

Asimov recognizes dependency directories across 30+ patterns in these ecosystems:

Ecosystem Directories excluded
JavaScript / TypeScript node_modules, .next, .nuxt, .angular, .svelte-kit, .turbo, .yarn, .parcel-cache, bower_components, elm-stuff
Python .venv, venv, .tox, .nox, __pypackages__, build, dist
Rust target
Go vendor
PHP vendor
Ruby vendor
Java / Kotlin / Scala .gradle, build, target
.NET (C# / F#) bin, obj
Swift / Apple .build, Carthage, Pods
Dart / Flutter .dart_tool, .packages, build
Elixir deps, _build, .build
Clojure target, .cpcache, .shadow-cljs
Haskell .stack-work
OCaml _build
Zig .zig-cache, zig-out
R renv
DevOps / IaC .terraform, .terragrunt-cache, .vagrant, .direnv, cdk.out
Game dev .godot
Global caches ~/.cache, ~/.gradle/caches, ~/.m2/repository, ~/.npm/_cacache, ~/.nuget/packages, ~/.kube/cache

Each directory is only excluded when its corresponding config file (the "sentinel") exists — so node_modules is only excluded if package.json is present, vendor only if composer.json, go.mod, or Gemfile exists, etc.

Installation

Homebrew (recommended)

brew install asimov

For the latest development version:

brew install asimov --head

Schedule Asimov to run daily:

sudo brew services start asimov

Manual

git clone https://github.com/stevegrunwell/asimov.git --depth 1
cd asimov
make install

This copies Asimov to /usr/local/bin, sets up a daily launchd schedule, and runs it immediately.

Tip: Edit com.stevegrunwell.asimov.plist before running make install to customize the schedule.

Uninstall

make uninstall     # manual installations
# or
brew uninstall asimov

How it works

Asimov is a thin wrapper around Apple's tmutil. It builds a single find command from all known dependency patterns, walks your home directory (skipping ~/Library and ~/.Trash), and pipes matching paths through tmutil addexclusion. It also unconditionally excludes well-known global tool caches (like ~/.cache, ~/.gradle/caches, and ~/.npm/_cacache) that can always be safely restored. Directories already excluded are skipped automatically — safe to run as often as you like.

Note: Asimov only excludes directories from Time Machine backups. It does not affect Spotlight indexing. To prevent Spotlight from indexing a directory, add it to the Privacy tab in System Settings > Spotlight (or Siri & Spotlight on newer macOS versions).

Inspecting exclusions

List everything excluded from Time Machine:

make exclusions

Remove an exclusion added in error:

tmutil removeexclusion /path/to/directory

Contributing

Contributions are welcome! See CONTRIBUTING.md for setup, guidelines, and how to add new dependency patterns.

License

MIT — Steve Grunwell

About

Automatically exclude development dependencies from Apple Time Machine backups

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Shell 94.9%
  • Makefile 5.1%