security enabled verified medium v1.0.0

bluetoothctl

Command-line Bluetooth controller for device scanning, pairing, and management via BlueZ.

📋 Live Preview
bluetoothctl
bluetoothctl

Sandbox: execFile · Timeout: 3600s

Capabilities

bluetooth.scan
bluetooth.pair
bluetooth.discover
bluetooth.manage

Parameters

Name Type Required Default Description Aliases
scan boolean No - Scan for Bluetooth devices scan, --scan
advertise boolean No - Enable advertising advertise, --advertise
discoverable boolean No - Make adapter discoverable discoverable, --discoverable
pairable boolean No - Make adapter pairable pairable, --pairable
power string No - Power control (on/off) power, --power
agent string No - Register agent type agent, --agent
default-agent boolean No - Set as default agent default-agent, --default-agent
pair string No - Pair with device by MAC pair, --pair
trust string No - Trust device by MAC trust, --trust
connect string No - Connect to device by MAC connect, --connect
info string No - Show device info by MAC info, --info
list boolean No - List available adapters --list
show boolean No - Show adapter info --show
version boolean No - Show version --version

Artifacts

TypeDescriptionMIMESchemaTrust
bluetooth.device.listList of discovered Bluetooth devicestext/plain-verified
bluetooth.device.infoDetailed device informationtext/plain-verified

Contract

Inputs

bluetooth.adapter

Bluetooth adapter index

Outputs

bluetooth.device.list

Discovered Bluetooth devices

bluetooth.device.info

Detailed device attribute information

Side effects: network_trafficnetwork_traffic

Workflow Edges

Produces

bluetooth.device.listbluetooth.device.info

Consumes

bluetooth.adapter

Resource Profile

ResourceValue
CPUlow
Memory16 MB
Networknone
Disk I/Olow

Examples

Start interactive bluetoothctl session

bluetoothctl

Enable scanning and power on

echo -e "power on\nscan on" | bluetoothctl

List paired devices

bluetoothctl devices

Show adapter information

bluetoothctl show

Pair with a device

echo -e "pair AA:BB:CC:DD:EE:FF\nconnect AA:BB:CC:DD:EE:FF" | bluetoothctl

Trust and connect

echo -e "trust AA:BB:CC:DD:EE:FF\nconnect AA:BB:CC:DD:EE:FF" | bluetoothctl

Show device information

bluetoothctl info AA:BB:CC:DD:EE:FF

Register agent and make pairable

echo -e "agent on\ndefault-agent\npairable on" | bluetoothctl

Documentation

bluetoothctl — Bluetooth Device Controller

bluetoothctl is the primary command-line interface for BlueZ, the official Linux Bluetooth protocol stack. It provides interactive and non-interactive control over Bluetooth adapters and devices.

Common Commands

Command Description
scan on/off Enable/disable device discovery
pair <mac> Pair with a Bluetooth device
connect <mac> Connect to a paired device
trust <mac> Mark device as trusted
info <mac> Show detailed device information
devices List all known devices
show Show adapter information

Related Tools

btlejackhcitoolgatttool

References