# Shared Folder Commands

## Overview

This page catalogs and provides detailed information about shared folders lists and teams.

1. [List-Share-Folder](#list-share-folder)
2. [Share Folder - Change Record Permissions Command](#share-folder-change-record-permissions-command)

## Command

### List Share Folder Command

Lists the shared folders within a specified folder or the current directory in your Keeper vault.

<details>

<summary>DotNet CLI</summary>

**Command:** `sf-list`

**Example:**

```bash
My Vault> sf-list
  #  Shared Folder UID       Name                             # Records  # Users
---  ----------------------  -------------------------------  ---------  -------
  1  shared_folder_uid       Test-Shared-Folder                11         1      
```

</details>

<details>

<summary>DotNet SDK</summary>

**Function:**

```csharp
var sharedFolders = vault.SharedFolders;
```

</details>

<details>

<summary>Power Commander</summary>

**Command:** `Get-KeeperSharedFolder`

**Flag:**

* `-Uid` : Uid of the Shared Folder
* `-Filter` : Used to filter the shared folders.

**Example:**

```powershell
PS> Get-KeeperSharedFolder

Uid                    Name                            DefaultManageRecords DefaultManageUsers DefaultCanEdit DefaultCanShare UserCount RecordCount
---                    ----                            -------------------- ------------------ -------------- --------------- --------- -----------
shared_folder_uid      example_new_shared_folder       True                 True               True           True                    1           1
```

</details>

<details>

<summary>Python CLI</summary>

**Command:** `list-sf`

**Options:**

* `pattern` : Pattern of the title or UID of the shared folder.
* `-h, --help` : show this help message and exit
* `--format` : Specifies the output format of the `list-sf` command. The available options are:
  * ***table:*** The Output will be displayed in table format. By default, the output will be in table format.
    * Example: `--format table`
  * ***csv:*** The Output will be displayed in csv format.
    * Example: `--format csv`
  * ***json*****&#x20;:** The Output will be displayed in json format.
    * Example: `--format json`
* `--output` : Users can use this flag to store the output in a file. This flag should not be used when the output format is set to table (`--format table`).
  * Example: `--output <file_name>`
* `--verbose, -v` : verbose output

**Example:**

```
My Vault> list-sf
  #  Shared Folder UID       Name
---  ----------------------  -----------------------------------------
  1  shared_folder_uid       Test Example Folder
```

</details>

<details>

<summary>Python SDK</summary>

**Function:** `find_shared_folders`

```python
find_shared_folders(self, criteria: str) -> Iterable[vault_types.SharedFolderInfo]
```

**Example:**

```python
shared_folders = vault.vault_data.find_shared_folders(criteria=pattern)
```

</details>

### Shared Folder - Change Record Permissions Command

Allows users to change the permissions of records within a shared folder. Users can add or revoke permissions for individual records as needed.

<details>

<summary>DotNet CLI</summary>

**Command:** `sf-record`

**Flag:**

* `-r, --record` : The record name or record UID of the item that needs to be shared within the shared folder.
* `-s, --can-share` : A Boolean value (`true` or `false`). If `true`, the user has share permission. If `false`, the edit permission will be removed.
* `-e, --can-edit` : A Boolean value (`true` or `false`). If `true`, the user has edit permission. If `false`, the edit permission will be removed.
* `--expire-at` : Expire share at ISO time: YYYY-MM-DD HH:mm:SS
* `--expire-in` : Expire share in period: \[N]mi|h|d|mo (Minutes / hours / days / months)
* `--help` : Display this help screen.
* `--version` : Display version information.
* `folder name (pos. 0)` : Required. folder name

**Example:**

```bash
My Vault> sf-record record_uid
  #  Record Title   Record UID              Can Edit  Can Share  Expiration
---  -------------  ----------------------  --------  ---------  ----------
  1  ABC            record_uid              X         X
  2  Gmail Account  record_uid              X         X
  3  Gmail Account  record_uid              X         X

My Vault> sf-record folder_uid --record=record_uid --expire-in=30mi

My Vault> sf-record BRvqCEzmFM9rVqkmpeGs6A
  #  Record Title   Record UID              Can Edit  Can Share  Expiration
---  -------------  ----------------------  --------  ---------  ----------------
  1  ABC            record_uid              X         X          03-11-2025 18:08
  2  Gmail Account  record_uid              X         X
  3  Gmail Account  record_uid              X         X
```

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** `ChangeRecordInSharedFolder`

```csharp
public async Task ChangeRecordInSharedFolder(string sharedFolderUid, string recordUid, IRecordShareOptions options)
```

**Example:**

```csharp
await context.Vault.ChangeRecordInSharedFolder(sf.Uid, recordUid, shareOptions);
```

</details>

<details>

<summary>Power Commander</summary>

**Command** : Coming Soon

</details>

<details>

<summary>Python CLI</summary>

**Command**: `record-permission`

**Parameters**:

* `-a`, `--action` Grant or Revoke (required)
* `folder` Shared folder uid to which the changes need to be applied (required)

**Options**:

* `--dry-run` Display the permissions changes without committing them
* `--force` Apply permission changes without any confirmation
* `-R`, `--recursive` Apply permission changes to all sub-folders
* `--share-record` Change a records sharing permissions
* `--share-folder` Change a folders sharing permissions
* `-s`, `--can-share` Set record permission: can be shared
* `-d`, `--can-edit` Set record permission: can be edited
  * **--can-edit or --can-share is required**
* **Example:**

```sh
My Vault> record-permission -a grant --share-record -s -d shared_folder_uid

Request to GRANT "Can Edit" & "Can Share" permission(s) in "my_share" folder only
```

</details>

<details>

<summary>Python SDK</summary>

**Command** :

```python
from keepersdk.vault import share_management_utils
​
result = share_management_utils.update_record_permissions(
            vault=vault,
            action=action,
            can_share=can_share,
            can_edit=can_edit,
            folder_uid_or_path=folder_uid_or_path,
            recursive=recursive,
            share_record=share_record,
            share_folder=share_folder,
            dry_run=dry_run,
            sync_after=sync_after,
        )
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keeper.io/keeperpam/commander-sdk/keeper-commander-sdks/sdk-command-reference/sharing-commands/shared-folder-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
