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

@neardefi/shade-agent-cli

v1.0.2

Published

This cli will help you launch shade agents

Readme

Shade Agent CLI

This CLI tool will let you deploy the Shade Agent API docker image both locally and remotely on Phala Cloud.

Installation

npm i -g @neardefi/shade-agent-cli

Create your env file

Create .env.development.local in root.

Using the CLI

Simply run

shade-agent-cli

in the same directory as your .env.development.local and docker-compose.yaml files.

Options

| Option / Flag | Description | |-----------------------------|------------------------------------------------------------------| | -w, --wasm <string> | WASM path to deploy custom contract | | -f, --funding <string> | Funding amount for contract account in NEAR | | -i, --image | Just build and push the Docker image | | -c, --contract | Build and push the Docker image, and deploy the contract | | -o, --phala-only | Just deploy the app to Phala Cloud | | -d, --no-redeploy | Skip redeploying the contract | | -b, --no-build | Skip building and pushing the Docker image | | -p, --no-phala | Skip deploying the app to Phala Cloud | | -e, --no-endpoint | Skip printing the endpoint of the app | | -s, --no-cache | Run docker build with --no-cache |

Note: Some options are mutually exclusive. See error messages for details if you use conflicting flags.

Env Vars

Local Development (proxy) or Phala Deployment (sandbox) Contract?

Local Development

NEXT_PUBLIC_contractId=ac-proxy.[NEAR_ACCOUNT_ID] is for local development.

You can test against the shade-agent-api running on your machine (NOT A TEE). The contract at ac-proxy.[NEAR_ACCOUNT_ID] does NOT check any attestation information. Although it does make sure your codehashes are approved and has a somewhat similar interface to the real contract.

Phala Deployment

NEXT_PUBLIC_contractId=ac-sandbox.[NEAR_ACCOUNT_ID] is for remote deployments to Phala Cloud.

These deployments are running in a TEE and the agent contract ac-sandbox.[NEAR_ACCOUNT_ID] will be checking the attestation of the TEE. This is a full stack shade agent.

The Full ENV File

# Get this from near-cli-rs 
NEAR_ACCOUNT_ID=
NEAR_SEED_PHRASE="" 

# ac-proxy.[NEAR_ACCOUNT_ID] for running locally, ac-sandbox.[NEAR_ACCOUNT_ID] for running on Phala Cloud
NEXT_PUBLIC_contractId=ac-proxy.NEAR_ACCOUNT_ID

# Do not change this API codehash, this is the code hash for the shade-agent-api
API_CODEHASH=a86e3a4300b069c08d629a38d61a3d780f7992eaf36aa505e4527e466553e2e5


# FOR PHALA DEPLOYMENTS
# Everything below will be needed for deployments to Phala Cloud

# Your App's code hash, this will update automatically each time you run shade-agent-cli
APP_CODEHASH=03418bb6bc5d35fd8bf3c36f2087ec5206b47e7c93876f265dbd3c7097290381

# Your Docker tag docker_username/image_name
DOCKER_TAG=pivortex/my-app

# Your Phala API key, get from https://cloud.phala.network/dashboard/tokens  
PHALA_API_KEY=

Custom RPC

To use a non default RPC with the CLI create a near-rpc.json file in the same directory as your docker-compose.yaml file

{
  "nearRpcProviders": [
    {
      "connectionInfo": {
        "url": "https://neart.lava.build:443"
      },
      "options": {
        "retries": 5,
        "backoff": 2,
        "wait": 1500
      }
    },
    {
      "connectionInfo": {
        "url": "https://test.rpc.fastnear.com"
      },
      "options": {
        "retries": 3,
        "backoff": 2,
        "wait": 1000
      }
    }
  ]
}

If required you can specify headers under connectionInfo.