Skip to content

Sandbox CLI commands #780

@mathiasbourgoin

Description

@mathiasbourgoin

Summary

CLI interface for sandbox management: create, list, status, start, stop, destroy, add-account.

Blocked by: #779 (sandbox orchestration library)

Changes

CLI command group

  • File: src/cli/cmd_sandbox.ml
  • Follows Cmdliner pattern from src/cli/cmd_rpc.ml (Cmd.group with subcommands)

Subcommands

octez-manager sandbox create  --network NET [--snapshot URI] [--name NAME]
                              [--rpc-addr ADDR] [--max-delegates N]
octez-manager sandbox list
octez-manager sandbox status  NAME
octez-manager sandbox start   NAME
octez-manager sandbox stop    NAME
octez-manager sandbox destroy NAME
octez-manager sandbox add-account NAME ADDRESS
  • create: calls Sandbox.create with step-by-step progress output to stdout
  • list: calls Group_registry.list_sandboxes, formats as table (name, network, node/baker status, head level)
  • status: calls Sandbox.status, prints detailed info including delegates and wallet path
  • start/stop: delegates to Lifecycle.start_group / stop_group
  • destroy: confirmation prompt (Continue? [y/N]), then Sandbox.destroy
  • add-account: calls Yes_wallet.add_account, prints result

Example output (create)

$ octez-manager sandbox create --network mainnet --snapshot ./mainnet.rolling

Creating sandbox "sandbox-mainnet"...

  [1/6] Creating group "sandbox-mainnet"              ✓
  [2/6] Installing node (importing snapshot)...        ✓  sandbox-mainnet-node
  [3/6] Enabling yes_crypto environment                ✓
  [4/6] Starting node and waiting for RPC...           ✓  head: 7,234,567
  [5/6] Generating yes-wallet (20 delegates)...        ✓
  [6/6] Installing and starting baker                  ✓  sandbox-mainnet-baker

Sandbox "sandbox-mainnet" is ready!

  Node RPC:    http://127.0.0.1:8732
  Network:     mainnet (isolated, no peers)
  Delegates:   20 (top by staking power)
  Yes-crypto:  enabled

Registration

  • Register Cmd_sandbox.sandbox_cmd in src/main.ml command group (~line 85-108)
  • File: src/cli/dune — add octez_manager_sandbox dependency

Shell completions

  • Run make completions after adding the new subcommands

Verification

  • dune build && dune fmt
  • All subcommands show help text (--help)
  • Shell completions are up to date

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsandboxSandbox mode: isolated chain with yes_crypto

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions