From ef351373a1166f5919f61896a38d9688cc2dcc9c Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Mon, 17 Jul 2023 16:07:12 -0700 Subject: [PATCH] Slightly nicer output for dclient auth list --- dclient/cli.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dclient/cli.py b/dclient/cli.py index 7a51263..be1f483 100644 --- a/dclient/cli.py +++ b/dclient/cli.py @@ -156,11 +156,14 @@ def add(alias_or_url, token): @auth.command(name="list") def list_(): - "List auths" + "List stored API tokens" auths_file = get_config_dir() / "auth.json" - print(auths_file) + click.echo("Tokens file: {}".format(auths_file)) auths = _load_auths(auths_file) - click.echo(json.dumps(auths, indent=2)) + if auths: + click.echo() + for url, token in auths.items(): + click.echo("{}:\t{}..".format(url, token[:1])) def _load_aliases(aliases_file):