NPM CLI Package for Starship: Complete Guide to @starship-ci/cli
The official NPM CLI package for Starship is @starship-ci/cli, which installs a global starship binary that orchestrates deployment, configuration, and lifecycle management of Cosmos blockchain infrastructure through a YAML-driven interface.
The NPM CLI package for Starship, published as @starship-ci/cli, provides the official command-line interface for the hyperweb-io/starship project. This package enables developers to manage Starship deployments—spinning up multi-chain Cosmos environments—directly from their terminal using a configuration-driven workflow.
Installing the Starship NPM CLI
Install the package globally to register the starship command on your system PATH.
npm install -g @starship-ci/cli
When installed, the package exposes a binary named starship that points to ./index.js, as defined in packages/packages/cli/package.json lines 2-24. This binary serves as the entry point for all CLI operations.
Architecture and Source Code Structure
The CLI implementation resides in packages/packages/cli/ and follows a modular architecture with three core components.
Package Configuration
The package.json file declares the package metadata, dependencies, and binary registration:
- Binary name:
starship - Entry point:
./index.js(compiled output) - Source entry:
src/index.ts
CLI Runner Implementation
The main execution logic lives in packages/packages/cli/src/index.ts. This runner performs the following sequence:
- Parses command-line arguments using
minimist. - Loads a YAML configuration file when
--configis provided. - Prompts for missing parameters using
inquirerer. - Instantiates
StarshipClient(from@starship-ci/client) andStarshipInstaller. - Dispatches commands via a
switchstatement handlingstart,deploy,stop,verify, and other operations.
Utility Functions
Helper utilities in packages/packages/cli/src/utils.ts provide:
displayVersion– Reads the localpackage.jsonto output version information.displayUsage– Renders comprehensive help text showing available commands and options.
Available Commands and Usage Examples
The starship binary supports several lifecycle commands for managing blockchain infrastructure.
Display Help and Version
View available commands and verify installation:
starship help
starship --version
The --version flag (or -v) invokes displayVersion() from src/utils.ts lines 11-15, which extracts version data directly from the package manifest.
Deploy Infrastructure
Deploy a Starship environment using a YAML configuration file:
starship deploy --config ./config/two-chain.yaml
The --config flag specifies the path to a YAML file describing Helm releases, chain endpoints, and service configurations. Command-line flags such as --name, --version, and --timeout override values defined in the YAML.
Start Services
Initialize and start the configured services:
starship start --config ./config/two-chain.yaml
This command creates a StarshipClient instance with the merged configuration and invokes client.start() to provision the infrastructure.
Verify Deployment Health
Check the status of deployed resources:
starship verify --config ./config/two-chain.yaml
The verify command inspects REST/RPC endpoints, faucet services, registry, explorer, and relayer status to ensure the environment is ready for use.
Stop and Teardown
Halt running infrastructure:
starship stop --config ./config/two-chain.yaml
Install Dependencies
Run first-time setup to pull required Docker images and Helm charts:
starship setup
# Alternative syntax:
starship install
Both commands invoke StarshipInstaller.checkAndInstallDependencies() to ensure the local environment has all necessary dependencies.
Configuration File Handling
The CLI relies on YAML configuration files to define multi-chain topologies. When you provide --config, the runner loads and validates the file before instantiating the client. If required parameters are missing from both the config file and command-line arguments, inquirerer prompts the user interactively to supply the values.
Summary
- @starship-ci/cli is the official NPM CLI package for Starship, registered under the binary name
starship. - The package source resides in
packages/packages/cli/, with the main runner implemented insrc/index.tsand utilities insrc/utils.ts. - The CLI uses minimist for argument parsing and inquirerer for interactive prompts.
- Core commands include
deploy,start,verify,stop, andsetup(orinstall), all driven by YAML configuration files. - The architecture instantiates StarshipClient and StarshipInstaller classes to execute infrastructure operations.
Frequently Asked Questions
What is the exact NPM package name for the Starship CLI?
The package is published as @starship-ci/cli on the NPM registry. Installing it globally registers the starship binary, which serves as the primary interface for managing Starship deployments according to the package.json definition in packages/packages/cli/package.json.
How does the Starship CLI handle missing configuration parameters?
When the --config flag points to a YAML file, the CLI loads the configuration in src/index.ts. If required values are absent from both the file and command-line arguments, the CLI uses inquirerer to prompt the user interactively for the missing data before proceeding with execution.
What parsing libraries does the Starship NPM CLI use?
The CLI relies on minimist for parsing command-line arguments into a structured options object, and inquirerer for interactive user prompts. These dependencies are invoked in the main runner at packages/packages/cli/src/index.ts before dispatching to specific command handlers.
Where is the starship binary entry point defined in the source code?
The binary is declared in packages/packages/cli/package.json with the key "starship": "./index.js", which points to the compiled JavaScript entry point. The source TypeScript implementation resides in packages/packages/cli/src/index.ts, which exports the logic that ./index.js executes at runtime.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →