Skip to main content

Module bootstrap

Module bootstrap 

Source
Expand description

External dependency bootstrap — install the binaries pawan shells out to.

Pawan depends on a few external tools that aren’t pulled in by cargo install pawan:

  • mise — polyglot tool/runtime manager (needed to install the rest)
  • rg, fd, sd, ast-grep, erd — native search/replace/tree tools (auto-installed via mise on first tool use, but only if mise is present)

As of the Option B rewrite, deagle is NO LONGER an external dep: deagle-core and deagle-parse are embedded directly into pawan as library crates, so all 5 deagle tools work out of the box. The ensure_deagle function still exists for backwards compatibility (and for users who want the standalone deagle CLI on PATH for interactive use), but it’s opt-in via --include-deagle and not part of the default bootstrap.

This module provides an idempotent, reversible install path so that cargo install pawan && pawan bootstrap is enough to get a working setup — no manual tool wrangling. Each step is non-destructive: it checks which <binary> first and skips if the binary is already on PATH, unless force_reinstall is set.

§Reversibility

uninstall removes the marker file and optionally runs cargo uninstall deagle (only if --purge-deagle is passed, and only if the user had opted in to installing it). It deliberately does NOT touch mise or mise-managed tools because those may be used by other programs on the system.

Structs§

BootstrapOptions
Options for a bootstrap run.
BootstrapReport
Summary of a bootstrap run — one BootstrapStep per dependency.
BootstrapStep
One line of a bootstrap report.

Enums§

BootstrapStepStatus
The outcome of installing (or trying to install) a single dependency.

Constants§

NATIVE_TOOLS
The native tools managed by mise. Must match the tool names pawan uses at runtime in tools/native.rs.

Functions§

binary_exists
Check if a binary is available on PATH.
ensure_deagle
Install deagle via cargo install --locked deagle. Idempotent — if deagle is already on PATH and force is false, returns AlreadyInstalled without shelling out.
ensure_deps
Run the full bootstrap sequence per the options. On success (all_ok returns true), writes a marker file at marker_path containing the install timestamp.
ensure_mise
Install mise via cargo install --locked mise. Idempotent — skipped if mise is already on PATH or at ~/.local/bin/mise (mise’s default install location, which may not yet be on PATH).
ensure_native_tool
Install a native tool via mise. Requires mise to already be on PATH (or at ~/.local/bin/mise) — returns Skipped otherwise so the caller can decide how to surface that.
is_bootstrapped
True if every REQUIRED external dep is on PATH. Deagle is excluded because pawan embeds deagle-core + deagle-parse as library deps — the standalone binary is no longer required.
marker_path
Path to the “this pawan has been bootstrapped” marker file. The presence of this file is how startup knows to skip the auto-bootstrap prompt on subsequent runs.
missing_deps
List of REQUIRED dep names that are NOT on PATH. Deagle is excluded because pawan embeds it directly — see is_bootstrapped. Used by pawan doctor and the CLI bootstrap --dry-run flag.
uninstall
Reverse the bootstrap: remove the marker file, and optionally run cargo uninstall deagle. Deliberately does NOT uninstall mise or mise-managed tools — those may be used by other programs.