@phi-hub/cli v0.0.1
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:
- Prompt you to choose between MERKLE and SIGNATURE verification types.
- Ask for necessary information such as creator address, executor address, cred type, etc.
- Use predefined default values where available, allowing you to quickly create creds with common settings.
- For MERKLE type, it will ask for a CSV file containing the address list.
- 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:
- Ask for the cred chain and art chain IDs.
- Prompt for the cred ID to associate the art with.
- Allow you to choose between IMAGE and API_ENDPOINT art types.
- Collect necessary information such as title, artist address, price, etc.
- For IMAGE type, it will ask for the path to the image file.
- 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:
- The cred chain ID.
- The cred ID to add the verifier to.
- The verifier's address.
- The verifier's endpoint URL.
- 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
Install Phi Lib:
bun add @phi-hub/lib
Link the CLI:
bun link bun link @phi-hub/lib
Set your private key:
phi config set-private-key
Create a Cred:
phi create-cred
Follow the prompts to create either a Merkle-based or Signature-based Cred.
Create Art for your Cred:
phi create-art
Follow the prompts to create either an IMAGE or API_ENDPOINT type art.
(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.
9 months ago