| name | rust-factory-cli |
| description | Use this skill when implementing, extending, or debugging the factoryctl Rust CLI. Trigger when: adding new CLI commands, implementing API client calls in Rust, writing Cargo.toml config, generating CLI help text, implementing the audit runner, or integrating factoryctl with Pi API endpoints. |
Rust Factory CLI
Role
factoryctl is the operator-facing CLI for the Pauli Pipeline factory. It is written in Rust for performance, reliability, and binary distribution.
Command Surface
factoryctl tenant create Provision a new tenant via Pi API
factoryctl tenant ingest Ingest content into tenant memory
factoryctl website scaffold Clone and configure website template for a tenant
factoryctl website deploy Deploy tenant website to Vercel
factoryctl api suspend Suspend tenant API access (human-gated)
factoryctl api resume Resume tenant API access (human-gated)
factoryctl paperclip heartbeat Send heartbeat to Paperclip control plane
factoryctl audit run Run quality gate audit and produce report
Technology Stack
- Language: Rust (stable)
- CLI framework:
clap (derive API)
- HTTP client:
reqwest with async/tokio
- Config:
config crate reading from env + ~/.config/factoryctl/config.toml
- Output: plain text by default,
--json for machine-readable
- Error handling:
anyhow for operator errors, thiserror for typed internal errors
Cargo.toml (planned)
[package]
name = "factoryctl"
version = "0.1.0"
edition = "2021"
[[bin]]
name = "factoryctl"
path = "src/main.rs"
[dependencies]
clap = { version = "4", features = ["derive"] }
reqwest = { version = "0.12", features = ["json", "rustls-tls"] }
tokio = { version = "1", features = ["full"] }
anyhow = "1"
thiserror = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
config = "0.14"
Audit Runner
factoryctl audit run executes:
bash scripts/vercel-build.sh (build check)
- Secret scan via grep patterns
- Accessibility check (via axe-cli or pa11y if installed)
- UDEC scoring heuristics (structure, copy, CTA, mobile, performance)
- Writes
factory/audits/audit-YYYY-MM-DD.md
- Exits non-zero if critical checks fail
References