0.0.1 • Published 9 months ago

@phi-hub/cli v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Phi CLI

Phi Lib is a powerful, developer-friendly toolkit designed for seamless interaction with the Phi Protocol. It allows developers to create and manage credentials (Creds), issue artworks as non-fungible tokens (NFTs) tied to these credentials, and verify minting eligibility across multiple blockchain networks.

Features

  • Issue Phi NFT Arts based on Creds
  • Easy-to-use command-line interface (CLI)

Usage

Installation

bun add @phi-hub/lib
bun link
bun link @phi-hub/lib

Usage

Creating a Cred (Merkle or Signature)

phi create-cred

This command will guide you through the process of creating a new credential. It uses a YAML configuration file (create-cred.yaml) to define the structure of the command and provide default values. The command will:

  1. Prompt you to choose between MERKLE and SIGNATURE verification types.
  2. Ask for necessary information such as creator address, executor address, cred type, etc.
  3. Use predefined default values where available, allowing you to quickly create creds with common settings.
  4. For MERKLE type, it will ask for a CSV file containing the address list.
  5. For SIGNATURE type, it will ask for verifier information.

You can also provide values directly as command-line arguments. For example:

phi create-cred --verification-type MERKLE --creator 0x... --executor 0x... --cred-type BASIC

Creating Art for a Cred

phi create-art

This command uses the create-art.yaml configuration file to guide you through the process of creating art for a specific cred. It will:

  1. Ask for the cred chain and art chain IDs.
  2. Prompt for the cred ID to associate the art with.
  3. Allow you to choose between IMAGE and API_ENDPOINT art types.
  4. Collect necessary information such as title, artist address, price, etc.
  5. For IMAGE type, it will ask for the path to the image file.
  6. For API_ENDPOINT type, it will ask for the endpoint URL and preview information.

You can also provide values directly as command-line arguments:

phi create-art --cred-chain 84532 --art-chain 84532 --cred 1 --type IMAGE --title "My Awesome NFT" --artist 0x...

Creating a Verifier for a Cred

phi create-verifier

This command adds a verifier to an existing cred. It will prompt you for:

  1. The cred chain ID.
  2. The cred ID to add the verifier to.
  3. The verifier's address.
  4. The verifier's endpoint URL.
  5. The verification source (e.g., GitHub repository URL).

Configuration

  • Set the default chain: phi config set-chain <chain>
  • Get the current default chain: phi config get-chain
  • Set the private key: phi config set-private-key

Tutorial

  1. Install Phi Lib:

    bun add @phi-hub/lib
  2. Link the CLI:

    bun link
    bun link @phi-hub/lib
  3. Set your private key:

    phi config set-private-key
  4. Create a Cred:

    phi create-cred

    Follow the prompts to create either a Merkle-based or Signature-based Cred.

  5. Create Art for your Cred:

    phi create-art

    Follow the prompts to create either an IMAGE or API_ENDPOINT type art.

  6. (Optional) Add a Verifier:

    phi create-verifier

    Follow the prompts to add a verifier to your Cred.

License

The Phi CLI is released under the MIT License.

Support

For questions or issues, please contact our support team at contact@philand.xyz.