LinuxCommandLibrary

kdeconnect-cli

Communicate with connected devices using KDE Connect

TLDR

List all devices

$ kdeconnect-cli --list-devices
copy

List available (paired and reachable) devices
$ kdeconnect-cli --list-available
copy

Request pairing with a specific device, specifying its ID
$ kdeconnect-cli --pair --device [device_id]
copy

Ring a device, specifying its name
$ kdeconnect-cli --ring --name "[device_name]"
copy

Share an URL or file with a paired device, specifying its ID
$ kdeconnect-cli --share [url|path/to/file] --device [device_id]
copy

Send an SMS with an optional attachment to a specific number
$ kdeconnect-cli --name "[device_name]" --send-sms "[message]" --destination [phone_number] --attachment [path/to/file]
copy

Unlock a specific device
$ kdeconnect-cli --name "[device_name]" --unlock
copy

Simulate a key press on a specific device
$ kdeconnect-cli --name "[device_name]" --send-keys [key]
copy

SYNOPSIS

kdeconnect-cli [OPTIONS] [COMMAND]

PARAMETERS

-a, --available
    List available devices.

-d, --device
    Specify a device ID to operate on. If not specified, will try to use first available device.

-n, --name
    Set the device name (only affects pairing).

-l, --list-commands
    List available commands for the device.

--ping
    Send a ping to the device.

--pair
    Request pairing with the device.

--unpair
    Request unpairing with the device.

--send-sms
    Send an SMS message.

--send-notification
    Send a notification to the device.

--share
    Share file to device. This requires an absolute path.

--battery-level
    Get the battery level of the device.

--find-my-phone
    Ring the device.

--current-track
    Get information about the current track playing on the device.

--next
    Skip to the next track.

--previous
    Go to the previous track.

--pause
    Pause the current track.

--play
    Play the current track.

-v, --version
    Show program's version number and exit

-h, --help
    Show help message and exit

DESCRIPTION

kdeconnect-cli is a command-line tool that allows users to interact with the KDE Connect service. It provides a way to send commands, access device information, and manage connected devices from the terminal.
This tool is particularly useful for scripting and automation, allowing you to control your devices from the command line. kdeconnect-cli can be used to send SMS messages, trigger device actions like ringing or pausing media playback, and retrieve battery status or other device information. It provides a flexible and powerful interface for interacting with KDE Connect's features without a graphical user interface.
The availability of functionality depend on the connected device and the supported features for that device.

DEVICE IDENTIFICATION

The --device option requires a device ID. Use kdeconnect-cli -a to list available devices and their corresponding IDs.

SERVICE AVAILABILITY

Ensure that KDE Connect is running on both the local machine and the remote device for kdeconnect-cli to function correctly.

SEE ALSO

kdeconnectd(1)

Copied to clipboard