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

pharos-config-cli

v2.0.0

Published

A robust command-line interface (CLI) designed to simplify the development, compilation, testing, and deployment of smart contracts on Pharos Network. It supports both Solidity (EVM) and Rust (WASM) environments, offering seamless integration with leading

Readme

🏗️ Smart Contract SDK & Deployment Pipelines

pharos-config-cli is a robust command-line interface (CLI) designed to simplify the development, compilation, testing, and deployment of smart contracts. It supports both Solidity (EVM) and Rust (WASM) environments, offering seamless integration with leading frameworks like Hardhat, Foundry, and Cargo.

🎯 Key Features

  • ✔ Multi-language support: Develop smart contracts in Solidity (EVM) and Rust (WASM)
  • ✔ Framework flexibility: Choose between Hardhat or Foundry for Solidity
  • ✔ Rust WASM ready: Full integration with Cargo contract
  • ✔ One-command project setup: Initialize and configure your project effortlessly
  • ✔ Automated compilation, testing, and deployment
  • ✔ Cross-framework compatibility
  • ✔ Frontend scaffolding: Automatically generate a frontend template based on the selected framework

📥 Installation

Prerequisites

Ensure you have the following installed before using Pharos CLI:

1️⃣ Node.js (v16 or later) – Required for executing the CLI

2️⃣ Rust (for WASM projects) – Install Rust and Cargo using:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

3️⃣ Solidity Frameworks (Only if working with EVM):

# Hardhat
npm install -g hardhat

# Foundry
curl -L https://foundry.paradigm.xyz | bash

Installing the SDK

You can install Pharos globally using NPM:

npm install -g pharos-config-cli

To verify that Pharos is installed correctly, run:

pharos --version

Quick Start Guide

1️⃣ Initialize a New Project

pharos-config-cli init

📌 You will be prompted to choose:

  • Contract Type: Solidity (EVM) or Rust (WASM)
  • Development Framework (if Solidity): Hardhat or Foundry
  • Frontend Framework (optional): React (Vite) or None

🔹 After initialization, Pharos will set up a structured project directory and generate a pharos-config.json file.

2️⃣ Compile Contracts

pharos-config-cli compile

💡 What happens?

  • Hardhat → Runs npx hardhat compile
  • Foundry → Runs forge build
  • Rust (WASM) → Runs cargo contract build

If compilation is successful, the contract bytecode will be generated and stored in the respective artifacts directory.

3️⃣ Run Tests

pharos-config-cli test

🛠 Framework-Specific Test Execution:

  • Hardhat → Runs npx hardhat test
  • Foundry → Runs forge test
  • Rust (WASM) → Runs cargo test --all

4️⃣ Deploy Your Contract

pharos-config-cli deploy

🚀 Deployment Process:

  • Hardhat → Deploys using npx hardhat run scripts/deploy.js --network localhost
  • Foundry → Uses forge create --private-key $PRIVATE_KEY
  • Rust (WASM) → Uses cargo contract deploy

🔹 Ensure that your network configurations are properly set before deployment.

📁 Project Structure

After running pharos-config-cli init, your project will be structured as follows:

/project-root
│── /smart-contract
│   │── /src
│   │   ├── lib.rs           # Rust contract source (for Rust projects)
│   │   ├── contracts/       # Solidity contract files (for Hardhat/Foundry projects)
│   │   ├── scripts/         # Deployment scripts (for Hardhat projects)
│   │── Cargo.toml           # Rust package config (for Rust projects)
│   │── package.json         # Node dependencies (for Solidity projects)
│   │── pharos-config.json   # Stores project settings
│
│── /frontend                # Created if a frontend framework is chosen
│   │── /src
│   │   ├── App.jsx      # Reusable components
│   │   ├── main.jsx          # Static assets like images, styles
│   │── package.json         # Frontend dependencies
│   │── index.html           # Main HTML entry file (Vite projects)
│   │── vite.config.js       # Vite configuration (for React/Vue)
│
│── pharos-config.json       # Stores project-wide settings

📌 Note:

  • The contracts/ directory is used only for Hardhat projects.

  • Foundry projects do not require a contracts/ directory but instead use .sol files directly.

  • Rust projects use src/lib.rs and Cargo.toml for configuration.

  • If a frontend framework is selected, pharos-config-cli generates a basic template.

  • Supports React (Vite) by default.

⚙️ Configuration File (pharos-config.json)

When a project is initialized, Pharos generates a pharos-config.json file to store project settings:

{
  "contractType": "Solidity (EVM)",
  "framework": "Hardhat",
  "frontend": "React (Vite)"
}

This file helps Pharos determine how to handle compilation, testing, and deployment.

🔧 Advanced Configuration

1️⃣ Using Custom Networks for Deployment

For Hardhat:

npx hardhat run scripts/deploy.js --network rinkeby

For Foundry:

forge create --private-key $PRIVATE_KEY --rpc-url $RPC_URL

For Rust WASM:

cargo contract deploy --url ws://127.0.0.1:9944

🛠 Troubleshooting & Common Errors

| Error | Solution | | ----------------------------------------- | ------------------------------------------------------ | | ❌ No Pharos project found. | Run pharos-config-cli init first. | | ❌ Rust contract not compiled. | Run pharos-config-cli compile before testing. | | ⚠️ No supported contract framework found! | Ensure you're inside a valid Pharos project directory. | | Error: Cargo not found | Ensure Rust and Cargo are installed (rustup show). |

🔄 Updating Pharos CLI

To update to the latest version of Pharos CLI:

npm update -g pharos-config-cli

📝 Contribution Guide

Pharos CLI is an open-source project, and contributions are welcome!

1️⃣ Fork the Repository

Clone the repo:

git clone https://github.com/ameer017/configure-pharos.git

Install dependencies:

npm install

Test changes locally:

node index.js

📄 License

pharos-config-cli is licensed under the MIT License.

📄 Changelog

See CHANGELOG.md for release history.

🤝 Get Involved

🚀 Join the Pharos CLI community and contribute to the future of smart contract development!

🔥 Ready to streamline your smart contract development?

  • Run:
pharos-config-cli init