Commit graph libervia-backend/libervia/cli
Author SHA1 Message Date
Goffi
2bd6401e39 cli (encryption, message): typo fixes 2026-11-03 18:02:05 +01:00
Goffi
995200a978 cli (base): Add instance isolation options:
- New ``-i``/``--isolation`` argument is added, it must be used before first positional
  argument (i.e., first comamnd).
- The new `entry.py` module is now the entry point, so it can set the `LIBERVIA_ISOLATION`
  environment variable before the backend read it.
2026-11-03 18:02:05 +01:00
Goffi
25f1aa9178 cli (blog): add --comments-from to target an item comments node:
- add `--comments-from <item_id>` and `--comments-from-last` to automatically retrieve the
  comments node of a blog post.
- ⚠️`--draft-path` short option moved from `-F` to `-d` (so `-F` can be used for
  `--comments-from`).
2026-10-28 14:29:38 +01:00
Goffi
fa04667152 cli (blog): preserve existing item fields on set -i + attachments fixes:
- `set -i` was replacing all fields of any existing item, losing tags, attachments,
  publication date, etc. It now fetches the existing item if any, and starts from its
  data. `-r/--replace` can be used to force a full replacement (and avoid fetching old
  item).
- `--attachment` uses `action="extend"` so multiple `-a` can be used.
- Fix attachement data key (`url` -> `sources`).
2026-10-28 14:29:38 +01:00
Goffi
f22af42ece cli (backup): add backup commands:
Add the `li backup` commands with `export`, `import` and `verify`:

- data types selection (`-i`/`-e`) and profile selection (`-p`), `--no-db` on export, `--use-db` on
  import
- GPG symmetric encryption of the archive (`--encrypt`)
- progression is shown, with ETA
- the commands can run without a backend connection (import from DB MUST be run without
  backend)
- cli (base): `BRIDGELESS_COMMANDS` holds the name of the few commands which can be run
  without backend.

rel 480
2026-09-15 11:48:11 +02:00
Goffi
a3cc29ca3c cli (debug/monitor): Add timestamp to XML logs. 2026-08-12 18:12:02 +02:00
Goffi
33132827f3 cli (application): new update command:
Update an application, or all of them.
2026-07-21 11:50:20 +02:00
Goffi
e013f9ba66 cli (serverless): New serverless commands:
New `serverless` commands. For now only `discover` and `info` are implemented:

    - `discover` find other peers on LAN
    - `info` get various infos on serverless status (for now, our own device ID,
      advertised service name, and the number of found peers)

rel 479
2026-07-17 23:27:47 +02:00
Goffi
c6f390df3c test: minor formatting 2026-07-17 16:45:29 +02:00
Goffi
a8ba049d6a cli (xid): Set of commands to handle XMPP Decentralized ID (XID):
Implement commands to get, create, revoke, verify, import/export XID, and sign/verify a
file or inline data.

rel 477
2026-06-06 12:34:00 +02:00
Goffi
c3906da781 cli (base): Flush output on self.disp:
When `li` stdout was redirected (e.g. with a pipe), the buffer was preventing to display
immediately data, which is a problem when we need it immediately (like when monitoring
with `li debug monitor`). Flushing is now done immediately to avoid that.
2026-05-04 16:44:39 +02:00
Goffi
70ad837e5d cli (base): Add a failsafe on guess_background:
In some cases (e.g. inherited env values in a wrapping tool), the background detection
code can be validated but hangs. This patch avoids that by adding a timeout with a
`SIGALRM`.
2026-05-02 15:55:18 +02:00
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