Skip to main content

Crate ebman

Crate ebman 

Source
Expand description

ebman — k9s-style TUI for AWS Elastic Beanstalk.

The crate is split lib + bin: this library holds the testable logic (all the modules below), and src/main.rs is a thin binary entry point that wires argv parsing, logging, the TUI lifecycle, and dispatch into the lib. See CLAUDE.md for working rules and BACKLOG.md for the milestone plan.

Splitting lib + bin lets integration tests and a sibling crate (tui-common planned for a workspace with pgman) use ebman::… the internal types instead of re-implementing them.

Modules§

app
audit
Audit log: writers, parser, renderer, filter.
aws
cli
ebman <verb> non-interactive subcommands.
commands
Single source of truth for :command metadata.
config
control
Optional Unix-socket control plane. When ebman is launched with --control-socket PATH, this module opens a listener at PATH and accepts one-shot requests:
cost_cache
On-disk cache for Cost Explorer results.
demo_fixture
Hand-crafted demo data for ebman --demo. Builds a believable six-env fleet across two applications so VHS / asciinema captures and screenshots can be reproduced without touching a real AWS account.
deploy_poll
Wait-for-Green polling state machine shared between the CLI ([crate::cli::action::run_deploy] / run_rollout) and the TUI (App::spawn_rollout_dispatch).
eb_cli
EB CLI compatibility: read <repo>/.elasticbeanstalk/config.yml for default profile / region / application.
font_probe
Detect whether the current terminal’s font renders Powerline / Nerd glyphs as a single cell. We can’t actually inspect the font from a TUI, but we can write a known Powerline triangle (U+E0B0) and ask the terminal where the cursor ended up. A patched font draws the glyph in one cell — cursor advances by 1. An unpatched font usually substitutes the placeholder block which most terminals render as a “wide” character, advancing the cursor by 2 — or, more commonly, falls back to the tofu/replacement character which most terminals render in one cell but at an obviously wrong baseline (we can’t tell from here, but the cell count is at least stable). We treat advance-by-1 as “supported” and anything else as “not supported”.
form
Modal forms — reusable scaffolding for multi-field option-settings editors. The first concrete consumer is :capacity (MinSize / MaxSize / InstanceType / Cooldown); the Network / Security pickers will follow once we add a multi-select field kind.
lint
Rule-based diagnostic engine. Drives three surfaces:
llm
LLM-backed explanations for lint issues.
mode_action
Modal action flow — the :a actions menu and everything it spawns.
mode_detail
Per-env drill-down mode — the tabbed view (Events / Instances / Metrics / Queue / Logs / Config) the operator gets on Enter.
mode_dlq
DLQ inspection mode — viewer for the worker tier’s main + dead-letter SQS queues with peek / delete / purge / resend flows.
overlay
Centred-overlay sizing for ratatui popups.
plugins
profiles
project
Project-level configuration: <repo>/.ebman/ebman.toml.
report_bug
Bug-report payload builder.
saved_config
Parser for the EB CLI saved-config YAML format (.elasticbeanstalk/saved_configs/*.cfg.yml). The on-disk shape:
shell
Embedded shell pane — spawns a subprocess inside a pseudo-terminal we own, feeds its output through vt100 to maintain a virtual terminal buffer, and exposes a render path that paints that buffer into a ratatui Buffer. The user types into ebman, ebman writes the bytes to the PTY master, the subprocess sees them as if they were typed directly.
splash
Pixel-art splash scene — a beanstalk growing out of its pot (the ebman = Elastic Beanstalk gag: watch the thing sprout). Used by the boot splash and the :about overlay.
sso
state
terraform
Terraform integration: discover terraform.tfstate, parse it for aws_elastic_beanstalk_environment resources, and compute drift between the operator’s tf-declared intent and the live EB state. Drives three surfaces in 0.13:
theme
ui
update_check
Check crates.io for a newer release of ebman. The check fires once at startup and writes its result to the App via an AppMsg::UpdateCheck. We don’t pull in reqwest for this — curl is already a dependency of the log-tail feature, so a one-shot subprocess fits in the same budget.
util
App-specific path helpers for ebman. The generic bits (parse_bool, write_atomic) live in tui-common::util and are re-exported here so existing crate::util::* call sites keep working unchanged.

Type Aliases§

LogReloadHandle
Handle for live-reloading the log filter from the running app. Constructed by main::init_logging and threaded onto App so :loglevel can mutate the active subscriber at runtime.
Tui
Concrete ratatui terminal we drive through the alt-screen. Lives in the lib so app::App can hold a mutable reference to it through long-running operations (embedded shell, $EDITOR hand-off).