fbx, une CLI pour ta Freebox
An unofficial, full-coverage command line into a Freebox OS router's panel API.
The web panel is just a JavaScript client over a REST API, and fbx is the
missing terminal client for that dialect.
$ fbx version
api_version 12.0
device_name Freebox Server
box_model fbxgw8-r1
firmware_version 4.8.6
api_base_url /api/
$ fbx wan
wan: up (ftth / ftth / mode router)
ipv4: 82.64.1.2 ipv6: 2a01:e0a:0:1::1
rate_down 1.0 MiB/s / bw_down 953.7 MiB/s
rate_up 4.0 KiB/s / bw_up 476.8 MiB/s
$ fbx status
enabled True
state up
$ fbx fw samba show
enabled True
state up
Install
pipx install git+https://git.nech.pl/pln/fbx.git # or the mirror below
pipx install git+https://github.com/plnech/fbx.git
From a clone, poetry does it all (venv + the fbx entry point):
git clone https://git.nech.pl/pln/fbx && cd fbx && poetry install
No install? python -m fbx_cli.cli works from the repo root.
Quickstart (under a minute)
fbx version # reachability check, no login needed
fbx login # panel-dialect auth (1Password or --stdin; never argv)
fbx wan # live WAN state and rates
fbx tldr # ten more copy-pasteable examples
What it is
The Freebox panel speaks its own dialect (different paths, form posts, a
challenge-based login) that is documented nowhere and is not the well-known
developer API. fbx transcribes that dialect once (clean-room, from the
panel's own publicly-served JavaScript, see docs/api/) and
drives 15 domains, 183 endpoint records, 292 operations through one
generic engine. Everything the panel can see, so does your shell.
- Grammar, not GUI:
fbx <domain> <thing> to read, add/set/rm
where documented, body fields as auto-typed key=value pairs.
- Destructive ops are gated: storage format/fsck, raid member ops, fs
rm/mv, reboot/shutdown, token revocation all refuse to run without
--yes.
- Escape hatch:
fbx api GET|POST <path> [body] reaches anything the
generated commands miss.
- Global flags anywhere on the line:
--json (raw envelope),
--debug (method+path+status, never bodies), --yes.
Auth, in one paragraph
fbx mirrors the panel exactly: GET login/ returns a password salt and a
challenge: a table of 32 obfuscated JavaScript snippets the panel
eval()s one per character. fbx runs the box's own snippets through a
one-shot node subprocess, computes
HMAC-SHA1(key=SHA1(salt+password), msg=challenge), posts it form-encoded,
and stores the session cookie chmod 600 under `/.config/freebox/session/ (never printed). One automatic re-authentication on auth errors. The password comes from 1Password (op read: the item named by the FREEBOX_OP_REFenv var, a one-line~/.config/freebox/opreffile, or the default item) or fromfbx login --stdin; never argv, never disk. You need node` installed.
Domains
| Domain |
Records |
What's inside |
wifi |
20 |
state/config, ap, bss, stations, mlo, mac-filter, guest keys, wps, steering |
downloads |
18 |
task queue, add, trackers, peers, files, blacklist, throttling, rss, docs |
tv |
17 |
channels, bouquets, epg, pvr, dvb, docs |
connection |
16 |
WAN state, xdsl/lte, ipv6, ddns, logs, rrd graphs, docs |
storage |
16 |
disks, partitions, raid, fsck, internal storage, docs |
fs |
15 |
ls, cp/mv/rm, extract/archive, tasks, share links, binary get/put, docs |
fw |
15 |
incoming, port redir, dmz, upnp, netshare (samba/afp), ftp, tftp, parental, docs |
lan |
14 |
config, devices, hosts, wol, routes, dhcp, dhcpv6, switch, freeplug, docs |
contacts |
13 |
entries, numbers/emails/addresses, groups, vCard import/export, docs |
system |
10 |
health, reboot/shutdown, standby, lcd, ledstrip, sfp, licenses, docs |
vpn |
10 |
servers, ip pool, users, live connections, vpn client, docs |
phone |
9 |
hardware, sip, dect, paging, call log, docs |
accounts |
4 |
profiles, groups, notification targets, docs |
auth |
3 |
sessions, permissions, app tokens, docs |
airmedia |
3 |
config, receivers, cast, docs |
Command wiki
Every command has a generated reference page under
docs/cmd/: synopsis, exact usage, a rendered happy-path
example (the raw envelope and exactly what rich prints) and the error
envelopes you meet in practice. docs/cmd/core.md
covers version/login/logout/api. The pages are generated from the
endpoint records and CI fails if a record changes without its page.
FAQ
Is this official? No. Unofficial, not affiliated with, nor endorsed by,
Free SAS or Freebox. "Freebox" is a trademark of Free SAS; this project only
interoperates with the product, and is meant for your own box on your own
LAN.
Is my password safe? The ladder: pipe it (fbx login --stdin), or let fbx
read it from 1Password at runtime (op; the item is resolved as
FREEBOX_OP_REF env, then a one-line ~/.config/freebox/opref file kept
chmod 600, then the default item). It is
never in argv, never written to disk, never printed; the session cookie lives
chmod 600 under ~/.config/freebox/ and auto re-login is one retry. Set
FREEBOX_HOST if your LAN is renumbered (the default, fd0f:ee:b0::1, is the
stock Freebox ULA).
My box updated and something broke? The panel's served JavaScript is the
spec: re-transcribe the changed endpoint into docs/api/, fix the record,
and the fixture tests plus the wiki freshness gate catch the drift. Until
then fbx api covers gaps.
The story
Two companion essays (on the blog, links pending):
- Everything should be an API: why a router you own should answer to
your shell, and what the panel's undocumented dialect taught me.
(blog/00-why-fbx-cli.md)
- Clean-room reading and the interoperability right: how the endpoint
surface was transcribed from the panel's own JavaScript, and why that is
the honest way to interoperate. (blog/01-clean-room-interoperability.md)
Contributing
Read CONTRIBUTING.md: the one-paragraph clean-room rule
(endpoint changes are justified from docs/api, never from a live box; no
secrets, no personal data), the dev setup, and the end-to-end path for
adding an endpoint record.
License
GPL-3.0, see LICENSE. Copyright (C) 2026 Paul-Louis NECH.