Skip to content
KitploitKITPLOIT
ToolsBlog
Log in
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
pyFlipper — Flipper Zero Python CLI Wrapper | Kitploit
Tools/GitHubGitHub/wh00hw/pyflipper
Bluetooth SecurityIoT SecurityRFID/NFC ToolsWireless SecurityHardware HackingPenetration TestingUtilities & FrameworksHardware & IoT SecurityRed Teaming
GitHubwh00hw/pyflipper

pyFlipper

Flipper Zero Python CLI Wrapper

43849222 months agoReviewed by Kitploit

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
View Repository

PyFlipper

Flipper Zero Python CLI Wrapper

Articles

  • How to hack a restaurant

Functions and characteristics:

  • Flipper serial CLI wrapper
  • Websocket client interface
  • Plain TCP interface

What's new (firmware 1.x compatibility)

This release brings the wrapper in line with the current Flipper Zero CLI (validated on real hardware, firmware unlshd-089e):

  • New info module: flipper.info.device_info() / power_info() / power_debug_info() (the modern info device / info power commands).
  • power info → info power: flipper.power.info() keeps working and now reads info power under the hood. Added flipper.power.otg_on()/otg_off().
  • date: use flipper.date.datetime(); parsing was fixed for the current output format.
  • Storage: sizes are parsed as both KB and KiB, read() now returns full multi-line file content, and exFAT / empty-label cards parse correctly (fixes #21).
  • Infrared: the protocol list is read live from the firmware, so NECext, Kaseikyo, RCA, Pioneer, … are supported automatically (fixes #15). New flipper.ir.protocols().
  • debug → sysctl debug, subghz tx/rx gained the required device argument, bt hci_info unchanged.
  • NFC rewritten for the current interactive sub-shell (scan, dump, emulate, field, apdu, raw, mfu) with per-UID Mifare Classic key cache helpers (import_nfc_keys, write_key_cache).
  • Unified serial layer (serial / websocket / TCP) with ANSI-escape handling for the current shell, plus a hardware-free test suite.
  • Removed from stock firmware (kept for custom firmwares that still ship them): ps (→ top), music_player, nfc detect.

Setup instructions:

$ pip install pyflipper

Tested on:

  • Python 3.8.10 on Linux 5.4.0 x86_64
  • Python 3.9.10 on Windows 10
  • Python 3.10.5 on Android 12 (Termux + OTGSerial2WebSocket NO ROOT REQUIRED)
  • Python 3.12 on Linux (firmware unlshd-089e)

Usage/Examples

Connection

from pyflipper import PyFlipper

# Local serial port
flipper = PyFlipper(com="/dev/ttyACM0")

# OR

# Remote serial2websocket server
flipper = PyFlipper(ws="ws://192.168.1.5:1337")

# TCP
flipper = PyFlipper(tcp='192.168.89.222:22170')

Power

# Info (on current firmware this reads `info power` under the hood)
info = flipper.power.info()

# Poweroff
flipper.power.off()

# Reboot
flipper.power.reboot()

# Reboot in DFU mode
flipper.power.reboot2dfu()

# Toggle the 5V OTG pin on the GPIO header
flipper.power.otg_on()
flipper.power.otg_off()

Update/Backup

# Install update from .fuf file
flipper.update.install(fuf_file="/ext/update.fuf")

# Backup Flipper to .tar file
flipper.update.backup(dest_tar_file="/ext/backup.tar")

# Restore Flipper from backup .tar file
flipper.update.restore(bak_tar_file="/ext/backup.tar")

Loader

# List installed apps
apps = flipper.loader.list()

# Open app
flipper.loader.open(app_name="Clock")

Flipper Info

# Get flipper date (datetime object)
date = flipper.date.datetime()

# Get flipper timestamp
timestamp = flipper.date.timestamp()

# Get device info dict (current firmware `info device`, dot-separated keys)
device_info = flipper.info.device_info()

# Get power info dict (current firmware `info power`)
power_info = flipper.info.power_info()

# Extended power/gauge debug info
power_debug = flipper.info.power_debug_info()

# Legacy `device_info` command (underscore-separated keys, still supported)
legacy_info = flipper.device_info.info()

# Get heap info dict
heap = flipper.free.info()

# Get free_blocks string
free_blocks = flipper.free.blocks()

# Get bluetooth info
bt_info = flipper.bt.info()

Firmware compatibility. This library now targets the current Flipper Zero CLI (firmware 1.x, verified against Unleashed unlshd-089e). A few legacy commands were removed from official firmware and are therefore no longer available: ps (replaced by the interactive top), music_player, and nfc detect (NFC is now an interactive sub-shell). power info moved to info power, debug moved to sysctl debug, and storage now reports sizes in KiB — all handled transparently by the wrappers above.

Storage

Filesystem Info

# Get the storage filesystem info
ext_info = flipper.storage.info(fs="/ext")

Explorer

# Get the storage /ext dict
ext_list = flipper.storage.list(path="/ext")

# Get the storage /ext tree dict
ext_tree = flipper.storage.tree(path="/ext")

# Get file info
file_info = flipper.storage.stat(file="/ext/foo/bar.txt")

# Make directory
flipper.storage.mkdir(new_dir="/ext/foo")

Files

# Read file
plain_text = flipper.storage.read(file="/ext/foo/bar.txt")

# Remove file
flipper.storage.remove(file="/ext/foo/bar.txt")

# Copy file
flipper.storage.copy(src="/ext/foo/source.txt", dest="/ext/bar/destination.txt")

# Rename file
flipper.storage.rename(file="/ext/foo/bar.txt", new_file="/ext/foo/rab.txt")

# MD5 Hash file
md5_hash = flipper.storage.md5(file="/ext/foo/bar.txt")

# Write file in one chunk
file = "/ext/bar.txt"

text = """There are many variations of passages of Lorem Ipsum available, 
but the majority have suffered alteration in some form, by injected humour, 
or randomised words which don't look even slightly believable. 
If you are going to use a passage of Lorem Ipsum, 
you need to be sure there isn't anything embarrassing hidden in the middle of text. 
"""

flipper.storage.write.file(path=file, text=text)

# Write file using a listener
file = "/ext/foo.txt"

text_one = """There are many variations of passages of Lorem Ipsum available, 
but the majority have suffered alteration in some form, by injected humour, 
or randomised words which don't look even slightly believable. 
If you are going to use a passage of Lorem Ipsum, 
you need to be sure there isn't anything embarrassing hidden in the middle of text. 
"""

flipper.storage.write.start(file)

time.sleep(2)

flipper.storage.write.send(text_one)

text_two = """All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as 
necessary, making this the first true generator on the Internet.
 It uses a dictionary of over 200 Latin words, combined with a handful of 
 model sentence structures, to generate Lorem Ipsum which looks reasonable. 
The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
"""
flipper.storage.write.send(text_two)

time.sleep(3)

# Don't forget to stop
flipper.storage.write.stop()

LED/Backlight

# Set generic led on (r,b,g,bl)
flipper.led.set(led='r', value=255)

# Set blue led off
flipper.led.blue(value=0)

# Set green led value
flipper.led.green(value=175)

# Set backlight on
flipper.led.backlight_on()

# Set backlight off
flipper.led.backlight_off()

# Turn off led
flipper.led.off()

Vibro

# Set vibro True or False
flipper.vibro.set(True)

# Set vibro on
flipper.vibro.on()

# Set vibro off
flipper.vibro.off()

GPIO

# Set gpio mode: 0 - input, 1 - output
flipper.gpio.mode(pin_name=PIN_NAME, value=1)

# Set gpio pin value: 0 - off, 1 - on
flipper.gpio.set(pin_name=PIN_NAME, value=1)

# Read gpio pin value
flipper.gpio.read(pin_name=PIN_NAME)

MusicPlayer

Download Tool