Skip to content

Commit 6da512e

Browse files
committed
feat: add cp command for file copy operations
Add 'hypeman cp' command for copying files to/from running instances, with docker cp compatible semantics: Features: - Copy files and directories to instances: hypeman cp file.txt instance:/path - Copy from instances: hypeman cp instance:/path file.txt - STDIN/STDOUT streaming with '-' argument for tar archives - Recursive directory copying with proper tar packing/unpacking - Symlink handling with --follow-links flag - Archive mode (-a) to preserve UID/GID ownership - Quiet mode (-q) to suppress progress output - Docker cp path resolution semantics: - SRC_PATH/. copies contents, not the directory itself - Trailing slash handling for directory vs file detection The command communicates with the API server via WebSocket, streaming file data as binary chunks with JSON metadata headers.
1 parent 1661f08 commit 6da512e

File tree

4 files changed

+992
-3
lines changed

4 files changed

+992
-3
lines changed

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/gorilla/websocket v1.5.3
1313
github.com/itchyny/json2yaml v0.1.4
1414
github.com/muesli/reflow v0.3.0
15-
github.com/onkernel/hypeman-go v0.7.0
15+
github.com/onkernel/hypeman-go v0.7.1-0.20251223043134-e172b69eca2b
1616
github.com/tidwall/gjson v1.18.0
1717
github.com/tidwall/pretty v1.2.1
1818
github.com/urfave/cli-docs/v3 v3.0.0-alpha6
@@ -74,3 +74,5 @@ require (
7474
google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 // indirect
7575
google.golang.org/grpc v1.75.1 // indirect
7676
)
77+
78+
replace github.com/onkernel/hypeman-go => ../hypeman-go

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
105105
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
106106
github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc=
107107
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
108-
github.com/onkernel/hypeman-go v0.7.0 h1:KUeY4VGJtStA4+zkPtx7eDCO3rSznbIVoj4U6l+g50Q=
109-
github.com/onkernel/hypeman-go v0.7.0/go.mod h1:BPT1yh0gbby1E+As/xLM3GVjw7752+2C5SaEiJV9rRc=
110108
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
111109
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
112110
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=

pkg/cmd/cmd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ func init() {
6868
},
6969
Commands: []*cli.Command{
7070
&execCmd,
71+
&cpCmd,
7172
&pullCmd,
7273
&pushCmd,
7374
&runCmd,

0 commit comments

Comments
 (0)