Skip to content

feat: allow listing contexts as json/yaml#1352

Merged
phm07 merged 2 commits intomainfrom
context-list-json
Mar 20, 2026
Merged

feat: allow listing contexts as json/yaml#1352
phm07 merged 2 commits intomainfrom
context-list-json

Conversation

@phm07
Copy link
Contributor

@phm07 phm07 commented Mar 5, 2026

Adds -o=json|yaml to context list. This also fixes hcloud context list --quiet outputting nothing at all.

Fixes #1347

@phm07 phm07 self-assigned this Mar 5, 2026
@phm07 phm07 requested a review from a team as a code owner March 5, 2026 14:00
@phm07
Copy link
Contributor Author

phm07 commented Mar 5, 2026

Not sure if we want to expose tokens by default

@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 80.76923% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.59%. Comparing base (1d407d0) to head (cac9104).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
internal/cmd/context/list.go 80.76% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1352      +/-   ##
==========================================
+ Coverage   72.57%   72.59%   +0.02%     
==========================================
  Files         300      300              
  Lines       10989    11028      +39     
==========================================
+ Hits         7975     8006      +31     
- Misses       2125     2130       +5     
- Partials      889      892       +3     
Flag Coverage Δ
e2e 51.44% <7.69%> (-0.05%) ⬇️
unit 67.52% <80.76%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@phm07 phm07 requested a review from apricote March 19, 2026 11:50
@phm07 phm07 merged commit 26e799b into main Mar 20, 2026
7 checks passed
@phm07 phm07 deleted the context-list-json branch March 20, 2026 16:14
phm07 pushed a commit that referenced this pull request Mar 20, 2026
<!-- section-start changelog -->
### Features

- build .deb and .rpm release files (#1311)
- **primary-ip**: new flag to specify assignee-type on primary-ip create
(#1348)
- increase default poll interval for long running actions (#1364)
- **server-type**: add `location` to list table default columns (#1340)
- **server-type**: remove `storage_type` from list table default columns
(#1340)
- allow listing contexts as json/yaml (#1352)
- add --long flag to version command (#1353)

### Bug Fixes

- suppress trailing spaces in tables (#1355)

<!-- section-end changelog -->

---

<details>
<summary><h4>PR by <a
href="https://github.com/apricote/releaser-pleaser">releaser-pleaser</a>
🤖</h4></summary>

If you want to modify the proposed release, add you overrides here. You
can learn more about the options in the docs.

## Release Notes

### Prefix / Start

This will be added to the start of the release notes.

~~~~rp-prefix
~~~~

### Suffix / End

This will be added to the end of the release notes.

~~~~rp-suffix
~~~~

</details>

Co-authored-by: Hetzner Cloud Bot <>
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.

hcloud context: add JSON output

3 participants