Commit graph libervia-backend/libervia/cli
Author SHA1 Message Date
Goffi
610eac0718 Formatting + type hints 2026-05-02 15:55:18 +02:00
Goffi
9ffb729b8c cli (blog/preview): Fix preview:
- configuration handling was not updated
- there was a typo in `open_cb`
2026-04-24 17:39:01 +02:00
Goffi
c37694c014 cli: Python 3.14 compatibility fix 2026-04-24 17:38:57 +02:00
Goffi
753623e934 cli (pubsub/node/subscription/set): Fix bridge call 2026-04-08 16:16:20 +02:00
Goffi
68da01a043 Dates update. 2026-03-31 12:57:17 +02:00
Goffi
346c640f75 cli (config): add default verbosity config (verbosity) 2026-03-31 12:49:39 +02:00
Goffi
c4954ab508 cli: Set default verbosity for missing import messages:
Missing import messages now only display when verbosity is >= 2, this is to avoid
polluting the output. Dependency may be missing because user has not installed all
optional packages, the display should not show that every time.
2026-03-31 12:46:53 +02:00
Goffi
685193602e cli (profile): fix profile check for create and delete:
When checking existing profiles with `bridge.profiles_list_get`, all profiles have to be
retrieved, including components.
2026-03-30 12:05:13 +02:00
Goffi
b69c7e4565 cli (loop): Remove GLib and Twisted related code:
Now that D-Bus has been fully reimplemented with txdbus, GLib is not needed anymore for
D-Bus bridge.
As `dbus` and `pb` (and future other bridges) both support "AIOBridge", we don't have to
use a Twisted specific version for anything.
2026-03-13 11:54:27 +01:00
Goffi
1256e92cec cli (base): Refactor loop handling:
The loop was chosen according to the bridge used, but this is not possible anymore before
running it, because there is now an "auto" bridge which falls back from D-Bus to PB. To
work around that, the loop has been refactored to be started before knowing which bridge
is used, then the bridge-dependent hooks are installed later.
2026-03-13 10:27:51 +01:00
Goffi
30619f5689 bridge (dbus, pb): fix intialisation issues:
- D-Bus bridge check if it can import GLib, to raise early a BridgeInitError if it's not
  possible
- PB bridge now do lazy import of `reactor` to avoid race condition in Twisted loop
  initialisation.
- regenerated bridges.
2026-03-13 10:27:51 +01:00
Goffi
84321be4cc bridge: automatic bridge:
Add a new "auto" bridge which tries D-Bus and fall back to PB in case of problem. This is
the defaut reactor, but can also be explicitely used.
2026-03-13 10:27:51 +01:00
Goffi
82e2c6efac apply black to the whole codebase. 2026-03-09 09:22:04 +01:00
Goffi
1a0cc787f8 cli (contacts): add commands to handle pubsub contacts:
Add commands to retrieve (`contacts get`) and set (`contacts set`) pubsub contacts. As
they are managed with pubsub node, deletion can be done using `pubsub delete`.

rel 475
2026-02-23 13:15:16 +01:00
Goffi
2b9b4e6bbf Convert data to JSON when using JSON output:
`output` with JSON was expecting a JSON str, this patch change it to use the `data`
argument, so a python object is given and converted to JSON
2026-02-23 12:56:36 +01:00
Goffi
919cafc68c Update use of media_dir following change in Libervia Media:
Libervia Media is now a Python package instead of files to put in a directory to specify
in settings. The discovery is now automatic, removing the need for settings and enabling
easier installation. Furthermore, it should now work even if the package is zipped.
`libervia_media` can now be specified as a dependency for frontends requiring it.
2026-01-13 10:57:19 +01:00
Goffi
b88aed3731 cli (info): Add tor sub-command:
`tor` sub-command shows info on currently running Tor daemon (if any), and on the circuit
used to connect to XMPP server with current profile (if relevant).

rel 473
2025-12-15 11:35:26 +01:00
Goffi
b295c7dc7c cli: Update default theme:
Values which were used with constants and the legacy ANSI module are now in the theme. The
ANSI module should be removed in the future.

rel 473
2025-12-15 11:35:26 +01:00
Goffi
dcee0e098f cli (output): Add a OUTPUT_MODEL for Pydantic models:
As Pydantic becomes more and more used in Libervia, it is now important to have a
dedicated output in the CLI.

This patch also fixes `json` and `json_raw` outputs which were incorrectly calling
`console.print_json`.

rel 473
2025-12-15 11:35:26 +01:00
Goffi
7b3c8d2ba8 black reformatting. 2025-12-03 17:49:34 +01:00
Goffi
6a7b7bc36a core: Replace legacy INI config system with Pydantic-based TOML configuration.
This is a huge configuration refactoring.

The configuration system now uses Pydantic settings, with better validation, better
support for environment variables and other goodies.

The main config files now use TOML instead of INI, this allow for better handling of
complex types, notably dict.

Plugins, components and frontends can declare their config settings in a class which will
be imported dynamically.
2025-11-30 12:27:35 +01:00
Goffi
f3f40848b3 black reformatting 2025-11-20 14:50:03 +01:00
Goffi
07fe13698c cli (call): Add no_ui output:
`no_ui` output is used when a local UI must not be created, e.g.; because the stream is
piped out. The `--no-ui` option has been removed because using a dedicated output seems
like a better approach.
2025-11-19 17:21:26 +01:00
Goffi
72ff011ddd cli (call): set recording file descriptor when stdout is redirected. 2025-11-17 12:55:01 +01:00
Goffi
59cf0b846d cli (call), frontends(tools/webrtc_models): Add source for stdin:
If data is piped in with `auto` source, a new `SourcesStdin` is used.
2025-11-08 22:21:23 +01:00
Goffi
91b9fc7cd3 cli (call): Add arguments to set custom pipelines in sources. 2025-11-08 22:18:20 +01:00
Goffi
482de127e8 cli (call_gui): Make FastTransformation explicit. 2025-11-06 22:24:38 +01:00
Goffi
bcfd8d3285 cli (call_gui): Fix Qt events processing:
`app.sendPostedEvents` was not handling all events (notably not the window system ones),
resulting in side effects such as the image freezing during A/V calls when the mouse was
not moving for a few seconds.

Instead, `app.processEvents` is now used, even though the documentation discourages its
use: in this context, it should be fine, and it's a simple solution.
2025-11-06 22:24:10 +01:00
Goffi
fcb76a7dde cli (uri/build): fix call to uri.build_xmpp_uri. 2025-10-10 17:44:04 +02:00
Goffi
c4d00d63da cli: Fix exit traceback on Twisted based loop (e.g.; pb bridge). 2025-10-01 14:55:32 +02:00
Goffi
96bf3af324 Global reformatting with black. 2025-09-13 10:46:10 +02:00
Goffi
b816dc5e54 cli (pubsub): List support first draft + doc:
Basic support for listing hierarchy of nodes with pubsub extended discovery. Nodes are
displayed as a tree, depth can be specified.

rel 463
2025-08-31 12:34:37 +02:00
Goffi
cab460152c plugin XEP-0277: Make MbData a Pydantic model:
- MbData is now a Pydantic based model.
- Bridge method has been updated to use `service` and `node` from MbData instead of using
  separate fields.
- Added `In-Reply-To` to MbData.
- Adapted code using XEP-0277 to work with the changes.

rel 462
2025-08-03 23:35:21 +02:00
Goffi
06a1eef720 plugin XEP-0048, XEP-0402; CLI (bookmarks): implement XEP-0402 (PEP Native Bookmarks):
- Former bookmarks implementation is now labeled as "legacy".
- XEP-0402 is now used for bookmarks when relevant namespaces are found, and it fallbacks
  to legacy XEP-0048/XEP-0049 bookmarks otherwise.
- CLI legacy bookmark commands have been moved to `bookmarks legacy`
- CLI bookmarks commands now use the new XEP-0402 (with fallback to legacy one
  automatically used if necessary).
2024-11-20 11:43:27 +01:00
Goffi
0c27fef2ac cli (output/std): use rich to output JSON. 2024-11-20 11:38:44 +01:00
Goffi
da51288c7a tools (common/template), cli (call/gui): use font-awesome instead of fontello:
following change in Libervia Media, code has been updated to use font-awesome now instead
of fontello.
2024-10-26 22:42:17 +02:00
Goffi
5ccec8f755 cli (message/send): add arguments to send keywords and headers:
rel 451
2024-09-28 15:57:31 +02:00
Goffi
ba8ba26636 cli (message/send): add arguments for message addressing:
commands have been added to add `to`, `cc` and `bcc` metadata for sending copy of the
message to several entities. Metadata such as `reply-to` `reply-room` and `no-reply` are
also supported.

rel 450
2024-09-26 16:12:01 +02:00
Goffi
057a8ebadf CLI: add commands to handle gateways:
rel 449
2024-09-06 18:03:01 +02:00
Goffi
0c785f0934 cli (list/set): add "--comments" argument. 2024-06-20 14:46:55 +02:00
Goffi
53fdaa9d09 Reformatted code base using black. 2024-06-19 18:44:57 +02:00
Goffi
3fc429a781 cli (base): catch all failure on plugin importing. 2024-05-31 11:22:10 +02:00
Goffi
425499398d cli (remote-control): new remote-control command:
2 subcommands are available: `send` to control remotely a device, and `receive` to be
controlled.

Documentation will follow.

rel 436
2024-05-11 13:52:43 +02:00
Goffi
de7260bfb9 backend, frontend: prepare remote control:
This is a series of changes necessary to prepare the implementation of remote control
feature:

- XEP-0166: add a `priority` attribute to `ApplicationData`: this is needed when several
  applications are working in a same session, to know which one must be handled first.
  Will be used to make Remote Control have precedence over Call content.
- XEP-0166: `_call_plugins` is now async and is not used with `DeferredList` anymore: the
  benefit to have methods called in parallels is very low, and it cause a lot of trouble
  as we can't predict order. Methods are now called sequentially so workflow can be
  predicted.
- XEP-0167: fix `senders` XMPP attribute <=> SDP mapping
- XEP-0234: preflight acceptance key is now `pre-accepted` instead of `file-accepted`, so
  the same key can be used with other jingle applications.
- XEP-0167, XEP-0343: move some method to XEP-0167
- XEP-0353: use new `priority` feature to call preflight methods of applications according
  to it.
- frontend (webrtc): refactor the sources/sink handling with a more flexible mechanism
  based on Pydantic models. It is now possible to have has many Data Channel as necessary,
  to have them in addition to A/V streams, to specify manually GStreamer sources and
  sinks, etc.
- frontend (webrtc): rework of the pipeline to reduce latency.
- frontend: new `portal_desktop` method. Screenshare portal handling has been moved there,
  and RemoteDesktop portal has been added.
- frontend (webrtc): fix `extract_ufrag_pwd` method.

rel 436
2024-05-11 13:52:41 +02:00
Goffi
728b01d236 cli (call, file), frontends: implement webRTC data channel transfer:
- file send/receive commands now supports webRTC transfer. In `send` command, the
  `--webrtc` flags is currenty used to activate it.

- WebRTC related code have been factorized and moved to `libervia.frontends.tools.webrtc*`
  modules.

rel 442
2024-04-06 13:43:09 +02:00
Goffi
fa55bc6fb9 cli (pubsub): use PEP when service is not specified in error message. 2024-03-05 17:31:56 +01:00
Goffi
dec2fa48bc cli (file/receive): handle CONFIRM dialog received in pre-flight. 2024-03-05 17:31:56 +01:00
Goffi
8db12deaff cli (base): fix exit code transmission when SystemExit is catched. 2024-03-05 17:31:56 +01:00
Goffi
430f2d9354 cli (call): tui output implementation:
- Moved original UI to a separated class, and use if with the `simple` output
- By default, best output is automatically selected. For now `gui` is selected if possible,
  and `simple` is used as fallback.
- The new `tui` output can be used to have the videos directly embedded in the terminal,
  either with real videos for compatible terminal emulators, or with Unicode blocks.
- Text contrôls are used for both `simple` and `tui` outputs
- several options can be used with `--oo` (will be documented in next commit).

rel 428
2024-02-16 18:46:06 +01:00
Goffi
3d38bbd155 cli (call): implement GUI output:
``call`` commands now handle various output. Beside the original one (now named
``simple``), a new ``gui`` one display a full featured GUI (make with Qt).

PyQt 6 or more needs to be installed.

rel 427
2024-02-11 23:20:24 +01:00