From 47583c5e405f3011a526df73cc9485c46598f214 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Thu, 15 Oct 2026 01:35:09 +0200 Subject: feat(cli): chat — read a group's last messages, post one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chat GROUP prints the last ten messages, oldest first (-N, as head -N, or -n N for another count, paging back past the node's 200), and -m posts one (- reads it from stdin). The application's construction: every epoch key from chat_keys_req, a post sealed under the current epoch through the device subkey and signed with this machine's key on the node, the sender's name inside the envelope; nothing sent past the node's ciphertext bound. A stored message is read signature first, then key, then content, and one that fails is shown as unreadable, never dropped. Not done here: the Tier 2 roster check on the signing device. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-cli/src/meshbay_cli/__main__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packages/meshbay-cli/src/meshbay_cli/__main__.py') diff --git a/packages/meshbay-cli/src/meshbay_cli/__main__.py b/packages/meshbay-cli/src/meshbay_cli/__main__.py index dbb5a19..dd13d50 100644 --- a/packages/meshbay-cli/src/meshbay_cli/__main__.py +++ b/packages/meshbay-cli/src/meshbay_cli/__main__.py @@ -13,6 +13,7 @@ import sys from . import __version__ from .commands import ( browser_access, + chat, decline, devices, get, @@ -33,7 +34,7 @@ from .errors import INTERRUPTED, USAGE, CliError ACTIONS = {"login": login, "logout": logout, "groups": groups, "invitations": invitations, "join": join, "decline": decline, "leave": leave, "ls": ls, "search": search, "get": get, - "put": put, "rm": rm, "devices": devices, "trust": trust, + "put": put, "rm": rm, "chat": chat, "devices": devices, "trust": trust, "browser-access": browser_access} @@ -118,6 +119,7 @@ def main(argv: list[str] | None = None) -> int: return run() parser = build_parser() interactive = not argv + argv = chat.rewrite_count(argv, ACTIONS) try: args = parser.parse_args(argv) except SystemExit as e: # --help, --version, or a usage error -- cgit v1.2.3