Update effect upload to show IPFS CID

- Display CID instead of content hash after upload
- Update example recipe syntax to use :cid

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-12 07:28:44 +00:00
parent fa540f4441
commit 09edf9f59e

View File

@@ -1017,10 +1017,10 @@ def upload_recipe(filepath):
@cli.command("upload-effect")
@click.argument("filepath", type=click.Path(exists=True))
def upload_effect(filepath):
"""Upload an effect file. Requires login.
"""Upload an effect file to IPFS. Requires login.
Effects are Python files with PEP 723 dependencies and @-tag metadata.
Returns the content hash for use in recipes.
Returns the IPFS CID for use in recipes.
"""
token_data = load_token()
if not token_data.get("access_token"):
@@ -1048,7 +1048,7 @@ def upload_effect(filepath):
result = resp.json()
click.echo(f"Uploaded effect: {result['name']} v{result.get('version', '1.0.0')}")
click.echo(f"Content hash: {result['content_hash']}")
click.echo(f"CID: {result['cid']}")
click.echo(f"Temporal: {result.get('temporal', False)}")
if result.get('params'):
click.echo(f"Parameters: {', '.join(p['name'] for p in result['params'])}")
@@ -1056,7 +1056,7 @@ def upload_effect(filepath):
click.echo(f"Dependencies: {', '.join(result['dependencies'])}")
click.echo()
click.echo("Use in recipes:")
click.echo(f' (effect {result["name"]} :hash "{result["content_hash"]}")')
click.echo(f' (effect {result["name"]} :cid "{result["cid"]}")')
except requests.RequestException as e:
click.echo(f"Upload failed: {e}", err=True)
sys.exit(1)