Stash Commands

Stash Commands

The Camber CLI provides several commands to manage your files in Camber Stash. This page covers the most common stash operations: listing, copying, and removing files.

Listing Files and Directories

Use the camber stash ls command to list files and directories in your stash.

When executing the camber stash ls command without any arguments, it will list all files in the base directory your user stash.

To list files in a subdirectory provide the complete path:

camber stash ls stash://your-username/path

You can also list all the files in the directories of a stash location by setting the recursive flag -r.

camber stash ls -r stash://your-username/path

If you have a large number of files or directories in your stash this may take a moment.

Examples

List files in the demos subdirectory in your Stash

camber stash ls stash://your-username/demos

Output:

Name                                     Type                 Size
----                                     ----                 ----
.git                                     directory
10-get-started                           directory
20-tutorials                             directory
30-applications                          directory
.gitignore                               file                 46B
README.md                                file                 118B

Recursively list all files in your stash:

camber stash ls -r stash://your-username/

Team stash listing:

First, to see what Team Stash directories are available to you enter camber me. Then you can use the Stash CLI to view files under a path:

camber stash ls stash://team-name/path

Removing Files and Directories

To remove files or directories from your stash, use the camber stash rm command:

camber stash rm stash://your-username/path

To delete a directory and any files or directories it contains provide the -r flag.

To bypass the confirmation prompt for this action using the -f flag.

⚠️
When removing a directory, you must use the -r flag. The command will fail if you attempt to remove a directory without the recursive flag.

Examples

Remove a file:

camber stash rm stash://your-username/file.txt

Remove a directory and any files and directories it contains:

camber stash rm -r stash://your-username/demos

Remove a directory without confirmation:

camber stash rm -rf stash://your-username/demos
⚠️
Removing files and directories is permanent and cannot be undone. Use this command with caution.

Copying Files and Directories

The camber stash cp command allows you to download, upload, or copy files between Stash locations.

camber stash cp source-path destination-path

Examples

Upload a file README.md in your local directory to the Stash using:

camber stash cp README.md stash://your-username/README.md

Copy a file to a new location:

camber stash cp stash://your-username/demos/README.md stash://your-username/backup/README.md

Copy a directory and all its contents:

camber stash cp stash://your-username/demos/10-get-started/ stash://your-username/archive/10-get-started/

Copy between team stashes:

camber stash cp stash://your-username/project/ stash://team-name/shared-project/