Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(server): add screenshot command#1435

Draft
jooola wants to merge 1 commit into
mainfrom
server-screenshot
Draft

feat(server): add screenshot command#1435
jooola wants to merge 1 commit into
mainfrom
server-screenshot

Conversation

@jooola

@jooola jooola commented Jun 15, 2026

Copy link
Copy Markdown
Member

Adds a new hcloud server screenshot -o screenshot.png <server>, that take a screenshot of the server console using a VNC client.

Fixes #1420

Adds a new `hcloud server screenshot -o screenshot.png <server>`, that take a screenshot of the server console using a VNC client.
@jooola

jooola commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

Still missing from this PR:

  • Finalize the e2e test.
  • Replace slog logger with what the CLI is using.
  • Hide log messages from the go-vnc library.
  • Check if another fork og go-vnc is better that the one from alexnet, I saw other forks being a bit more active.
  • Maybe golang.org/x/net/websocket is not the best library, but it does not add a new dependency. Check if this is important.

@jooola jooola self-assigned this Jun 15, 2026
@jooola jooola requested review from apricote and phm07 June 15, 2026 13:28
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 10.47619% with 94 lines in your changes missing coverage. Please review.
βœ… Project coverage is 72.21%. Comparing base (f37b5fa) to head (885dcb8).

Files with missing lines Patch % Lines
internal/cmd/server/screenshot/screenshot.go 0.00% 78 Missing ⚠️
internal/cmd/server/screenshot.go 38.46% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1435      +/-   ##
==========================================
- Coverage   72.80%   72.21%   -0.59%     
==========================================
  Files         300      302       +2     
  Lines       11104    11209     +105     
==========================================
+ Hits         8084     8095      +11     
- Misses       2120     2214      +94     
  Partials      900      900              
Flag Coverage Ξ”
e2e 50.86% <10.47%> (-0.40%) ⬇️
unit 67.20% <10.47%> (-0.54%) ⬇️

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.

* [hcloud server request-console](hcloud_server_request-console.md) - Request a WebSocket VNC console for a Server
* [hcloud server reset](hcloud_server_reset.md) - Reset a Server
* [hcloud server reset-password](hcloud_server_reset-password.md) - Reset the root password of a Server
* [hcloud server screenshot](hcloud_server_screenshot.md) - Take a screenshot of the Server VNC console

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.

I would prefer to mark this new command as experimental initially.

@apricote

apricote commented Jun 15, 2026

Copy link
Copy Markdown
Member

Would be awesome if users could directly show it in their terminal.

For example with the Kitty graphics protocol I can run this right now to render the image in the terminal (Ghostty):

hcloud server screenshot <name>
viu screenshot.png

If -o - would mean stdout:

hcloud server screenshot <name> -o - | viu -

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.

Add a server-side console screenshot endpoint / hcloud server screenshot (PNG of the VGA console, no interactive VNC session)

2 participants