Skip to content

Fleet Management

The envpkt fleet command scans a directory tree for envpkt.toml files and aggregates credential health across your entire fleet.

Terminal window
# Scan current directory (default depth: 3)
envpkt fleet
# Scan specific directory with deeper traversal
envpkt fleet -d /opt/agents --depth 5
# JSON output for monitoring systems
envpkt fleet --format json

Fleet health is the worst status across all agents:

Overall StatusMeaning
healthyAll agents pass audit
degradedSome agents have expiring_soon or stale secrets
criticalAt least one agent has expired or missing secrets

Show only agents with a specific health status:

Terminal window
# Show critical agents only
envpkt fleet --status critical
# Show degraded agents
envpkt fleet --status degraded

The table output shows per-agent:

  • Path — relative path to the envpkt.toml
  • Agent — agent name (from [agent] section)
  • Status — health status
  • Secrets — total secret count
  • Min Expiry — days until the nearest expiration

Followed by aggregate totals.

Use scanFleet() programmatically:

import { scanFleet } from "envpkt"
const fleet = scanFleet("/opt/agents", { maxDepth: 3 })
console.log(`${fleet.total_agents} agents, ${fleet.total_secrets} secrets`)
console.log(`Status: ${fleet.status}`)
fleet.agents.forEach((agent) => {
console.log(` ${agent.path}: ${agent.audit.status}`)
})

The FleetHealth type provides:

type FleetHealth = {
readonly status: HealthStatus
readonly agents: List<FleetAgent>
readonly total_agents: number
readonly total_secrets: number
readonly expired: number
readonly expiring_soon: number
}