Summary
Enable copying files between a container and the host filesystem from within the Files panel, equivalent to docker cp.
Current State
- The Files panel (
internal/ui/sections/containers/panel/filetree_panel.go) shows the container filesystem as a browsable tree
- Files can be browsed but not copied to/from the host
Implementation Steps
1. Add client interface methods
In internal/client/client.go, add to ContainerService:
CopyFromContainer(ctx context.Context, containerID, srcPath string) (io.ReadCloser, error)
CopyToContainer(ctx context.Context, containerID, dstPath string, content io.Reader) error
2. Implement in Docker client
Use client.CopyFromContainer and client.CopyToContainer. The Docker API returns/accepts a tar stream.
3. Copy from container to host
- Add key binding (e.g.
c) in the Files panel when a file is highlighted
- Prompt user for destination path on the host (default: current working directory)
- Extract the tar stream to the destination
- Show success/error banner with the file path written
4. Copy from host to container
- Add key binding (e.g.
u for upload) in the Files panel
- Prompt user for the source file path on the host
- Prompt for destination directory in the container (default: current directory in tree)
- Tar the file and send via
CopyToContainer
- Refresh the file tree after upload
5. Progress indicator
Show a spinner with filename during copy operations.
Acceptance Criteria
Summary
Enable copying files between a container and the host filesystem from within the Files panel, equivalent to
docker cp.Current State
internal/ui/sections/containers/panel/filetree_panel.go) shows the container filesystem as a browsable treeImplementation Steps
1. Add client interface methods
In
internal/client/client.go, add toContainerService:2. Implement in Docker client
Use
client.CopyFromContainerandclient.CopyToContainer. The Docker API returns/accepts a tar stream.3. Copy from container to host
c) in the Files panel when a file is highlighted4. Copy from host to container
ufor upload) in the Files panelCopyToContainer5. Progress indicator
Show a spinner with filename during copy operations.
Acceptance Criteria
con a selected file copies it to a host directoryuuploads a host file to the current container directory