Skip to content

Feat/cli extended functionality#409

Merged
stanlou merged 30 commits intodevelopfrom
feat/cli-extended-functionality
Feb 4, 2026
Merged

Feat/cli extended functionality#409
stanlou merged 30 commits intodevelopfrom
feat/cli-extended-functionality

Conversation

@stanlou
Copy link
Collaborator

@stanlou stanlou commented Jan 28, 2026

Description

This PR extends the Proto-Kit CLI with new commands for environment setup, bridge , settlement deployment, and explorer management.

New Commands

Environment Management

wizard

  • Creates a new environment configuration with an interactive guided wizard
  • Example: protokit wizard

Bridge Operations

bridge deposit <tokenId> <fromKey> <toKey> <amount>

  • Deposits tokens to the bridge
  • Parameters:
    • tokenId - Token identifier
    • fromKey - Sender's private key (or environment variable name)
    • toKey - Recipient's public key (or environment variable name)
    • amount - Amount to deposit (in whole units)
  • Example: protokit bridge deposit 1 SENDER_KEY RECIPIENT_KEY 100

bridge redeem <tokenId> <toKey> <amount>

  • Redeems tokens from the bridge
  • Parameters:
    • tokenId - Token identifier
    • toKey - Recipient's public key (or environment variable name)
    • amount - Amount to redeem
  • Example: protokit bridge redeem 1 RECIPIENT_KEY 100

bridge withdraw <tokenId> <senderKey> <amount>

  • Withdraws tokens
  • Parameters:
    • tokenId - Token identifier
    • senderKey - Sender's private key (or environment variable name)
    • amount - Amount to withdraw
  • Example: protokit bridge withdraw 1 SENDER_KEY 100

Settlement Deployment

settlement deploy

  • Deploys settlement contracts
  • Example: protokit settlement deploy

settlement token-deploy <tokenSymbol> <feepayerKey> <receiverPublicKey> [mintAmount]

  • Deploys custom fungible tokens for settlement
  • Parameters:
    • tokenSymbol - Symbol for the token (e.g., "USDC")
    • feepayerKey - Private key for paying deployment fees
    • receiverPublicKey - Public key to receive minted tokens
    • [mintAmount] - Amount to mint initially (default: 0)
  • Example: protokit settlement token-deploy 1 FEEPAYER_KEY RECEIVER_KEY 1000

Lightnet Utilities

lightnet wait

  • Waits for the lightnet network to be ready before proceeding
  • No positional parameters
  • Example: protokit lightnet wait

lightnet faucet <publicKey>

  • Sends MINA from the lightnet faucet to an account
  • Parameters:
    • publicKey - Destination public key (or environment variable name)
  • Example: protokit lightnet faucet B62qnzbXQcUoQFnjvF4Kog6KfNsuuSoo7LSLvomPeak2CLvEYiUqT

lightnet initialize

  • Complete lightnet setup: waits for network, funds test accounts, deploys settlement
  • No positional parameters
  • Example: protokit lightnet initialize

Developer Tools

generate-keys [count]

  • Generates private/public key pairs for development
  • Parameters:
    • [count] - Number of key pairs to generate (default: 1)
  • Example: protokit generate-keys 5

explorer start

  • Starts the explorer UI
  • No positional parameters
  • Options:
    • -p, --port - Port to run on (default: 5003)
    • --indexer-url - GraphQL endpoint URL for the indexer
  • Example: protokit explorer start -p 3000 --indexer-url http://localhost:8081/graphql

All commands that interact with environment variable can be handled through two options:

Option 1: --env-path (File-based)

Loads environment variables from a .env file

protokit settlement deploy --env-path ./my-config/.env

Option 2: --set KEY=value

Passes environment variables directly as command-line arguments. Can be used multiple times.

protokit settlement deploy --set PROTOKIT_SETTLEMENT_CONTRACT_PRIVATE_KEY=EK... 

Option 3: --env {envName}

Passes environment name.

protokit settlement deploy --env sovereign 

closes #353

@stanlou stanlou requested a review from rpanic January 28, 2026 14:45
}
)
.command(
"lightnet:wait-for-network",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I had imagined this as a bit more reusable. Something like protokit run deposit where run says "execute a script" and deposit is the name of the script.
Where the script can either be one of our predefined scripts or a user-supplied one from the starter kit.
Now to realize this we have a few tools available that yargs gives us:
We can do nested commands: https://github.com/yargs/yargs/blob/main/example/nested.mjs
We can also let yargs go through the directories automatically and scaffold the command structure: https://github.com/yargs/yargs/blob/main/example/command_hierarchy.mjs
Some combination of this would be the most intuitive, create a mechanism to structure this on the framework side and then plug in the starter-kit side into the same mechanism

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stanlou stanlou self-assigned this Feb 2, 2026
@stanlou stanlou requested a review from rpanic February 2, 2026 16:38
@stanlou stanlou merged commit 51e3289 into develop Feb 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New starter kit structure (v3)

3 participants