npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

aavegotchi-cli

v0.2.6

Published

Agent-first CLI for automating Aavegotchi app and onchain workflows

Readme

aavegotchi-cli

Agent-first CLI for automating Aavegotchi app and onchain workflows on Base.

Install

npm install -g aavegotchi-cli

For local development:

npm install

First command an agent should run

AGCLI_PRIVATE_KEY=0x... npm run ag -- bootstrap \
  --mode agent \
  --profile prod \
  --chain base \
  --signer env:AGCLI_PRIVATE_KEY \
  --policy default \
  --json

For read-only automation:

npm run ag -- bootstrap --mode agent --profile prod --chain base --signer readonly --json

Command surface (v0.2.0)

  • bootstrap
  • profile list|show|use|export
  • signer check
  • signer keychain list|import|remove
  • policy list|show|upsert
  • rpc check
  • tx send|status|resume|watch
  • batch run --file plan.yaml
  • onchain call|send
  • subgraph list|check|query
  • baazaar listing get|active|mine (subgraph-first read wrappers)
  • auction get|active|mine|bids|bids-mine (subgraph-first read wrappers)
  • auction bid|bid-unbid (first-class write UX)
  • <domain> read (routes to generic onchain call for that domain)

Planned domain namespaces are stubbed for parity tracking:

  • gotchi, portal, wearables, items, inventory, baazaar, auction, lending, staking, realm, alchemica, forge, token

Many Base-era write flows are already executable as mapped aliases in those namespaces (internally routed through onchain send). Mapped writes now include built-in ABI defaults, so --abi-file is no longer required for mapped command execution/help. Example with built-in defaults: ag baazaar buy-now --args-json '[...]' --dry-run --json Example with explicit metadata: ag lending create --abi-file ./abis/GotchiLendingFacet.json --address 0x... --args-json '[...]' --json

Command help and discoverability

The CLI supports command-targeted help:

ag --help
ag tx send --help
ag help baazaar buy-now

Mapped write commands now expose their onchain function mapping, defaults (if available), and required flags:

ag baazaar buy-now --help

If you provide --abi-file with --help, the CLI prints ABI-derived function signature and input names for the mapped method:

ag baazaar buy-now --help --abi-file ./abis/BaazaarFacet.json

Unknown commands return suggestions:

ag tx snd --json

Dry-run writes

Use --dry-run on write commands to run full preflight without broadcasting:

  • runs simulation (eth_call)
  • runs gas + fee estimation
  • enforces policy checks
  • resolves nonce
  • returns status: \"simulated\" with simulation details

Supported write surfaces:

  • tx send --dry-run
  • onchain send --dry-run
  • mapped write aliases (for example: token approve --dry-run)

Safety rule:

  • --dry-run cannot be combined with --wait / --confirm

Subgraph sources and endpoint policy

Canonical source aliases:

  • core-base -> https://api.goldsky.com/api/public/project_cmh3flagm0001r4p25foufjtt/subgraphs/aavegotchi-core-base/prod/gn
  • gbm-base -> https://api.goldsky.com/api/public/project_cmh3flagm0001r4p25foufjtt/subgraphs/aavegotchi-gbm-baazaar-base/prod/gn

Default policy is strict allowlist:

  • Non-canonical subgraph URLs are blocked by default (SUBGRAPH_ENDPOINT_BLOCKED)
  • Override is explicit and per-command only: pass both --subgraph-url <https-url> and --allow-untrusted-subgraph
  • Non-HTTPS custom URLs are rejected

Auth:

  • Public Goldsky endpoints work without auth
  • If GOLDSKY_API_KEY is set, CLI injects Authorization: Bearer <token>
  • Override env var name per command with --auth-env-var <ENV>

Subgraph command examples

List configured canonical sources:

npm run ag -- subgraph list --json

Check source reachability/introspection:

npm run ag -- subgraph check --source core-base --json

Run custom GraphQL query:

npm run ag -- subgraph query \
  --source gbm-base \
  --query 'query($first:Int!){ auctions(first:$first){ id } }' \
  --variables-json '{"first":5}' \
  --json

Baazaar wrappers:

npm run ag -- baazaar listing active --kind erc721 --first 20 --skip 0 --json
npm run ag -- baazaar listing mine --kind erc1155 --seller 0x... --json
npm run ag -- baazaar listing get --kind erc721 --id 123 --verify-onchain --json

GBM wrappers:

npm run ag -- auction active --first 20 --json
npm run ag -- auction bids --auction-id 123 --json
npm run ag -- auction get --id 123 --verify-onchain --json

Raw GraphQL passthrough (typed projection remains included):

npm run ag -- auction active --first 5 --raw --json

First-class auction bidding

Single auction bid (no manual ABI/address/arg packing):

npm run ag -- auction bid --auction-id 5666 --amount-ghst 1 --dry-run --json

Bid all currently unbid auctions up to a max total:

npm run ag -- auction bid-unbid --amount-ghst 1 --max-total-ghst 10 --dry-run --json

Notes:

  • auction bid resolves GBM diamond + ABI internally.
  • Preflight checks include auction-open state, expected/unbid checks, minimum bid, GHST balance, and GHST allowance.
  • --auto-approve can submit GHST approve() automatically when allowance is insufficient.
  • auction bid-unbid emits per-auction results and explicit skip reasons in one JSON report.

Signer backends

  • readonly (read-only mode)
  • env:ENV_VAR (private key from env var)
  • keychain:ACCOUNT_ID (encrypted local key store; requires AGCLI_KEYCHAIN_PASSPHRASE)
  • remote:URL|ADDRESS|AUTH_ENV (HTTP signer service)
  • ledger:DERIVATION_PATH|ADDRESS|BRIDGE_ENV (external bridge command signer)
  • bankr[:ADDRESS|API_KEY_ENV|API_URL] (Bankr-native signer via /agent/me + /agent/submit; defaults: BANKR_API_KEY, https://api.bankr.bot)
  • Optional profile env file support (bootstrap --env-file <path>) plus Bankr auto-discovery ($AGCLI_BANKR_ENV_FILE, $AGCLI_HOME/bankr.env, $AGCLI_HOME/.env.bankr, ~/.config/openclaw/bankr.env, ./.env.bankr, ./bankr.env)

Remote signer contract:

  • GET /address -> { "address": "0x..." } (optional if address configured)
  • POST /sign-transaction -> { "rawTransaction": "0x..." } or { "txHash": "0x..." }

Bankr signer contract:

  • GET /agent/me -> resolves wallet address when signer address is not pinned
  • POST /agent/submit -> submits transaction and returns transaction hash
  • auth header: x-api-key: <BANKR_API_KEY>

Bankr bootstrap example:

BANKR_API_KEY=... \
npm run ag -- bootstrap --mode agent --profile bankr --chain base --signer bankr --env-file ~/.config/openclaw/bankr.env --json

Ledger bridge contract:

  • Set AGCLI_LEDGER_BRIDGE_CMD (or custom env var in signer config) to a command that reads tx payload JSON from stdin and outputs JSON containing either rawTransaction or txHash.

Keychain import example:

AGCLI_KEYCHAIN_PASSPHRASE=your-passphrase \
AGCLI_PRIVATE_KEY=0x... \
npm run ag -- signer keychain import --account-id bot --private-key-env AGCLI_PRIVATE_KEY --json

Agent-mode behavior

--mode agent implies:

  • --json
  • --yes

All successful/error responses use a stable envelope:

{
  "schemaVersion": "1.0.0",
  "command": "tx send",
  "status": "ok",
  "data": {},
  "meta": { "timestamp": "...", "mode": "agent" }
}

Config and journal

  • Config default path: ~/.aavegotchi-cli/config.json
  • Journal default path: ~/.aavegotchi-cli/journal.sqlite
  • Override both via AGCLI_HOME=/custom/path

Parity artifacts

Raffle/ticket flows are intentionally excluded for Base-era scope.

Development

npm run typecheck
npm test
npm run build
npm run parity:check
npm run smoke:write-dryrun
npm run ag -- help

Write dry-run smoke test notes:

  • npm run smoke:write-dryrun validates write paths without broadcasting any transaction.
  • To run against an installed binary instead of local source:
    • AG_BIN=/absolute/path/to/ag npm run smoke:write-dryrun