cli

command module
v1.22.7 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

README

Lux CLI

Lux CLI is a command line tool that gives developers access to everything Lux. This release specializes in helping developers develop and test subnets.

Installation

Compatibility

The tool has been tested on Linux and Mac. Windows is currently not supported.

Instructions

To download a binary for the latest release, run:

curl -sSfL https://raw.githubusercontent.com/luxfi/cli/main/scripts/install.sh | sh -s

The binary will be installed inside the ~/bin directory.

To add the binary to your path, run

export PATH=~/bin:$PATH

To add it to your path permanently, add an export command to your shell initialization script (ex: .bashrc).

Installing in Custom Location

To download the binary into a specific directory, run:

curl -sSfL https://raw.githubusercontent.com/luxfi/cli/main/scripts/install.sh | sh -s -- -b <relative directory>

Quickstart

Subnet Management

After installing, launch your own custom subnet:

lux subnet create <subnetName>
lux subnet deploy <subnetName>

Shut down your local deployment with:

lux network stop
Validator Management

Manage validator nodes with flexible wallet configurations:

# Add a validator
lux node validator add --name mainnet-0 --seed "your seed phrase" --account 0

# Start validator
lux node validator start --name mainnet-0

# Check status
lux node validator status

# Stop validator
lux node validator stop --name mainnet-0

For detailed validator management, see CLI Validator Guide.

Restart your local deployment (from where you left off) with:

lux network start

Notable Features

  • Creation of Lux EVM, and custom virtual machine subnet configurations
  • Precompile integration and configuration
  • Local deployment of subnets for development and rapid prototyping
  • Testnet and Lux Mainnet deployment of subnets
  • Ledger support
  • Lux Package Manager Integration

Modifying your Subnet Deployment

You can provide a global node config to edit the way your local node nodes perform under the hood. To provide such a config, you need to create an cli config file. By default, a config file is read in from $HOME/.cli.json. If none exists, no error will occur. To provide a config from a custom location, run any command with the flag --config <pathToConfig>.

To specify the global node config, provide it as a body for the node-config key. Ex:

{
  "network-peer-list-gossip-frequency":"250ms",
  "network-max-reconnect-delay":"1s",
  "public-ip":"127.0.0.1",
  "health-check-frequency":"2s",
  "api-admin-enabled":true,
  "api-ipcs-enabled":true,
  "index-enabled":true
}
Accessing your local subnet remotely

You may wish to deploy your subnet on a cloud instance and access it remotely. If you'd like to do so, use this as your node config:

{
  "node-config": {
    "http-host": "0.0.0.0"
  }
}

Building Locally

To build Lux CLI, you'll first need to install golang. Follow the instructions here: https://go.dev/doc/install.

Once golang is installed, run:

./scripts/build.sh

The binary will be called ./bin/lux.

Docker

To make Lux CLI work in a docker container, add this

{
  "ipv6": true,
  "fixed-cidr-v6": "fd00::/80"
}

to /etc/docker/daemon.json on the host, then restart the docker service. This is because ipv6 is used to resolve local bootstrap IPs, and it is not enabled on a docker container by default.

Running End-to-End Tests

To run our suite of end-to-end tests, you'll need to install Node-JS and yarn. You can follow instructions to do that here and here.

To run the tests, execute the following command from the repo's root directory:

./scripts/run.e2e.sh

Snapshots usage for local networks

Network snapshots are used by the CLI in order to keep track of blockchain state, and to improve performance of local deployments.

They are the main way to persist subnets, blockchains, and blockchain operations, among different executions of the tool.

Three different kinds of snapshots are used:

  • The bootstrap snapshot is provided as the starting network state. It is never modified by CLI usage. Designed for fast deploys. Enables full reset of the blockchain state.
  • The default snapshot is the main way to keep track of blockchain state. Used by default in the tools. It is initialized from the bootstrap snapshot, and after that is updated from CLI operations.
  • custom snapshots can be specified by the user, to save and restore particular states. Only changed if explicitly asked to do so.
Local networks

Usage of local networks:

  • The local network will be started in the background only if it is not already running
  • If the network is not running, both network start and subnet deploy will start it from the default snapshot. subnet deploy will also do the deploy on the started network.
  • If the network is running, network start will do nothing, and subnet deploy will use the running one to do the deploy.
  • The local network will run until calling network stop, network clean, or until machine reboot
Default snapshot

How the CLI commands affect the default snapshot:

  • First call of network start or subnet deploy will initialize default snapshot from the bootstrap snapshot
  • Subsequent calls to subnet deploy do not change the snapshot, only the running network
  • network stop persist the running network into the default snapshot
  • network clean copy again the bootstrap snapshot into the default snapshot, doing a reset of the state

So typically a user will want to do the deploy she needs, change the blockchain state in a specific way, and after that execute network stop to preserve all the state. In a different session, network start or subnet deploy will recover that state.

Custom snapshots

How the CLI commands affect the custom snapshots:

  • network stop can be given an optional snapshot name. This will then be used instead of the default one to save the state
  • network start can be given an optional snapshot name. This will then be used instead of the default one to save the state
  • subnet deploy will take a running network if it is available, so there is a need to use network start previously to do deploys, if wanting to use custom snapshots
  • network clean does not change custom snapshots

So typically a user who wants to use a custom snapshot will do the deploy she needs, change the blockchain state in a specific way, and after that execute network stop with --snapshot-name flag to preserve all the state into the desired snapshot. In a different session, network start with --snapshot-name flag will be called to load that specific snapshot, and after that subnet deploy can be used on top of it. Notice that you need to continue giving --snapshot-name flag to those commands if you continue saving/restoring to it, if not, default snapshot will be used.

Snapshots dir
  • ~/.cli/snapshot will contain all saved snapshots, which can for example be used to pass work around

Detailed Usage

More detailed information on how to use Lux CLI can be found at here.

Documentation

Overview

Package main provides the entry point for the Lux CLI.

Directories

Path Synopsis
cmd
Package cmd provides the root command and subcommands for the Lux CLI.
Package cmd provides the root command and subcommands for the Lux CLI.
ammcmd
Package ammcmd provides commands for managing AMM (Automated Market Maker) pools.
Package ammcmd provides commands for managing AMM (Automated Market Maker) pools.
backendcmd
Package backendcmd provides commands for backend service operations.
Package backendcmd provides commands for backend service operations.
chaincmd
Package chaincmd provides commands for managing blockchain configurations.
Package chaincmd provides commands for managing blockchain configurations.
chaincmd/upgradecmd
Package upgradecmd provides commands for managing blockchain upgrades.
Package upgradecmd provides commands for managing blockchain upgrades.
configcmd
Package configcmd provides commands for managing CLI configuration.
Package configcmd provides commands for managing CLI configuration.
contractcmd
Package contractcmd provides commands for deploying and managing smart contracts.
Package contractcmd provides commands for deploying and managing smart contracts.
devcmd
Package devcmd provides development-related commands for local testing.
Package devcmd provides development-related commands for local testing.
dexcmd
Package dexcmd provides commands for interacting with decentralized exchanges.
Package dexcmd provides commands for interacting with decentralized exchanges.
flags
Package flags provides reusable command-line flags for CLI commands.
Package flags provides reusable command-line flags for CLI commands.
keycmd
Package keycmd provides commands for key management and wallet operations.
Package keycmd provides commands for key management and wallet operations.
l1cmd
Package l1cmd provides commands for creating and managing L1 blockchains.
Package l1cmd provides commands for creating and managing L1 blockchains.
l3cmd
Package l3cmd provides commands for managing L3 blockchains.
Package l3cmd provides commands for managing L3 blockchains.
networkcmd
Package networkcmd provides commands for managing local network operations.
Package networkcmd provides commands for managing local network operations.
primarycmd
Package primarycmd provides commands for managing primary network validators.
Package primarycmd provides commands for managing primary network validators.
rpccmd
Package rpccmd provides RPC commands for interacting with Lux nodes.
Package rpccmd provides RPC commands for interacting with Lux nodes.
transactioncmd
Package transactioncmd provides commands for managing transactions.
Package transactioncmd provides commands for managing transactions.
updatecmd
Package updatecmd provides commands for updating the CLI and related binaries.
Package updatecmd provides commands for updating the CLI and related binaries.
validatorcmd
Package validatorcmd provides commands for managing validators.
Package validatorcmd provides commands for managing validators.
vmcmd
Package vmcmd provides commands for managing VM plugins.
Package vmcmd provides commands for managing VM plugins.
warpcmd
Package warpcmd provides commands for managing Warp messaging and ICM.
Package warpcmd provides commands for managing Warp messaging and ICM.
internal
migrations
Package migrations handles internal data migrations for the CLI.
Package migrations handles internal data migrations for the CLI.
testutils
Package testutils provides test utilities for the CLI.
Package testutils provides test utilities for the CLI.
pkg
ansible
Package ansible provides utilities for creating and managing Ansible inventories.
Package ansible provides utilities for creating and managing Ansible inventories.
application
Package application provides the core application context and utilities for the CLI.
Package application provides the core application context and utilities for the CLI.
binpaths
Package binpaths provides utilities for resolving external binary paths from environment variables, config files, or default locations.
Package binpaths provides utilities for resolving external binary paths from environment variables, config files, or default locations.
binutils
Package binutils provides binary download and management utilities.
Package binutils provides binary download and management utilities.
blockchain
Package blockchain provides utilities for blockchain configuration and deployment.
Package blockchain provides utilities for blockchain configuration and deployment.
chain
Package chain provides chain configuration management with an overlay model.
Package chain provides chain configuration management with an overlay model.
chainvalidators
Package chainvalidators provides typed chain validator operations.
Package chainvalidators provides typed chain validator operations.
cloud/aws
Package aws provides AWS cloud integration utilities.
Package aws provides AWS cloud integration utilities.
cloud/gcp
Package gcp provides Google Cloud Platform integration utilities.
Package gcp provides Google Cloud Platform integration utilities.
cobrautils
Package cobrautils provides utility functions for Cobra command handling.
Package cobrautils provides utility functions for Cobra command handling.
common
Package common provides common utilities used across the CLI.
Package common provides common utilities used across the CLI.
config
Package config provides configuration management utilities for the CLI.
Package config provides configuration management utilities for the CLI.
constants
Package constants provides constant values used throughout the CLI.
Package constants provides constant values used throughout the CLI.
contract
Package contract provides utilities for smart contract interactions.
Package contract provides utilities for smart contract interactions.
dependencies
Package dependencies provides dependency version management and checking.
Package dependencies provides dependency version management and checking.
docker
Package docker provides Docker and docker-compose integration utilities.
Package docker provides Docker and docker-compose integration utilities.
elasticchain
Package elasticsubnet provides elastic subnet configuration and management.
Package elasticsubnet provides elastic subnet configuration and management.
key
Package key provides a pluggable key storage backend system supporting: - Software encrypted storage (AES-256-GCM + Argon2id) - macOS Keychain with TouchID/Biometrics - Linux Secret Service (GNOME Keyring, KWallet) - Hardware security modules (Zymbit, Yubikey) - Remote signing via WalletConnect/QR codes - Ledger hardware wallet (optional)
Package key provides a pluggable key storage backend system supporting: - Software encrypted storage (AES-256-GCM + Argon2id) - macOS Keychain with TouchID/Biometrics - Linux Secret Service (GNOME Keyring, KWallet) - Hardware security modules (Zymbit, Yubikey) - Remote signing via WalletConnect/QR codes - Ledger hardware wallet (optional)
keychain
Package keychain provides key management and signing utilities.
Package keychain provides key management and signing utilities.
localkey
Package localkey provides functions to load keys from ~/.lux/keys at runtime.
Package localkey provides functions to load keys from ~/.lux/keys at runtime.
localnet
Package localnet provides utilities for managing local network operations.
Package localnet provides utilities for managing local network operations.
localnetworkinterface
Package localnetworkinterface provides local network status checking.
Package localnetworkinterface provides local network status checking.
lpm
Package lpm provides the Lux Plugin Manager for managing VM plugins.
Package lpm provides the Lux Plugin Manager for managing VM plugins.
lpmintegration
Package lpmintegration provides integration with the Lux Package Manager (LPM).
Package lpmintegration provides integration with the Lux Package Manager (LPM).
metrics
Package metrics provides telemetry and metrics collection utilities.
Package metrics provides telemetry and metrics collection utilities.
mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
models
Package models contains data structures and types used throughout the CLI.
Package models contains data structures and types used throughout the CLI.
monitoring
Package monitoring provides utilities for setting up monitoring dashboards.
Package monitoring provides utilities for setting up monitoring dashboards.
networkoptions
Package networkoptions provides network option handling for CLI commands.
Package networkoptions provides network option handling for CLI commands.
node
Package node provides utilities for managing Lux node operations.
Package node provides utilities for managing Lux node operations.
plugins
Package plugins provides utilities for managing VM plugins.
Package plugins provides utilities for managing VM plugins.
precompiles
Package precompiles provides utilities for interacting with EVM precompiles.
Package precompiles provides utilities for interacting with EVM precompiles.
prompts
Package prompts provides interactive and non-interactive user prompting utilities.
Package prompts provides interactive and non-interactive user prompting utilities.
prompts/comparator
Package comparator provides value comparison utilities for prompts.
Package comparator provides value comparison utilities for prompts.
prompts/mocks
Package mocks provides mock implementations for prompts.
Package mocks provides mock implementations for prompts.
relayer
Package relayer provides utilities for managing warp relayer services.
Package relayer provides utilities for managing warp relayer services.
remoteconfig
Package remoteconfig provides utilities for managing remote node configurations.
Package remoteconfig provides utilities for managing remote node configurations.
safety
Package safety provides safe deletion operations that protect user configuration.
Package safety provides safe deletion operations that protect user configuration.
signatureaggregator
Package signatureaggregator provides utilities for aggregating BLS signatures.
Package signatureaggregator provides utilities for aggregating BLS signatures.
ssh
Package ssh provides SSH client utilities for remote node management.
Package ssh provides SSH client utilities for remote node management.
statemachine
Package statemachine provides state machine implementations for workflows.
Package statemachine provides state machine implementations for workflows.
txutils
Package txutils provides transaction utilities for creating, signing, and managing transactions.
Package txutils provides transaction utilities for creating, signing, and managing transactions.
types
Package types provides common type definitions and interfaces for the CLI.
Package types provides common type definitions and interfaces for the CLI.
utils
Package utils provides common utility functions for the CLI.
Package utils provides common utility functions for the CLI.
ux
Package ux provides user experience utilities including logging and progress display.
Package ux provides user experience utilities including logging and progress display.
validator
Package validator provides utilities for validator management.
Package validator provides utilities for validator management.
version
Package version provides version checking and compatibility utilities.
Package version provides version checking and compatibility utilities.
vm
Package vm provides utilities for creating and managing virtual machines.
Package vm provides utilities for creating and managing virtual machines.
warp
Package warp provides utilities for managing Warp messaging and ICM contracts.
Package warp provides utilities for managing Warp messaging and ICM contracts.
warp/genesis
Package genesis provides Warp genesis configuration constants
Package genesis provides Warp genesis configuration constants
warp/relayer
Package relayer provides Warp message relayer functionality
Package relayer provides Warp message relayer functionality
warp/signatureaggregator
Package signatureaggregator provides Warp signature aggregation functionality
Package signatureaggregator provides Warp signature aggregation functionality
tests
e2e/commands
Package commands provides CLI command wrappers for e2e testing.
Package commands provides CLI command wrappers for e2e testing.
e2e/testcases/apm
Package lpm provides e2e tests for the Lux Plugin Manager.
Package lpm provides e2e tests for the Lux Plugin Manager.
e2e/testcases/blockchain/configure
Package configure provides e2e tests for blockchain configuration.
Package configure provides e2e tests for blockchain configuration.
e2e/testcases/blockchain/convert
Package convert provides e2e tests for blockchain conversion.
Package convert provides e2e tests for blockchain conversion.
e2e/testcases/blockchain/deploy
Package deploy provides e2e tests for blockchain deployment.
Package deploy provides e2e tests for blockchain deployment.
e2e/testcases/chain
Package subnet provides e2e tests for subnet operations.
Package subnet provides e2e tests for subnet operations.
e2e/testcases/chain/local
Package subnet provides e2e tests for local subnet operations.
Package subnet provides e2e tests for local subnet operations.
e2e/testcases/chain/non-sov/local
Package subnet provides e2e tests for non-sovereign local subnet operations.
Package subnet provides e2e tests for non-sovereign local subnet operations.
e2e/testcases/chain/non-sov/public
Package subnet provides e2e tests for non-sovereign public subnet operations.
Package subnet provides e2e tests for non-sovereign public subnet operations.
e2e/testcases/chain/public
Package subnet contains subnet E2E tests.
Package subnet contains subnet E2E tests.
e2e/testcases/chain/sov/addRemoveValidatorPoA
Package subnet provides e2e tests for PoA validator management.
Package subnet provides e2e tests for PoA validator management.
e2e/testcases/chain/sov/addRemoveValidatorPoS
Package subnet contains subnet E2E tests.
Package subnet contains subnet E2E tests.
e2e/testcases/chain/sov/addValidatorLocal
Package subnet provides e2e tests for adding local validators.
Package subnet provides e2e tests for adding local validators.
e2e/testcases/chain/sov/etna
Package subnet contains subnet E2E tests.
Package subnet contains subnet E2E tests.
e2e/testcases/chain/sov/local
Package subnet provides e2e tests for sovereign local subnet operations.
Package subnet provides e2e tests for sovereign local subnet operations.
e2e/testcases/chain/sov/public
Package subnet provides e2e tests for sovereign public subnet operations.
Package subnet provides e2e tests for sovereign public subnet operations.
e2e/testcases/docker
Package lpm provides e2e tests for Docker operations.
Package lpm provides e2e tests for Docker operations.
e2e/testcases/errhandling
Package errhandling provides e2e tests for error handling.
Package errhandling provides e2e tests for error handling.
e2e/testcases/key
Package key provides e2e tests for key management operations.
Package key provides e2e tests for key management operations.
e2e/testcases/key/create
Package key provides e2e tests for key creation.
Package key provides e2e tests for key creation.
e2e/testcases/key/delete
Package delete provides e2e tests for key deletion.
Package delete provides e2e tests for key deletion.
e2e/testcases/key/export
Package export provides e2e tests for key export functionality.
Package export provides e2e tests for key export functionality.
e2e/testcases/key/list
Package list provides e2e tests for key list functionality.
Package list provides e2e tests for key list functionality.
e2e/testcases/key/transfer
Package transfer provides e2e tests for key transfer operations.
Package transfer provides e2e tests for key transfer operations.
e2e/testcases/lpm
Package lpm provides e2e tests for the Lux Plugin Manager.
Package lpm provides e2e tests for the Lux Plugin Manager.
e2e/testcases/network
Package network provides e2e tests for network operations.
Package network provides e2e tests for network operations.
e2e/testcases/network/stop
Package network provides e2e tests for network stop operations.
Package network provides e2e tests for network stop operations.
e2e/testcases/node/create
Package root provides e2e tests for node creation.
Package root provides e2e tests for node creation.
e2e/testcases/node/devnet
Package root provides e2e tests for devnet node operations.
Package root provides e2e tests for devnet node operations.
e2e/testcases/node/monitoring
Package root provides e2e tests for node monitoring.
Package root provides e2e tests for node monitoring.
e2e/testcases/packageman
Package packageman contains package manager E2E tests.
Package packageman contains package manager E2E tests.
e2e/testcases/root
Package root provides e2e tests for root command functionality.
Package root provides e2e tests for root command functionality.
e2e/testcases/upgrade
Package lpm provides e2e tests for upgrade operations.
Package lpm provides e2e tests for upgrade operations.
e2e/testcases/upgrade/non-sov
Package lpm provides e2e tests for non-sovereign upgrade operations.
Package lpm provides e2e tests for non-sovereign upgrade operations.
e2e/testcases/upgrade/sov
Package lpm provides e2e tests for sovereign upgrade operations.
Package lpm provides e2e tests for sovereign upgrade operations.
e2e/testcases/validatormanager
Package packageman provides e2e tests for validator manager operations.
Package packageman provides e2e tests for validator manager operations.
e2e/utils
Package utils provides utility functions for e2e testing.
Package utils provides utility functions for e2e testing.

Jump to

Keyboard shortcuts

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