Folder Commands

This Page shows commands related to folder and their contents

Overview

The page shows folder commands. the currently supported commands are

List Folder Command

This command return information for a given UID. The UID can be for a record, folder, shared folder or a team. The information can be printed as a json or as a list of details

DotNet CLI

Command: ls

Flags:

  • l : details

Example:

My Vault> ls -l
  #  Folder UID              Name                           
---  ----------------------  -------------------------------
  1  folder_uid              Actest/                        
  2  folder_uid              ChecKRustWindows               
  3  folder_uid              Example-shared-folder          
  4  folder_uid              main_credentials_shared_folder 
  5  folder_uid              main_folder_for_init_test      
                      
DotNet SDK

The current implementation of the command in DotNet SDK follows searching of the given UID among different categories

public bool TryGetFolder(string folderUid, out FolderNode node)

then use the node to get subfolders and all their data using

var subFolders = node.Subfolders;

Now the data of these subfolders can be accessed

Power Commander

Command: No Direct command is implemented yet

The following command chain can get similar results

Example:

PS> Get-KeeperLocation
PS> Get-KeeperChildItem

First get current folder location and get child items of the given folder

Python CLI

Command: ls

Options:

  • -l --list Display output in list format

  • -f --folders Display folder names only in output

  • -r --records Display records in output

  • -v --verbose Show verbose output

Example:

My Vault> ls -l
  #  Flags    UID                     Name                                                      Type
---  -------  ----------------------  --------------------------------------------------------  -----------------
  1  f---     folder_uid              User-ks
Python SDK

Function: get_folder

get_folder(self, folder_uid: str) -> Optional[vault_types.Folder]

Example:

 folder = vault.vault_data.get_folder(folder_uid)

Move Folder Command

Moves records or folders from one location to another within the vault.

DotNet CLI

Command: mv

Flag:

  • --link : do not delete source

  • source record or folder (pos. 0) : Required. source record or folder

  • destination folder (pos. 1) : Required. destination folder

Example:

My Vault > mv <source_record/source_folder> <destination_folder>
DotNet SDK

Function:

public async Task MoveFolder(string srcFolderUid, string dstFolderUid, bool link = false)

Arguments :

srcFolderUid - UID of the source folder. this is the folder which will be moved to a different place

dstFolderuid - UID of the folder to whose location the earlier folder will be moved to.

link - this flag when sets to true will not remove the source folder from source and link the new folder at destination to source folder. When this is set to false , the source folder will be moved from source to dest.

Power Commander

Command: Move-RecordToFolder

Aliases: kmv

Flag :

  • -Records : Uid of records

  • -Folder : Folder Uid

  • -Link

Example:

PS > Move-RecordToFolder -Records record_uid -Folder folder_uid
Python CLI

Command: mv

Parameter: required

  • Source pos 0 Required - source folder or record UID or path

  • Destination pos 1 Required - destination folder UID or path

Options:

  • -l, --link Do not delete source

  • -f, --force Do not prompt

  • -R, --recursive Apply search pattern to folders as well

  • -s, --can-reshare {on, off} apply "Can Share" record permission

  • -e, --can-edit {on, off} apply "Can Edit" record permission

Example:

My Vault> mv <source_record/source_folder> <destination_folder>
Python SDK

Function: move_vault_objects

Example:

# here source uids are folder uids 
# paths to the records inside is record_paths
record_management.move_vault_objects(
     context.vault,
     src_objects=itertools.chain(source_uids, record_paths),
     dst_folder_uid=dst_folder.folder_uid,
     is_link=kwargs.get('link') is True,
     can_edit=can_edit, 
     can_share=can_share,
     on_warning=on_warning)

Remove Folder Command

Moves records or folders from one location to another or renames them within the vault.

DotNet CLI

Command: rmdir

Flag:

  • (pos. 0) : folder name or UID. this will be useful for removing folders.

Example:

My Vault> rmdir some_new_folder/
1 Shared Folder(s) will be deleted.
Note: If the last reference to a record is removed, the record can be found in the owner's trash can. If the trash can is then emptied, the record is no longer recoverable.
Type "yes" to confirm, <Enter> to cancel
> yes
DotNet SDK

Function:

public Task DeleteFolder(string folderUid)

Arguments :

folderUid - folder to remove

Power Commander

Command:

PS> Remove-KeeperFolder test_folder_for_delete 

Flags:

Name - Name or UID of folder to delete

Python CLI

Command: rmdir

Parameter:

  • folder Folder path or uid to be deleted (required)

Options:

  • -f --force Skip confirmation prompts

  • -q --quiet Don't display folder info while removing

Example:

My Vault> rmdir deleted_folder

The following folder(s) will be removed:
deleted_folder

1 Personal Folder(s) will be deleted.
Note: If the last reference to a record is removed, the record can be found in the owner's trash can. If the trash can is then emptied, the record is no longer recoverable.
 
Do you want to proceed with the folder deletion? [y/n]: y
Python SDK

Function: delete_vault_objects

 delete_vault_objects(vault: vault_online.VaultOnline,
                         vault_objects: Iterable[Union[str, vault_types.RecordPath]],
                         confirm: Optional[Callable[[str], bool]]=None) -> None:

Example:

 record_management.delete_vault_objects(context.vault, list(folder_uids), delete_confirmation)

Tree Command

Shows a hierarchical tree view of folders and records in the vault, similar to the Unix tree command. Shows the directory structure.

DotNet CLI

Command : tree

Flag :

  • folder (pos. 0) : folder path or UID

Example:

My Vault > tree

My Vault
 +-- New Test Folder
 |   +-- example-normal-folder
 |       +-- test-example-subfolder
DotNet SDK

Function: Not Supported

Power Commander

Command : Coming Soon

Python CLI

Command : tree

Options:

  • -v, --verbose - Prints internal IDs (e.g., folder UIDs) in addition to names.

  • -r, --records - Displays the records contained within each folder.

  • -s, --shares - Shows share permission details for each shared folder.

  • -hk, --hide-shares-key - Hides the share permissions key legend. Valid only when used together with --shares. By default, the key is displayed whenever --shares is enabled.

  • -t, --title - Prints an optional title above the folder structure output.

  • folder - Folder path or UID to display. If omitted, shows the root folder.

Example:

My Vault> tree "Test-normal-folder"
Test-normal-folder
 +-- example-folder
 +-- Shared-Folder-Example [Shared]
 +-- Test PowerCommander Folder [Shared]
Python SDK

Not Supported

Make Directory Command

Creates a new folder within your Keeper vault to help organize records and other folders.

DotNet CLI

Command : mkdir

Flags :

  • folder name : Required. folder name

  • -s, --shared (Default: false) : shared folder

  • --manage-users : default manage users. true or false. By default this is false .

  • --manage-records : default manage records. true or false. By default this is false .

  • --can-share : default can share. true or false. By default this is false .

  • --can-edit : default can edit. true or false. By default this is false .

Example:

My Vault>  mkdir -s "Test-Dotnet-Cli-Folder" --manage-users true  --manage-records true --can-share true  --can-edit true
DotNet SDK

Function:

Task<FolderNode> CreateFolder(string name, string parentFolderUid = null,
            SharedFolderOptions sharedFolderOptions = null);

Flag :

name - Name of the folder which has to be created. This will be title of folder record which is created.

parentFolderUid - UID of parent folder.

SharedFolderOptions:

ManageUsers : default manage users. true or false. By default this is false .

ManageRecords : default manage records. true or false. By default this is false .

CanShare : default can share. true or false. By default this is false .

CanEdit : default can edit. true or false. By default this is false .

Power Commander

Command : Add-KeeperFolder or kmkdir

Flag :

  • -Name : Name of the folder which is to be created

  • -ParentFolderUid : Parent Folder Uid under which current folder is to be created

  • -Shared : whether this will be shared folder or normal folder. this can be set to true if we want shared folder to be created, else we can set it to false.

  • -CanEdit : default can edit. true or false. By default this is false .

  • -CanShare : default can share. true or false. By default this is false .

  • -ManageUsers : default manage users. true or false. By default this is false .

  • -ManageRecords : default manage records. true or false. By default this is false .

Example:

PS > Add-KeeperFolder -Name "Test PowerCommander Folder" -ParentFolderUid folder_uid -Shared -CanEdit -CanShare 

FolderUid     Name            FolderType     ParentUid           SubfolderCount   RecordCount
                                                                                                     t
---------     ----            ----------     ---------           --------------   ----------
Folder UID    Test Folder     SharedFolder   Parent_folder_uid    0               0
Python CLI

Command: : mkdir

Parameters:

  • folder : Name of folder (required)

Options:

  • -sf, --shared-folder : create shared folder

  • -uf, --user-folder : create user folder

  • -a, --all : anyone has all permissions by default

  • -u, --manage-users : anyone can manage users by default

  • -r, --manage-records : anyone can manage records by default

  • -s, --can-share : anyone can share records by default

  • -e, --can-edit : anyone can edit records by default

Example:

My Vault> mkdir -sf "Test-Python-Cli-Folder" -s -e
folder_uid ##Outputs created folder uid
Python SDK

Function: add_folder

add_folder(vault: vault_online.VaultOnline, folder_name: str, is_shared_folder: bool=False,
               parent_uid: Optional[str]=None, manage_records: Optional[bool]=None, manage_users: Optional[bool]=None,
               can_share: Optional[bool]=None, can_edit: Optional[bool]=None)

Example:

folder_uid = folder_management.add_folder(
                context.vault, folder_name, is_shared_folder, base_folder.folder_uid, manage_users, manage_records, can_edit, can_share)

Change Directory Command

Keeper uses directory structure to organize records as records and folders. This command helps navigate keeper folders.

DotNet CLI

Command : cd

Flag :

  • folder destination or Uid

Example:

My Vault> cd Test-Dotnet-Cli-Folder

My Vault/Test-Dotnet-Cli-Folder> 
DotNet SDK

Function : Not Applicable

Example:

  1. Get the folder uid or name from the user.

  2. resolve the path using TryResolvePath function and get the outputted folder if it exists into node variable.

  3. if node variable is not null, then FolderUid of the given node will be your current vault folder

vault.TryResolvePath(name, out var node)
vault.CurrentFolder = node.FolderUid;

Power Commander

Command : Set-KeeperLocation or kcd

Flag :

  • -Path - path to navigate to folder needed. This can be just name.

Example:

PS > Set-KeeperLocation /Test-normal-folder
Python CLI

Command: cd

Parameter:

  • FOLDER Folder path or UID (required)

Example:

My Vault> cd folder_uid
My Vault/Test-Python-Cli-Folder>
Python SDK

Not Supported

Last updated

Was this helpful?