Skip to content

feat: add api command - #1457

Merged
phm07 merged 7 commits into
mainfrom
api-command
Sep 14, 2026
Merged

phm07 merged 7 commits into
mainfrom
api-command

Conversation

@phm07

@phm07 phm07 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

This PR adds a command that allows users to directly interact with the API.

Closes #1448

@phm07 phm07 self-assigned this Jul 17, 2026
@phm07
phm07 requested a review from a team as a code owner July 17, 2026 09:24
@codecov

codecov Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 17.46032% with 52 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.81%. Comparing base (6f2fcae) to head (d2e8e8b).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
internal/cmd/api/api.go 18.51% 44 Missing ⚠️
internal/hcapi2/client.go 0.00% 4 Missing ⚠️
internal/hcapi2/mock/client.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1457      +/-   ##
==========================================
- Coverage   72.89%   72.81%   -0.08%     
==========================================
  Files         300      301       +1     
  Lines       11127    11143      +16     
==========================================
+ Hits         8111     8114       +3     
- Misses       2118     2135      +17     
+ Partials      898      894       -4     
Flag Coverage Δ
e2e 51.32% <18.64%> (-0.04%) ⬇️
unit 67.69% <17.46%> (-0.08%) ⬇️

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

☔ 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.

Comment thread internal/cmd/api/api.go
Comment thread internal/cmd/api/api.go Outdated
@phm07

phm07 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

We also need to think about how to handle switching between the api.hetzner.cloud and api.hetzner.com endpoints.

@nachtjasmin

Copy link
Copy Markdown
Contributor

A minor user experience nitpick: Right now, the command requires me to prefix all paths with the forward slash /. It'd be nice if this could be added automatically to allow calls like hcloud api fancy_product/123 instead of hcloud api /fancy_product/123. ^^

Comment thread internal/cmd/api/api.go Outdated
Comment thread internal/cmd/api/api.go
Comment thread internal/cmd/api/api.go Outdated

@apricote apricote left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@phm07
phm07 merged commit bd9f704 into main Sep 14, 2026
8 checks passed
@phm07
phm07 deleted the api-command branch September 14, 2026 08:03
@nachtjasmin

Copy link
Copy Markdown
Contributor

it’s merged, yippie! thank you for your work, I really appreciate it! 💜

jooola pushed a commit that referenced this pull request Sep 14, 2026
<!-- section-start changelog -->
### Features

- print deprecated Load Balancer Type information (#1461)
([22a60bc](22a60bc))
- add api command (#1457)
([bd9f704](bd9f704))
- **image**: print deprecated Image information (#1485)
([c7badc0](c7badc0))

### Bug Fixes

- **server**: missing firewalls in describe (#1482)
([93f8381](93f8381))

<!-- 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.

Support generic hcloud api subcommand

4 participants