Skip to content

StevenFAU/FlipperCLI

Repository files navigation

FlipperCLI

Python toolkit for communicating with a Flipper Zero over its USB serial CLI interface.

Setup

git clone [email protected]:StevenFAU/FlipperCLI.git
cd FlipperCLI
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

Make sure your user can access serial devices:

sudo usermod -aG dialout $USER
# Log out and back in, or: newgrp dialout

Quick Start

The Flipper is auto-detected by USB VID/PID — no need to specify a port manually. If auto-detection fails, pass the port directly: python flipper_repl.py /dev/ttyACM1

Run the connection test:

python test_connection.py

Launch the interactive REPL:

python flipper_repl.py

Usage

As a library

from flipper_serial import FlipperSerial
from flipper_commands import FlipperCommands

with FlipperSerial() as f:
    cmd = FlipperCommands(f)

    info = cmd.device_info()
    print(info["hardware_name"], info["firmware_version"])

    # List SD card contents
    for entry in cmd.storage_list("/ext"):
        print(entry["name"], entry["type"])

    # Read a file
    content = cmd.storage_read("/ext/subghz/signal.sub")

    # Write a file
    cmd.storage_write("/ext/test.txt", "Hello Flipper!")

    # LED and vibro
    cmd.led("g", 255)
    cmd.vibro(True)

Interactive REPL

flipper> device_info
flipper> storage list /ext/subghz
flipper> !download /ext/subghz/signal.sub ./signal.sub
flipper> !download --binary /ext/apps/mygame.fap ./mygame.fap
flipper> !upload ./local_file.sub /ext/subghz/uploaded.sub
flipper> !capture subghz 433920000 10
flipper> !tree /ext
flipper> !help
flipper> !quit

Tab completion is available for ! commands and common Flipper paths.

Bulk Operations

# Download all Sub-GHz captures
python flipper_bulk.py subghz

# Download all NFC dumps
python flipper_bulk.py nfc

# Download all IR libraries
python flipper_bulk.py ir

# Full SD card backup
python flipper_bulk.py backup

Files are saved to dumps/<timestamp>/<type>/.

Serial Details

  • Device: Auto-detected by USB VID/PID (0483:5740), falls back to /dev/ttyACM0
  • Baud rate: 230400
  • Prompt: >: (configurable for custom firmware like Momentum)
  • Protocol: UTF-8 text commands terminated with \r\n

Close qFlipper before using this toolkit — only one application can hold the serial port at a time.

Project Structure

flipper_serial.py      — Core serial connection class
flipper_commands.py    — High-level command wrappers
flipper_repl.py        — Interactive REPL
flipper_bulk.py        — Bulk download/backup utilities
test_connection.py     — Basic connectivity test

About

Flipper Zero CLI

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages