From c0414a9e0d4d6aff64bf1a50a9e83f2f6ed11af5 Mon Sep 17 00:00:00 2001 From: gilesb Date: Mon, 12 Jan 2026 07:36:44 +0000 Subject: [PATCH] Show CID for asset uploads - Display IPFS CID after upload - Show recipe syntax with :cid Co-Authored-By: Claude Opus 4.5 --- artdag.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/artdag.py b/artdag.py index 6d274fd..564a8a0 100755 --- a/artdag.py +++ b/artdag.py @@ -519,7 +519,7 @@ def import_file(filepath): @cli.command() @click.argument("filepath", type=click.Path(exists=True)) def upload(filepath): - """Upload a file to cache (works with remote servers). Requires login.""" + """Upload a file to cache and IPFS. Requires login.""" # Check auth token_data = load_token() if not token_data.get("access_token"): @@ -536,8 +536,11 @@ def upload(filepath): sys.exit(1) resp.raise_for_status() result = resp.json() - click.echo(f"Uploaded: {result['content_hash']}") + click.echo(f"CID: {result['cid']}") click.echo(f"Size: {result['size']} bytes") + click.echo() + click.echo("Use in recipes:") + click.echo(f' (asset my-asset :cid "{result["cid"]}")') except requests.RequestException as e: click.echo(f"Upload failed: {e}", err=True) sys.exit(1)