Skip to content

Commit

Permalink
Add example to koyeb cp
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoche committed Feb 22, 2024
1 parent c9cd214 commit b4f8932
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1875,6 +1875,16 @@ Copy files and directories to and from instances.
koyeb instances cp SRC DST [flags]
```

### Examples

```
# To copy the file hello.txt, located in your working directory on your machine to a remote koyeb instance, in the /tmp/ directory
$> koyeb instance cp hello.txt <instance_id>:/tmp/
# To copy the file spreadsheet.csv, located in /tmp/ in your Instance to the local directory on your machine
$> koyeb instance cp <instance_id>:/tmp/spreadsheet.csv .
```

### Options

```
Expand Down
7 changes: 6 additions & 1 deletion pkg/koyeb/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ func NewInstanceCmd() *cobra.Command {
Short: "Copy files and directories to and from instances.",
Aliases: []string{"copy"},
Args: cobra.ExactArgs(2),
RunE: WithCLIContext(instanceHandler.Cp),
Example: `
To copy the file hello.txt, located in your working directory on your machine to a remote koyeb instance, in the /tmp/ directory
$> koyeb instance cp hello.txt <instance_id>:/tmp/
To copy the file spreadsheet.csv, located in /tmp/ in your Instance to the local directory on your machine
$> koyeb instance cp <instance_id>:/tmp/spreadsheet.csv .`,
RunE: WithCLIContext(instanceHandler.Cp),
}
instanceCmd.AddCommand(cpInstanceCmd)

Expand Down

0 comments on commit b4f8932

Please sign in to comment.