sastri 0.1.0

Scaffold multi-ecosystem packaging and CI/CD for Rust CLIs (Homebrew, Scoop, PyPI, npm, Hex, mise, asdf, …)
Documentation
# Guide

Sastri encodes the **one binary, many front doors** pattern: GitHub Releases hold the native CLI; every other installer is a thin wrapper around those assets.

Named after [C. V. Runganada Sastri](https://en.wikipedia.org/wiki/C._V._Runganada_Sastri), a polyglot who moved fluently across languages — the same idea as shipping one binary through many install ecosystems.

Background: [one binary, many front doors](https://thanos.github.io/articles/multi-ecosystem-rust-cli-install/).

## Architecture

```
GitHub Releases (+ SHA256SUMS)
        │
        ├─ CI (fmt / clippy / test / coverage) — quality gate on main/PRs
        ├─ install.sh / setup Action / mise / asdf
        ├─ Homebrew tap / Scoop bucket
        └─ optional npm / PyPI / Hex wrappers
```

`cargo install` stays a **contributor** path. End users should prefer brew, scoop, mise, asdf, or `install.sh`.

## Release asset contract

For tag `v0.1.0` and binary `greet`, Sastri expects:

| Platform | Asset |
| --- | --- |
| Linux x86_64 / aarch64 | `greet-v0.1.0-linux-*.tar.gz` |
| macOS Intel / Apple Silicon | `greet-v0.1.0-macos-*.tar.gz` |
| Windows x86_64 | `greet-v0.1.0-windows-x86_64.zip` |
| All | `SHA256SUMS` |

Homebrew, Scoop, `install.sh`, and asdf verify or pin against that layout.

## What each mechanism does

| Mechanism | Emits | Role |
| --- | --- | --- |
| `ci` | `.github/workflows/ci.yml` | Format, Clippy, OS matrix tests, `cargo llvm-cov` artifact |
| `github_releases` | `.github/workflows/release.yml` | Build matrix, GitHub Release, optional crates.io publish |
| `install_sh` | `scripts/install.sh` | curl \| sh installer with checksum verify |
| `homebrew` | `packaging/homebrew/*.rb` | Formula template for your org tap |
| `scoop` | `packaging/scoop/*.json` | Windows Scoop manifest |
| `asdf` | `packaging/asdf-*` | Plugin (`list-all` + `install`) for a separate plugin repo |
| `mise` | `packaging/mise/README.md` | `github:` backend / `tool_alias` snippets |
| `setup_action` | `.github/actions/setup-*` | Composite Action that installs the release binary |
| `npm` / `pypi` / `hex` | language wrappers | Optional; same binary via postinstall / maturin / Mix |
| `ruby_gem` / `haskell_cabal` | stubs | Enable when implemented |

## Recommended README order

1. Homebrew, Scoop, `install.sh`
2. mise / asdf
3. CI setup Action
4. Language wrappers (if any)
5. `cargo install` last

## Secrets and external repos

Run:

```bash
sastri secrets
```

Typical setup:

- `CRATES_IO_TOKEN` — if `publish_crates_io = true`
- Org tap / Scoop bucket / asdf plugin repositories (create once, many CLIs can share the tap/bucket)
- Registry tokens only when npm / Hex / etc. are enabled

Sastri **never** writes secret values into `Sastri.toml`.

## Dogfooding

This repository’s own `Sastri.toml` enables CI, Releases, install.sh, Homebrew, Scoop, asdf, mise, and the setup Action — the same channels documented for consumers.

After tagging `v*`, fill checksums in `packaging/homebrew` and `packaging/scoop`, then publish those files to the tap/bucket/plugin repos listed under `[org]`.

## Coverage locally

```bash
rustup component add llvm-tools-preview
cargo install cargo-llvm-cov
cargo llvm-cov --all-features --workspace --summary-only
cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
```

CI uploads `lcov.info` as the `coverage-lcov` artifact.