The Phylax Credible CLI (PCL) is a command-line interface for interacting with the Credible Layer. It allows developers to authenticate, build, test, and submit assertions to the Credible Layer dApp.
Rust >= 1.86 nightly
git
-
Clone the repository:
git clone https://github.com/phylaxsystems/pcl.git cd pcl
-
Build the CLI:
make build
-
The compiled binary will be available in the
target/release
directory. -
(Optional) Add to your PATH:
export PATH="$PATH:$(pwd)/target/release"
Before using most commands, you need to authenticate:
pcl auth [OPTIONS] <COMMAND>
Commands:
login Login to PCL using your wallet
logout Logout from PCL
status Check current authentication status
help Print this message or the help of the given subcommand(s)
Options:
--base-url <BASE_URL> Base URL for authentication service [env: AUTH_BASE_URL=] [default: https://credible-layer-dapp.pages.dev]
-h, --help Print help
When logging in:
- A URL and authentication code will be displayed
- Visit the URL in your browser
- Connect your wallet and approve the authentication
- CLI will automatically detect successful authentication
Build your assertion contracts:
pcl build [OPTIONS] [ASSERTIONS]...
Arguments:
[ASSERTIONS]... Names of assertion contracts to build
Options:
-h, --help Print help
Phorge is a Foundry-compatible development environment for assertions:
pcl phorge [OPTIONS] [ARGS]...
Arguments:
[ARGS]... Arguments to pass to the phorge command
Options:
-r, --root <ROOT_DIR> The root directory for the project.
-a, --assertions <ASSERTIONS_DIR> The directory containing assertions 'src' and 'test' directories.
-h, --help Print help
Common phorge subcommands:
pcl phorge test # Run tests
pcl phorge script # Run scripts
pcl store [OPTIONS] <ASSERTION>
Arguments:
<ASSERTION> Name of the assertion contract to submit
Options:
--url <URL> URL of the assertion-DA [env: PCL_DA_URL=] [default: http://localhost:3000]
-h, --help Print help
pcl submit [OPTIONS]
Options:
-d, --dapp-url <DAPP_URL> Base URL for the Credible Layer dApp API [default: https://credible-layer-dapp.pages.dev/api/v1]
-p, --project-name <PROJECT_NAME> Optional project name to skip interactive selection
-a, --assertion-name <ASSERTION_NAME>... Optional list of assertion names to skip interactive selection
-h, --help Print help
# Login
pcl auth login
# Verify status
pcl auth status
# Submit assertion
pcl store my_assertion
# Logout when done
pcl auth logout
# Build project
pcl build my_assertion
# Run tests
pcl phorge test
# Submit
pcl submit
To specify the assertions directory:
pcl --assertions-dir <PATH> phorge
Example:
pcl --assertions-dir mock-protocol/assertions phorge
Phorge expects the following directory structure:
assertions/
src/ # Source files
test/ # Test files with .t.sol extension
- Config file location:
~/.pcl/config.toml
- Stores authentication and submission history
- Automatically created on first use
- Error: Not authenticated: Run
pcl auth login
to authenticate - Error: Authentication expired: Run
pcl auth login
to refresh your authentication - Browser doesn't open: Manually visit the URL displayed in the terminal
- Error: Assertion not found: Ensure the assertion name is correct and exists in your project
- Compilation errors: Check your assertion code for syntax errors
- Error: Failed to submit: Ensure you're authenticated and have network connectivity
- Error: Project not found: Create a project in the Credible Layer dApp first
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request