Skip to content
↗ Astrona.io Cloud Native learning, open to everyone.

Astrona resource

astrona resource

Show, copy or run the files a lab ships for you (its resources)

Synopsis

A lab can ship files you need — a setup script, a YAML file to fix, a small program — in its resources/ folder instead of asking you to paste them from the docs. astrona run copies them to ~/.astrona/resources/ and lists them; nothing runs until you ask.

Inside the lab terminal, ~/resources contains your editable copy and astrona res works there too. Full filenames such as count-versions.sh and existing short names both work. Opening more tabs preserves edits; full reset restores originals.

astrona res list the lab's resources astrona res show print one (a folder: its files) astrona res copy [dest] copy it here (or to dest) to edit astrona res path print its path, for $(…) in your own commands astrona res run [args…] run it

Which lab: --lab, else $ASTRONA_LAB if set in your host terminal, else the lab of -c/--git, else the one picked with astrona use, else the only lab with resources. With several labs open in several terminals, run astrona shell <lab> in each and every astrona res there works on that lab.

How run runs one: its run command from the lab (in its folder), .sh with bash, .yaml with kubectl apply -f, an executable with #! directly — in a kind lab always with execution inside the isolated terminal by default. --host explicitly runs on your machine using host tools. KUBECONFIG set to the lab's own kubeconfig, so nothing reaches your other clusters ($ASTRONA_LAB and $ASTRONA_RESOURCE_DIR are set). In a qemu lab it's copied into the VM (~/resources) and run there as the account astrona ssh uses; --vm picks the VM of a multi-VM lab. A plain file can only be shown or copied.

astrona resource [flags]

Examples

  astrona res
  astrona res run setup-db
  astrona res copy broken-deployment
  kubectl diff -f $(astrona res path broken-deployment)
  astrona res run load-test --lab ats-014-lab-010-01 -- --rps 50

Options

  -h, --help              help for resource
      --lab astrona use   The lab whose resources to use (default: $ASTRONA_LAB, -c/--git, astrona use, else the only lab with resources)
  -o, --output string     Output format: json

Options inherited from parent commands

      --accept-terms      Accept this CLI's usage terms and data-loss risk notice; required on each operational CI command (read: astrona terms)
  -c, --config string     Path or URL to the lab config directory (with --git: a subdirectory within the cloned repo) (default ".")
  -f, --file string       Configuration file name override (default "config.yaml")
      --git string        Git repository URL to clone/pull (https://, git@host:, or ssh://) — --config then selects a subdirectory within it
      --git-ref string    Git branch, tag, or commit to check out (used with --git; default: the repo's default branch)
      --headless          Disable the terminal UI and CLI prompts; run/reset skip login reminders and new account sessions
      --install-version   If the lab needs another astrona release (astronaVersion) that isn't installed, install it without asking — for CI
      --trust             Approve running a remote (--git / URL) lab without asking — for CI; review the lab first
      --update-check      Check for new CLI releases (disabled in CI, without a terminal, or by ASTRONA_NO_UPDATE_CHECK) (default true)
      --verbose           Stream the full output of every underlying command instead of the compact step view

SEE ALSO

Auto generated by spf13/cobra on 20-Oct-2026