How hopinc/cli works
Project type and purpose
• Hop CLI is a Rust-based command-line application that serves as a client for Hop’s backend services. It replaces the browser-based Console by exposing Hop functionality (auth, projects, deploy, etc.) via terminal commands.
File structure
• Top-level files: Cargo.toml/build.rs for Rust build, README.md, scripts/ (installation and CI scripts), build/ (packaging for Windows MSI), .github/ workflows for CI/CD.
• src/main.rs: CLI entry point. src/lib.rs: core logic.
• src/commands/: each subfolder represents a top-level command namespace (auth, channels, containers, deploy, ignite, projects, etc.). Within each, further modules implement individual actions.
• src/state/http/: HTTP client abstraction (types & client setup).
• src/store/: local state management (context, auth tokens, Hopfile parsing).
• src/utils/: shared utilities (serialization, browser launching, size formatting).
README for additional insights
• The README confirms its role as a CLI for Hop, describes installation and login flow, and highlights key operations (projects switch, deploy, link).