Commit graph libervia-backend/libervia/cli/base.py
Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
8db12deaff cli (base): fix exit code transmission when SystemExit is catched. 2024-03-05 17:31:56 +01:00
Goffi
e14dd9da8b core: add new init_script_path option:
`init_script_path` option can be used in `[DEFAULTS]` to run a script at the end of
backend initialisation. A new `init_pre_script` method is used to wait for backend to
reach this stage (designed to be used mostly by CLI frontend), then the usual `ready_get`
method is finished once the script is finished.
2023-12-13 22:00:22 +01:00
Goffi
b7d3afeabd cli (base): new a_quit method to run async cleaning methods:
it may be necessary to run some async cleaning method (e.g. if bridge is needed), this new
method handles async cleaning method, and will be called when `SystemExit` is used, or if
`a_quit` is called explicitely.

rel 426
2023-11-01 14:08:00 +01:00
Goffi
3e51dc187c cli (base): catch SystemExit to do a proper quit when Ctrl-C is pressed. 2023-10-18 15:33:38 +02:00
Goffi
bd2db73ee5 cli: rich initial integration 2023-10-18 15:30:07 +02:00
Goffi
fd16770c19 refactoring: rename libervia.frontends.jp to libervia.cli 2023-06-02 14:54:26 +02:00
Renamed from libervia/frontends/jp/base.py (Browse further)