From 1b4dc8597433704a2dd493b05f211813e2f7528f Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 24 Feb 2026 14:56:40 -0800 Subject: [PATCH] actor command: make URL optional, fix actor URL construction Co-Authored-By: Claude Opus 4.6 --- dclient/cli.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dclient/cli.py b/dclient/cli.py index 05a17e9..91f92ce 100644 --- a/dclient/cli.py +++ b/dclient/cli.py @@ -252,7 +252,7 @@ def insert( @cli.command() -@click.argument("url_or_alias") +@click.argument("url_or_alias", default=None, required=False) @click.option("--token", help="API token") def actor(url_or_alias, token): """ @@ -270,9 +270,7 @@ def actor(url_or_alias, token): token = _resolve_token(token, url) - url_bits = url.split("/") - url_bits[-1] = "-/actor.json" - actor_url = "/".join(url_bits) + actor_url = url.rstrip("/") + "/-/actor.json" response = httpx.get( actor_url, headers={"Authorization": "Bearer {}".format(token)}, timeout=40.0 )