cli

package
v2.0.0-alpha.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const AppName = "innerstack"

Variables

This section is empty.

Functions

func Edit

func Edit(seed string, suffix string) (string, error)

Edit opens the user's preferred editor on a temp file pre-filled with seed and returns the edited content verbatim. A single trailing newline is trimmed to match the historical multi-line prompt behavior; everything else (inner newlines, \r\n, unicode, lines that equal "...") is preserved byte-for-byte.

Editor selection order: $INNERSTACK_EDITOR, $EDITOR, $VISUAL, then "vi". The chosen variable may contain arguments (e.g. "code --wait"), which are interpreted via "sh -c" so multi-token editors work.

suffix sets the temp file extension so editors apply syntax highlighting.

func Flush

func Flush() error

Flush writes the current configuration back to the config file. The file is recreated with 0600 permissions since it holds access keys.

func NewAppDeleteCommand

func NewAppDeleteCommand() *cobra.Command

func NewAppDeployCommand

func NewAppDeployCommand() *cobra.Command

func NewAppInfoCommand

func NewAppInfoCommand() *cobra.Command

func NewAppListCommand

func NewAppListCommand() *cobra.Command

func NewAppSpecInfoCommand

func NewAppSpecInfoCommand() *cobra.Command

NewAppSpecInfoCommand creates the "app-spec-info" command for looking up an application spec by name. It calls AppSpecList with a name filter on the zonelet server.

func NewAppSpecListCommand

func NewAppSpecListCommand() *cobra.Command

NewAppSpecListCommand creates the "app-spec-list" command for listing all application specs stored on the zonelet server.

func NewGatewayIngressInfoCommand

func NewGatewayIngressInfoCommand() *cobra.Command

func NewGatewayIngressListCommand

func NewGatewayIngressListCommand() *cobra.Command

func NewGatewayIngressSetCommand

func NewGatewayIngressSetCommand() *cobra.Command

func NewHostJoinCommand

func NewHostJoinCommand() *cobra.Command

func NewHostListCommand

func NewHostListCommand() *cobra.Command

func NewLoginCommand

func NewLoginCommand() *cobra.Command

NewLoginCommand wires up the `login` command: a local zone credential manager. It never connects to a server; subsequent commands resolve the current zone and connect on demand.

login -n <zone> -a <host:port> -s <access-key>   add or update a zone
login <zone-name>                                switch the current zone
login                                            list configured zones

func NewPkgBuildCommand

func NewPkgBuildCommand() *cobra.Command

NewPkgBuildCommand creates the "pkg-build" command for building .ipk packages. An .ipk package is a distributable archive containing application binaries and metadata, ready for deployment to zonelet servers.

func NewPkgDelCommand

func NewPkgDelCommand() *cobra.Command

NewPkgDelCommand creates the "pkg-del" command for deleting packages. Removes a package and all its associated data chunks from the server.

func NewPkgExportCommand

func NewPkgExportCommand() *cobra.Command

NewPkgExportCommand creates the "pkg-export" command for extracting .ipk packages. It decompresses (xz/gzip) and extracts the package file tree into a directory, the inverse of pkg-build.

func NewPkgInfoCommand

func NewPkgInfoCommand() *cobra.Command

NewPkgInfoCommand creates the "pkg-info" command for inspecting .ipk files. Displays package metadata and can extract the data block from the archive.

func NewPkgListCommand

func NewPkgListCommand() *cobra.Command

NewPkgListCommand creates the "pkg-list" command for listing packages. Displays packages stored on the zonelet server in a formatted table.

func NewPkgPushCommand

func NewPkgPushCommand() *cobra.Command

NewPkgPushCommand creates the "pkg-push" command for uploading packages. Supports chunked upload with progress tracking and CRC32 checksum verification.

func NewZoneInfoCommand

func NewZoneInfoCommand() *cobra.Command

func NewZoneInitCommand

func NewZoneInitCommand() *cobra.Command

func NewZoneSetCommand

func NewZoneSetCommand() *cobra.Command

func PrintCurrentZoneHint

func PrintCurrentZoneHint(cmd *cobra.Command)

PrintCurrentZoneHint writes a one-line reminder of the active zone to stderr. It helps the operator notice which zone a command will operate on when more than one zone is configured. It is a no-op when:

  • the resolved command is the root (no subcommand) or `login` (which manages zone entries rather than operating on one),
  • fewer than two zones are configured (nothing to disambiguate).

Output goes to stderr so it never pollutes the command's stdout (JSON, tables, ...).

func Setup

func Setup() error

Setup loads the CLI configuration from file. A missing config file is not an error: Config stays empty and loadedConfigPath is set to the default path so that Flush can create it on the first `login add`.

Types

type ConfigCommon

type ConfigCommon struct {
	CurrentZone string        `toml:"current_zone"`
	Zones       []*ConfigZone `toml:"zones"`
}

Config represents the CLI configuration file

var Config ConfigCommon

Config is the loaded configuration

func (*ConfigCommon) Zone

func (it *ConfigCommon) Zone(name string) (*ConfigZone, error)

Zone returns the zone config by name, or the current zone if name is empty.

type ConfigZone

type ConfigZone struct {
	Name string `toml:"name"`
	Addr string `toml:"addr"`
	AK   string `toml:"access_key"` // full access key, format: ak_<id>_<secret>
}

ConfigZone represents a single zone accessKey

func (*ConfigZone) AccessKey

func (c *ConfigZone) AccessKey() (*inauth.AccessKey, error)

AccessKey parses the AK string (ak_{id}_{secret}) into an AccessKey

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL