.nh .TH "GH-CODESPACE-CP" "1" "Mar 2024" "" "GitHub CLI manual" .SH NAME .PP gh-codespace-cp - Copy files between local and remote file systems .SH SYNOPSIS .PP \fBgh codespace cp [-e] [-r] [-- [...]] ... \fR .SH DESCRIPTION .PP The \fBcp\fR command copies files between the local and remote file systems. .PP As with the UNIX \fBcp\fR command, the first argument specifies the source and the last specifies the destination; additional sources may be specified after the first, if the destination is a directory. .PP The \fB--recursive\fR flag is required if any source is a directory. .PP A \fBremote:\fR prefix on any file name argument indicates that it refers to the file system of the remote (Codespace) machine. It is resolved relative to the home directory of the remote user. .PP By default, remote file names are interpreted literally. With the \fB--expand\fR flag, each such argument is treated in the manner of \fBscp\fR, as a Bash expression to be evaluated on the remote machine, subject to expansion of tildes, braces, globs, environment variables, and backticks. For security, do not use this flag with arguments provided by untrusted users; see \[la]https://lwn.net/Articles/835962/\[ra] for discussion. .PP By default, the \fBcp\fR command will create a public/private ssh key pair to authenticate with the codespace inside the \fB~/.ssh directory\fR\&. .SH OPTIONS .TP \fB-c\fR, \fB--codespace\fR \fB\fR Name of the codespace .TP \fB-e\fR, \fB--expand\fR Expand remote file names on remote shell .TP \fB-p\fR, \fB--profile\fR \fB\fR Name of the SSH profile to use .TP \fB-r\fR, \fB--recursive\fR Recursively copy directories .TP \fB-R\fR, \fB--repo\fR \fB\fR Filter codespace selection by repository name (user/repo) .TP \fB--repo-owner\fR \fB\fR Filter codespace selection by repository owner (username or org) .SH EXAMPLE .EX $ gh codespace cp -e README.md 'remote:/workspaces/$RepositoryName/' $ gh codespace cp -e 'remote:~/*.go' ./gofiles/ $ gh codespace cp -e 'remote:/workspaces/myproj/go.{mod,sum}' ./gofiles/ $ gh codespace cp -e -- -F ~/.ssh/codespaces_config 'remote:~/*.go' ./gofiles/ .EE .SH SEE ALSO .PP \fBgh-codespace(1)\fR