All Tools View Categories About Contact Privacy

kubectl cp Command Generator

Build a correct kubectl cp command to copy files between your machine and pods.

Runs entirely in your browser - nothing is uploaded and no cluster connection is made.
Your generated command will appear here.

About kubectl cp Command Generator

Copying files into and out of pods is a frequent troubleshooting task. The kubectl cp Command Generator builds a correct command so you do not mix up the local and pod-side paths.

Enter the source, destination, optional container and namespace, and copy the result. The tool validates that exactly one side references a pod.

Everything runs locally and nothing is uploaded.

Features

  • Pod paths - pod-name:/path form.
  • Container - -c flag.
  • Namespace - -n flag.
  • Context - --context flag.
  • Copy / Download / Print - take the command anywhere.

How to Use

  1. Enter the source (local or pod-name:/path).
  2. Enter the destination.
  3. Watch the preview and export.

Examples

Example 1 - out. kubectl cp my-pod:/tmp/x.log ./x.log.

Example 2 - in. kubectl cp ./conf.yaml my-pod:/app/conf.yaml -c app -n prod.

Benefits

  • Correct syntax - valid kubectl cp.
  • Validated - one pod side required.
  • Flexible - container and namespace.
  • Private - runs in the browser.
  • Copy, download or print - get the command where you need it.

Frequently Asked Questions

What does this tool build?
It assembles a kubectl cp command to copy files or directories between your local machine and a pod.
How is the pod path written?
A pod source or destination uses the form pod-name:/path/inside/container. The container flag (-c) selects a specific container.
Can I copy a whole directory?
Yes. kubectl cp recurses into directories, so a directory path copies its entire contents.
What about namespace and context?
The -n namespace flag and --context flag are added when provided.
Does this connect to a cluster?
No. Everything runs locally; the output is just a command string.
Can I copy or download the command?
Yes. Copy the command, download cp-cmd.sh, or print it.