Skip to main content

🔼⚙️ Supsrc

License Python 3.11+ uv Ruff CI

Automated Git commit/push utility based on filesystem events and rules

Never forget to commit again! supsrc watches your repositories for changes and automatically stages, commits, and pushes them according to rules you define. Perfect for frequent checkpointing, synchronizing work-in-progress, or ensuring volatile experiments are saved.

✨ Key Features

  • 📂 Directory Monitoring: Watches specified repository directories recursively for file changes using watchdog.
  • 📜 Rule-Based Triggers:
    • Inactivity: Trigger actions after a configurable period of no file changes (e.g., 30s, 5m).
    • Save Count: Trigger actions after a specific number of file save events.
    • Manual: Disable automatic triggers (useful for testing or specific setups).
  • ⚙️ Git Engine:
    • Interacts with Git repositories using pygit2.
    • Automatically stages modified, added, and deleted files (respecting .gitignore).
    • Performs commits with customizable message templates (including timestamps, save counts, and change summaries).
    • Optionally pushes changes to a configured remote and branch.
    • Handles SSH Agent authentication and basic HTTPS (user/token via env vars).
  • 📝 TOML Configuration: Easy-to-understand configuration file (supsrc.conf).
  • 🕶️ .gitignore Respect: Automatically ignores files specified in the repository's .gitignore.
  • 📊 Structured Logging: Detailed logging using structlog for observability (JSON or colored console output).
  • 🖥️ Optional TUI: An interactive Terminal User Interface (built with textual) for monitoring repository status and logs in real-time.
  • 📟 Tail Mode: A headless, non-interactive mode for monitoring repositories without terminal control issues (useful for scripts and automation).

Quick Start

  1. Install: uv tool install supsrc
  2. Read the Getting Started guide.
  3. Try the examples in examples/README.md.

Documentation

Development

Quick Start

# Set up environment
uv sync

# Run common tasks
we run test       # Run tests
we run lint       # Check code
we run format     # Format code
we tasks          # See all available commands

See CLAUDE.md for detailed development instructions and architecture information.

🤝 Contributing

Contributions are welcome! Please feel free to open an issue to report bugs, suggest features, or ask questions. Pull requests are greatly appreciated.

📜 License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

🤔 Why supsrc?

  • Automated Checkpoints: Working on something complex or experimental? supsrc can automatically commit your changes after a period of inactivity or after a certain number of saves, creating a safety net without interrupting your flow.
  • Effortless Syncing: Keep a work-in-progress branch automatically pushed to a remote for backup or collaboration, without manual git add/commit/push steps.
  • Simple Configuration: Define your repositories and rules in a clear TOML file.
  • Focused: Designed specifically for the "watch and sync" workflow, aiming to be simpler than custom scripting or more complex backup solutions for this specific task.

🚀 Installation

uv is a fast Python package installer and resolver:

# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install supsrc
uv tool install supsrc

# Install with TUI support
uv tool install 'supsrc[tui]'

# Install with LLM support (Gemini and Ollama)
uv tool install 'supsrc[llm]'

# Install with all optional features
uv tool install 'supsrc[tui,llm]'

💡 Usage

  1. Create a Configuration File: By default, supsrc looks for supsrc.conf in the current directory. See the Configuration section below for details.

  2. Run the Watcher:

    # Run with interactive dashboard (TUI mode)
    supsrc sui
    
    # Run in headless mode (non-interactive)
    supsrc watch
    
    # Specify a different config file
    supsrc sui -c /path/to/your/config.toml
    supsrc watch -c /path/to/your/config.toml
    
    # Increase log verbosity
    supsrc watch --log-level DEBUG
    
  3. Check Configuration: Validate and display the loaded configuration (including environment variable overrides):

    supsrc config show
    supsrc config show -c path/to/config.toml
    
  4. Stop the Watcher: Press Ctrl+C to stop the watcher gracefully.

⚙️ Configuration

supsrc uses a TOML configuration file (supsrc.conf) to define repositories, rules, and Git settings. Configuration supports:

  • Multiple repository monitoring with individual settings
  • Rule-based triggers (inactivity, save count, manual)
  • Git engine with auto-push, custom commit messages, and authentication
  • Optional LLM integration for commit message generation and code review
  • Environment variable overrides for flexible deployment

See the Configuration Guide for complete documentation on:

  • Configuration file structure and examples
  • Rule types and behavior
  • Git authentication (SSH Agent, HTTPS)
  • LLM providers (Gemini, Ollama)
  • Environment variables
  • TUI setup

🙏 Acknowledgements

supsrc builds upon several fantastic open-source libraries, including:

Copyright (c) provide.io LLC.

Metadata

Release files for supsrc 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for supsrc 0.4.0
File Size Uploaded
supsrc-0.4.0.tar.gz 152.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for supsrc 0.4.0
File Interpreter ABI Platform
supsrc-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 355.0 kB

Release files / supsrc-0.4.0.tar.gz

Download URL supsrc-0.4.0.tar.gz
Size 152.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5a496c1a348facbb006e69571884420bb51afcfa4eec2e17047739158a96df2d
BLAKE2b-256 checksum
How to use checksums
959f68db4eec22aecafe0619f84c0b387f53497ff652cbb02de8141881469cc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / supsrc-0.4.0-py3-none-any.whl

Download URL supsrc-0.4.0-py3-none-any.whl
Size 202.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a18de66bb87317f73a8278e4a80b122dbd52578c1690ad2952620e11a48dea7
BLAKE2b-256 checksum
How to use checksums
2325b5744b5751fded41576b99263d472a1ad001414b6d9a2dea6fd399814e96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page