From 422647e7898b8df67cd11f8fb060aec23dec84aa Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Wed, 14 Oct 2026 22:20:15 +0200 Subject: feat(cli): meshbay-cli, a command-line client for members Signs in to the hub, lists the account's groups and their folders, and downloads and uploads files directly with each group's node, end-to-end encrypted. With no argument it opens a two-pane interactive mode (Textual). Session and device keys are kept encrypted under the system's key storage, or a 0600 key file where there is none; node keys are pinned at first contact; a new machine links as a device. Packaged on its own on Linux (deb and rpm, on meshbay-common's venv, with a man page generated from the parser) and frozen next to meshbay-node in the full Windows installer, not the light one, with a self-test the build runs. client/keys.py ports keyderive.js and is LGPL like it. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-cli/src/meshbay_cli/errors.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/meshbay-cli/src/meshbay_cli/errors.py (limited to 'packages/meshbay-cli/src/meshbay_cli/errors.py') diff --git a/packages/meshbay-cli/src/meshbay_cli/errors.py b/packages/meshbay-cli/src/meshbay_cli/errors.py new file mode 100644 index 0000000..319645e --- /dev/null +++ b/packages/meshbay-cli/src/meshbay_cli/errors.py @@ -0,0 +1,24 @@ +""" +Every way a run can end badly, as an exit code a script can act on. + +The library raises `CliError` with one of these codes; only `__main__` turns it +into a message and an exit status. +""" + +USAGE = 1 +AUTH = 2 # sign-in refused, no session and no passphrase, locked out +NOT_FOUND = 3 # group, path, or a pattern that matches nothing +PARTIAL = 4 # some items failed +NODE = 5 # node unreachable, or it refused the connection +NODE_KEY = 6 # a node's key changed since it was pinned +VERSION = 7 # this client, or the protocol, is too old or too new +REFUSED = 8 # refused before anything was sent: a name taken or not accepted, + # a folder read-only or unavailable +INTERRUPTED = 130 + + +class CliError(Exception): + def __init__(self, code: int, message: str): + super().__init__(message) + self.code = code + self.message = message -- cgit v1.2.3