> For the complete documentation index, see [llms.txt](https://docs.keeper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeper.io/keeperpam/commander-sdk/keeper-commander-sdks/sdk-command-reference/device-commands.md).

# Device Management Commands

Commands related to devices for end-users and Admins

### Overview

This section lists all the commands in Keeper SDKs that are related to managing devices registered to a Keeper account. "Device management commands" in this context are things like listing devices, renaming devices, logging out sessions, and linking/unlinking devices for persistent login. The commands cover viewing, controlling, and securing Keeper sessions across desktops, mobiles, and other clients.

The SDK currently supports these commands.

#### User commands (account scope)

* [Device List](#device-list-command)
* [Device Rename](#device-rename-command)
* [Device Action](/keeperpam/commander-sdk/keeper-commander-sdks/sdk-command-reference/device-commands/device-action-commands.md)
  * Logout
  * Remove
  * Lock
  * Unlock
  * Account lock
  * Account unlock
  * Link
  * Unlink
* [This Device](/keeperpam/commander-sdk/keeper-commander-sdks/sdk-command-reference/miscellaneous-commands/this-device-commands.md)

#### Enterprise admin commands (enterprise scope)

* [Device Admin](/keeperpam/commander-sdk/keeper-commander-sdks/sdk-command-reference/device-commands/device-admin-commands.md)
  * Device admin list
  * Device admin action
  * Logout
  * Remove
* [Device Approve](/keeperpam/commander-sdk/keeper-commander-sdks/sdk-command-reference/enterprise-management-commands/device-approve-commands.md)

Enterprise admins can list devices for enterprise users. They can also log users out or remove selected devices remotely. Device approve supports Cloud SSO device approval workflows.

### Device List

Lists all active devices for the current user.

<details>

<summary>DotNet CLI</summary>

**Command**: `devices`

**SubCommand :** `list`

**Parameters:**

`-f, --force (Default: false)` reload device list

`-l, --link (Default: false)` link device

`--help` Display this help screen.

`--version` Display version information.

`value pos. 0` device command: "approve", "decline", "list"

`value pos. 1` device id or "all" or "clear"

**Example:**

```
My Vault> devices list

  #  Device Name              Client                     ID                    Status  Data Key
---  -----------------------  -------------------------  --------------------  ------  --------
  1  Web Vault Chrome         Web App 17.4.0             <     ID1          >  OK      Yes     
  2  Users_phone              Android 17.3.30            <     ID2          >  OK      Yes     
  5  Browser Extension        Browser Extensions 17.3.2  <     ID3          >  OK      Yes     
  6  OFF                      Commander 17.0.0           <     ID4          >  OK      Yes     
  8  Web Vault Edge           Web App 17.3.3             <     ID5          >  OK      Yes     
  9  Python Keeper API        Commander 17.0.0           <     ID6          >  OK      No      
 10  .NET Keeper API          Commander 17.0.0           <     ID7          >  OK      No      
 14  Web Vault Firefox        Web App 17.4.0             <     ID8          >  OK      Yes     
 15  Firefox,MacIntel         EMConsole 17.6.0           <     ID9          >  OK      No      
 16  PowerShell Commander     Commander 17.0.0           <     ID10         >  OK      Yes     
 17  Commander CLI on macOS   Commander 17.1.9           <     ID11         >  OK      No      
 18  Commander C#             Commander 17.0.0           <     ID12         >  OK      No      
 19  Commander CLI on win32   Commander 17.1.0           <     ID13         >  OK      Yes     
 27  Desktop                  DesktopElectron 17.2.1     <     ID14         >  OK      Yes     
```

</details>

<details>

<summary>DotNet SDK</summary>

Coming Soon

</details>

<details>

<summary>PowerCommander</summary>

Coming Soon

</details>

<details>

<summary>Python CLI</summary>

**Command:** `device-list`

**Syntax:**

```bash
device-list [--format=FORMAT] [--output=FILE]
```

**Parameters:**

* `--format` Output format. Values: `table` or `json`. Default: `table`
* `--output` Output file name. Ignored for `table` format

**Examples:**

```bash
My Vault> device-list
User Devices (3 found)
ID  Device Name      Client Type       Login Status  Last Accessed
1   My iPhone        IOS               LOGGED_IN     2025-01-15 10:30:25
2   Work Laptop      CHROME_EXTENSION  LOGGED_IN     2025-01-15 09:15:42
3   Home Desktop     DESKTOP           LOGGED_OUT    2025-01-14 18:22:15
```

```bash
My Vault> device-list --format=json
{
  "devices": [
    {
      "id": 1,
      "deviceName": "My iPhone",
      "clientType": "IOS",
      "loginStatus": "LOGGED_IN",
      "lastAccessedTimestamp": "2025-01-15 10:30:25"
    },
    {
      "id": 2,
      "deviceName": "Work Laptop",
      "clientType": "CHROME_EXTENSION",
      "loginStatus": "LOGGED_IN",
      "lastAccessedTimestamp": "2025-01-15 09:15:42"
    }
  ]
}
```

```bash
My Vault> device-list --format=json --output=my_devices.json
Results saved to my_devices.json
```

</details>

<details>

<summary>Python SDK</summary>

**Function:** `list_user_devices`

**Example:**

```python
from keepersdk.authentication import device_management

# auth: logged-in KeeperAuth session (after login)
devices = device_management.list_user_devices(auth)

# Each device is a UserDeviceInfo object, sorted by last access (newest first)
for d in devices:
    print(
        d.list_index,      # Device ID from device-list (1, 2, 3...) — use for device-action / device-rename
        d.name,            # Device name (e.g. "MacBook Pro", "iPhone 15")
        d.client_type,     # Client type (e.g. Web Vault, Mobile, Desktop)
        d.login_status,    # Whether the user is currently logged in on this device
        d.last_accessed,   # datetime of last access, or None if unavailable
    )
```

</details>

### Device Rename

Rename your devices to more descriptive names.

<details>

<summary>DotNet CLI</summary>

Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

Coming Soon

</details>

<details>

<summary>PowerCommander</summary>

Coming Soon

</details>

<details>

<summary>Python CLI</summary>

**Command:** `device-rename`

**Syntax:**

```bash
device-rename <Device ID / Device Name> <NEW_NAME>
```

**Parameters:**

* `DEVICE` Device ID such as `1`, `2`, `3`, or a device name
* `NEW_NAME` New name for the device

**Examples:**

```bash
My Vault> device-rename 1 "My New iPhone"
✓ Device name updated from 'My iPhone' to 'My New iPhone'

Updated device list:
User Devices (3 found)
ID  Device Name        Client Type       Login Status  Last Accessed
1   My New iPhone      IOS               LOGGED_IN     2025-01-15 10:40:33
2   Work Laptop        CHROME_EXTENSION  LOGGED_IN     2025-01-15 09:15:42
3   Home Desktop       DESKTOP           LOGGED_OUT    2025-01-14 18:22:15
```

```bash
My Vault> device-rename "Work Laptop" "Updated Work Laptop"
✓ Device name updated from 'Work Laptop' to 'Updated Work Laptop'
```

</details>

<details>

<summary>Python SDK</summary>

**Function:** `rename_user_device`

**Example:**

```python
from keepersdk.authentication import device_management

# auth: logged-in KeeperAuth session (after login)

# Identify the device by list ID (from device-list) or exact device name
device_identifier = '1'          # e.g. ID from list_user_devices
new_device_name = 'Work Laptop'  # new name to assign

# Rename the device; returns (old_name, new_name) on success
old_name, updated_name = device_management.rename_user_device(
    auth,
    device_identifier,
    new_device_name,
)

print(f'Device renamed from "{old_name}" to "{updated_name}"')

# Optional: list devices again to confirm the update
devices = device_management.list_user_devices(auth)
for d in devices:
    print(d.list_index, d.name, d.client_type, d.login_status, d.last_accessed)
```

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.keeper.io/keeperpam/commander-sdk/keeper-commander-sdks/sdk-command-reference/device-commands.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
