# Instructions for AI Agents
## Overview
`bel7-cli` is a small library providing common CLI utilities:
colored console output, string truncation, table styling, clap extensions,
shell completion generation, and progress reporting.
## Build and Test
```bash
cargo build --all-features
cargo fmt --all
cargo nextest run --all-features
cargo clippy --all-features
```
## Repository Layout
* `src/lib.rs`: crate root, re-exports
* `src/output.rs`: colored console output helpers (print_success, print_error, etc.)
* `src/truncate.rs`: string truncation utilities
* `src/tables.rs`: table styling with tabled (requires the `tables` feature)
* `src/clap_ext.rs`: clap argument parsing extensions (requires the `clap` feature)
* `src/completions.rs`: shell completion generation (requires the `completions` feature)
* `src/progress.rs`: progress reporting utilities (requires the `progress` feature)
* `src/errors.rs`: exit code mapping (requires the `errors` feature)
## Key Dependencies
* `owo-colors`: terminal colors
* `tabled`: table formatting (optional)
* `terminal_size`: terminal width detection (optional, with `tables`)
* `clap`: CLI argument parsing (optional)
* `clap_complete` and `clap_complete_nushell`: shell completion generation (optional)
* `indicatif`: progress bars and spinners (optional)
* `sysexits`: exit code mapping (optional)
## Target Rust Version
* This library targets very recent stable Rust
## Rust Code Style
* Use top-level `use` statements (imports), e.g. `Display` or `fmt::Display` with a `use` statement, not `std::fmt::Display`
* Never use function-local `use` statements (imports)
* Add tests to the `tests/` directory, not inline with implementation
* At the end of each task, run `cargo fmt --all`
* At the end of each task, run `cargo clippy --all-features` and fix any warnings it might emit
## Comments
* Only add very important comments, both in tests and in the implementation
## Git Instructions
* Never add yourself to the list of commit co-authors
* Never mention yourself in commit messages in any way (no "Generated by", no AI tool links, etc)
## Style Guide
* Never add full stops to Markdown list items