Skip to content

Plan usage proof cmds#351

Open
Pranav-1100 wants to merge 3 commits intostoracha:mainfrom
Pranav-1100:plan_usage_proof_cmds
Open

Plan usage proof cmds#351
Pranav-1100 wants to merge 3 commits intostoracha:mainfrom
Pranav-1100:plan_usage_proof_cmds

Conversation

@Pranav-1100
Copy link
Contributor

This PR brings the management commands from the JS client over to Guppy so we can check subscriptions, usage, and local proofs straight from the terminal. Resolves #333.

Here is a quick breakdown of what was added:

  • guppy plan get and guppy plan set:
    Uses plan/get capability to show the current billing plan. If no billing profile exists, it catches the error and asks user to visit the console to set one up. I also added (plan set ) so users can change plans directly from the terminal.

  • guppy usage report:
    Uses the usage/report capability to get the total bytes used by a space. It fetches data starting from 2020 (just like the JS client) to make sure it counts all historical uploads.

  • guppy proof ls:
    A local command that looks into the agent's datastore and lists all the saved UCAN delegations, showing the CID, Issuer, and exact capabilities (like * or ucan/attest).

Verification with Output

1. Plan Get / Set

$ guppy plan get
Plan Details for did:mailto:gmail.com:prana...:
  Product: did:web:starter.storacha.network
  Limit:   0
  Updated: 2026-02-18T13:15:32.955Z

$ guppy plan set did:web:lite.storacha.network   
Setting plan for did:mailto:gmail.com:prana... to did:web:lite.storacha.network...
Success! Plan updated.

$ guppy plan get                               
Plan Details for did:mailto:gmail.com:prana...:
  Product: did:web:lite.storacha.network
  Limit:   0
  Updated: 2026-02-21T05:49:59.693Z

2. Usage Report

$ guppy usage report did:key:z6Mke...
Fetching usage for space did:key:z6Mke...
---------------------------------------------------
Provider:    did:web:up.storacha.network
Total Usage: 251 MiB
---------------------------------------------------

3. Proof LS

$ guppy proof ls
Found 7 proof(s):
CID:    bafyreiej...
Issuer: did:web:up.forge.storacha.network
Capabilities:
  - ucan/attest (with: did:web:up.forge.storacha.network)
CID:    bafyreifn...
Issuer: did:key:z6Mku...
Capabilities:
  - * (with: did:key:z6Mku...)
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add 'plan', 'usage', and 'proof' management commands (JS -> GO)

1 participant