https://github.com/ut-issl/capsula
CLI tool to run pre-run and post-run hooks for capturing and preserving the context of your command executions
https://github.com/ut-issl/capsula
cli reproducibility rust se-team
Last synced: 5 months ago
JSON representation
CLI tool to run pre-run and post-run hooks for capturing and preserving the context of your command executions
- Host: GitHub
- URL: https://github.com/ut-issl/capsula
- Owner: ut-issl
- License: apache-2.0
- Created: 2023-06-23T14:45:47.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2026-02-09T03:07:04.000Z (5 months ago)
- Last Synced: 2026-02-09T09:29:50.883Z (5 months ago)
- Topics: cli, reproducibility, rust, se-team
- Language: Rust
- Homepage: https://www.space.t.u-tokyo.ac.jp/capsula/
- Size: 4.74 MB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Capsula
[](https://crates.io/crates/capsula)

[](https://github.com/ut-issl/capsula/actions)
[](https://codecov.io/gh/ut-issl/capsula)
[](https://www.space.t.u-tokyo.ac.jp/capsula/)
> [!WARNING]
> This project is in early development. The CLI interface and configuration format may change in future releases.
Capsula is a command-line tool that automatically captures and saves information about your command executions. It records what happened, when it happened, and the environment in which it happened.
## What Does Capsula Do?
When you run a command with Capsula, it:
1. **Records the environment** - Captures git state, environment variables, file contents, and system information
2. **Runs your command** - Executes your command normally, capturing its output
3. **Saves everything** - Stores all captured data in an organized directory structure
## Quick Example
Create a `capsula.toml` file:
```toml
[vault]
name = "my-project"
[[pre-run.hooks]]
id = "capture-git-repo"
name = "my-project"
path = "."
[[post-run.hooks]]
id = "capture-file"
glob = "output.txt"
mode = "copy"
```
Run your command:
```bash
capsula run python train_model.py
```
Capsula creates an organized directory:
```
.capsula/my-project/2025-01-09/143022-happy-river/
├── _capsula/
│ ├── metadata.json # What ran, when, and where
│ ├── pre-run.json # Environment before
│ ├── command.json # Command output
│ └── post-run.json # Results after
└── output.txt # Your output file
```
## Why Use Capsula?
- **Reproducibility** - Capture the exact environment and inputs for every run
- **Traceability** - Know which code version produced which results
- **Auditing** - Generate complete execution records
- **Debugging** - Understand what went wrong by reviewing the complete context
## License
Licensed under either of:
- MIT License ([LICENSE-MIT](LICENSE-MIT))
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE))
at your option.