> ## Documentation Index
> Fetch the complete documentation index at: https://docs.taho.is/llms.txt
> Use this file to discover all available pages before exploring further.

# cargo pantry

> CLI reference for the cargo pantry subcommand.

`cargo pantry` is a cargo subcommand that launches and scaffolds TUI Pantry projects.

## Commands

### `cargo pantry`

Launch the Pantry. Requires a `pantry.toml` in the current directory (or a `-p` flag targeting a workspace package that has one).

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
cargo pantry
```

Runs `cargo run --example widget_preview --features tui-pantry` with inherited stdio so the TUI owns the terminal. Falls back to `--features pantry` if the first feature name is not found.

### `cargo pantry init`

Scaffold a new pantry in the current crate. Requires a `Cargo.toml` in the working directory.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
cargo pantry init
```

This creates:

* `tui-pantry` as an optional dependency (via `cargo add tui-pantry --optional`)
* `pantry.toml` with default config
* `examples/widget_preview/main.rs`: entry point using `tui_pantry::run!()`
* `examples/widget_preview/widgets.rs`: sample Widget tab ingredients
* `examples/widget_preview/panes.rs`: sample Panes tab ingredients
* `examples/widget_preview/views.rs`: sample Views tab ingredients

Existing files are not overwritten. The scaffold compiles and runs immediately.

## Flags

### `-p <package>` / `--package <package>`

Target a specific workspace package:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
cargo pantry -p my-widget-crate
```

All other flags are forwarded to `cargo run`.
