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 🙏

© 2025 – Pkg Stats / Ryan Hefner

difcli

v0.0.13

Published

CLI tool for Diffuse Prime

Readme

Prime CLI

A CLI tool for Diffuse Prime built with TypeScript and viem.

Configuration

The CLI uses a config.json file with the following settings:

{
  "rpc": "https://rpc.berachain.com",
  "vaultContract": "0x17b040cF3bbAf62B60871B4d396FBC5109d560af",
  "tokenContract": "0xBe4170b9903f796490F8E88aCBf9db9F336Ec27e"
}

Installation

npm install -g difcli
# or
npx difcli

Usage

Main Commands

difcli --help          # Show help
difcli --version       # Show version

Wallet Commands

Set Private Key

difcli wallet set-private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

Show Wallet Information

difcli wallet show

Displays wallet address and type.

Remove Wallet

difcli wallet remove

Removes the stored private key from local storage.

Balance Command

Show Balance

difcli balance

Displays wallet balance in native BERA tokens and configured token contract balance.

Contracts Command

Display Contract Addresses

difcli contracts

Displays all configured contract addresses including RPC endpoint, vault contract, and token contract.

Token Commands

Mint Tokens

difcli token mint <amount>

Mints the specified amount of tokens to the configured wallet. Amount is in token units (will be multiplied by 1e18 for the transaction).

Burn Tokens

difcli token burn <amount>

Burns the specified amount of tokens from the configured wallet. Amount is in token units (will be multiplied by 1e18 for the transaction).

Both commands will:

  • Display transaction hash
  • Wait for transaction confirmation
  • Show success/failure status
  • Display gas usage information

Lender Commands

Deposit Tokens

difcli lender deposit <amount>

Deposits tokens into the vault as a lender. Amount is in token units (will be multiplied by 1e18 for the transaction).

The command will:

  • Check token balance to ensure sufficient funds
  • Check token allowance for the vault contract
  • Approve tokens if allowance is insufficient
  • Execute deposit transaction to vault contract
  • Display transaction hashes and confirmation status
  • Show gas usage information

Validation: Command will fail with clear error message if token balance is insufficient.

Withdraw Tokens

difcli lender withdraw <amount>

Withdraws tokens from the vault as a lender. Amount is in token units (will be multiplied by 1e18 for the transaction).

The command will:

  • Check maximum withdrawable amount from vault
  • Execute withdraw transaction from vault contract (if sufficient balance)
  • Display transaction hash and confirmation status
  • Show gas usage information

Note: Both receiver and owner addresses are set to the configured wallet address.

Validation: Command will fail with clear error message if requested amount exceeds maximum withdrawable balance.

Vault Commands

Set Vault Address

difcli vault set <chain> <address>

Sets a custom vault contract address for a specific chain.

difcli vault set berachain 0x1234567890123456789012345678901234567890

Show Vault Addresses

difcli vault show

Displays current vault addresses for all chains, showing both default and custom addresses.

Reset Vault Address

difcli vault reset <chain>

Resets the vault address for a specific chain back to the default.

difcli vault reset berachain

Note: Custom vault addresses are stored per chain and persist across sessions.

Vault Status

difcli lender status

Displays comprehensive vault status and lender-specific information:

Vault Statistics:

  • Total assets in vault
  • Assets currently utilized
  • Base asset deficit

Lender Information:

  • Maximum withdrawable amount
  • Current vault balance (shares)
  • Accrued yield information

Vault Status:

  • Pause status and reason (if paused)

Security

⚠️ WARNING: This CLI tool stores private keys locally with encryption. While the keys are encrypted, this is NOT suitable for production use with real funds.

For production use:

  • Use hardware wallets
  • Implement proper key management systems
  • Never store private keys on disk

The current implementation uses a default encryption key. For better security, consider:

  1. User-provided passwords for encryption
  2. Hardware security modules
  3. Secure key vaults

Development

# Install dependencies
npm install

# Build the project
npm run build

# Run in development mode
npm run dev

# Test locally
node dist/index.js [command]
# or
npx difcli [command]

Dependencies

License

MIT