Skip to content

tui: ask for the provider when neither -p nor ONCTL_CLOUD is set - #1261

Merged
cdalar merged 1 commit into
mainfrom
boxctl/silly-beetle-df10
Oct 27, 2026
Merged

cdalar merged 1 commit into
mainfrom
boxctl/silly-beetle-df10

Conversation

@cdalar

@cdalar cdalar commented Oct 27, 2026

Copy link
Copy Markdown
Owner

onctl tui with no -p and no ONCTL_CLOUD now starts by asking which provider to work on. Each line shows the short name, the full name, and where the machines run:

aws      Amazon Web Services       cloud, BYO account
hetzner  Hetzner Cloud             cloud, BYO account
azure    Microsoft Azure           cloud, BYO account
gcp      Google Cloud              cloud, BYO account
ovh      OVHcloud                  cloud, BYO account
fc       Firecracker microVM       local
ch       Cloud Hypervisor microVM  local
ac       Apple Container           local
static   Static host (onctl.yaml)  remote, BYO host
boxes    Boxes service             cloud, SaaS
  • The choice is applied like -p <name>, so loading the config and starting the provider work as before. If stdin isn't a terminal there's no prompt and the old behaviour applies.
  • providerPlaces gets a title (the provider's own name) and a new placeSaaS kind for boxes. providerWhere still says "on the boxes service".
  • Behaviour change: before, the tui guessed the provider from the credentials in the environment (e.g. HCLOUD_TOKEN meant hetzner). Now it asks. Other commands are unchanged.

Testing

  • TestTUIProviderChoices checks that every provider has a full name in the list and that each kind gets the right label.
  • go vet ./cmd passes. go test ./cmd passes except TestPopulateOnctlEnv_ErrorWritingFile, which also fails on main when run as root (the sandbox this was tested in runs as root).
  • Not tried by hand in a real terminal.

🤖 Generated with Claude Code

onctl tui starts with a list of the providers, each with its full name
and where it runs (local, cloud with your own account, cloud SaaS, or a
host you bring), instead of guessing one from the credentials in the
environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 47.82609% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.99%. Comparing base (e06bcd5) to head (07a6acc).

Files with missing lines Patch % Lines
cmd/tui.go 38.46% 8 Missing ⚠️
cmd/root.go 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1261      +/-   ##
==========================================
- Coverage   47.99%   47.99%   -0.01%     
==========================================
  Files          81       81              
  Lines        9401     9424      +23     
==========================================
+ Hits         4512     4523      +11     
- Misses       4889     4901      +12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cdalar
cdalar merged commit 423056a into main Oct 27, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 换网址