> ## Documentation Index
> Fetch the complete documentation index at: https://phylaxsystems-docs-project-incidents.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# pcl Reference

> Reference documentation for all `pcl` commands, options, and parameters

<Note>
  New to `pcl`? Start with [Store and Submit Assertions](/credible/store-submit-assertions) to understand the workflow.
</Note>

## Global Options

```bash theme={null}
Options:
  -j, --json      Output in JSON format
  -h, --help      Print help
  -V, --version   Print version
```

## Commands

Commands are listed in the order they are usually used in the assertion development workflow.

### `auth`

Manage authentication with your Credible Layer dApp account.

```bash theme={null}
Authenticate `pcl` with your Credible Layer dApp account

Usage: 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:
  -u, --auth-url <AUTH_URL>  Base URL for authentication service [env: PCL_AUTH_URL=] [default: https://app.phylax.systems]
  -h, --help                 Print help
```

#### `auth login`

Login to `pcl` using your wallet. Opens a browser window for wallet authentication.

#### `auth logout`

Logout from `pcl` and clear local authentication token.

#### `auth status`

Check current authentication status.

### `test`

Run tests for your assertions.

```bash theme={null}
Run tests

Usage: pcl test [OPTIONS] [PATH]

Options:
  -h, --help  Print help (see more with '--help')

Common options:
  -v, --verbosity...            Verbosity level of the log messages. Pass multiple times to increase verbosity (e.g. -v, -vv, -vvv)
  -q, --quiet                   Do not print log messages
      --match-path <GLOB>       Only run tests in source files matching the specified glob pattern
      --match-test <REGEX>      Only run test functions matching the specified regex pattern
      --match-contract <REGEX>  Only run tests in contracts matching the specified regex pattern
```

<Note>
  `pcl test` uses Forge underneath for test execution. Note that `pcl` uses an older version of Forge, so newer Forge features may not be available. The Forge version is periodically updated to include new features. See the [Forge test documentation](https://book.getfoundry.sh/reference/forge/forge-test) for all available options.
</Note>

### `build`

Build contracts using [`phorge`](/credible/glossary#phorge).

```bash theme={null}
Build contracts using `phorge`

Usage: pcl build [OPTIONS]

Options:
      --root <ROOT>  Root directory of the project
  -h, --help         Print help
```

<Note>
  `pcl build` will be run automatically if the project hasn't been built yet when using `pcl store`.
</Note>

### `store`

Submit [assertion bytecode](/credible/glossary#assertion-bytecode) and source code to the [Assertion DA](/credible/glossary#assertion-da-data-availability).

```bash theme={null}
Submit the Assertion bytecode and source code to be stored by the Assertion DA of the Credible Layer

Usage: pcl store [OPTIONS] <ASSERTION_CONTRACT> [CONSTRUCTOR_ARGS]...

Arguments:
  <ASSERTION_CONTRACT>   Name of the assertion contract to build and flatten
  [CONSTRUCTOR_ARGS]...  Constructor arguments for the assertion contract.
                                Format: <ARG0> <ARG1> <ARG2>

Options:
  -u, --da-url <DA_URL>   URL of the assertion-DA server [env: PCL_DA_URL=]
                          [default: https://da.phylax.systems]
      --root <ROOT>       Root directory of the project
  -h, --help              Print help (see more with '--help')
```

**Examples:**

```bash theme={null}
# Store assertion contract without constructor arguments
pcl store MyAssertionContract

# Store assertion with constructor arguments
pcl store MyAssertion 0xADDRESS_OF_SMART_CONTRACT

# Store assertion with multiple constructor arguments
pcl store MyAssertion 0xADDRESS arg1 arg2
```

<Tip>
  Constructor arguments must be provided in the same order as defined in your assertion contract. When submitting later, use the exact same arguments.
</Tip>

### `submit`

Submit [assertions](/credible/glossary#assertion) to the [Credible Layer dApp](/credible/glossary#credible-dapp).

```bash theme={null}
Arguments for submitting assertions to the Credible Layer dApp

Usage: pcl submit [OPTIONS] [ASSERTION_CONTRACT] [CONSTRUCTOR_ARGS]...

Arguments:
  [ASSERTION_CONTRACT]   Name of the assertion to submit (when submitting a single assertion)
  [CONSTRUCTOR_ARGS]...  Constructor arguments for the assertion

Options:
  -u, --api-url <API Endpoint>   Base URL for the Credible Layer dApp API [env: PCL_API_URL=] [default: https://app.phylax.systems/api/v1]
  -p, --project-name <PROJECT>   Optional project name to skip interactive selection
  -a, --assertion <ASSERTION>    Assertion in format 'Name(arg1,arg2)'. Use multiple -a flags for multiple assertions.
  -h, --help                     Print help (see more with '--help')
```

**Examples:**

```bash theme={null}
# Interactive mode (prompts you to select which stored assertions to submit and which project to submit them to)
pcl submit

# Submit a single assertion contract using positional arguments
pcl submit MyAssertionContract arg0 arg1 arg2

# Submit a single assertion contract with constructor arguments with -a flag
pcl submit -a 'MyAssertionContract(0xADDRESS_OF_SMART_CONTRACT)' -p my-project

# Submit assertion contract without constructor arguments
pcl submit -a 'MyAssertionContract' -p my-project

# Submit multiple assertion contracts using multiple -a flags
pcl submit -a 'AssertionContract1(arg0,arg1)' -a 'AssertionContract2(arg0,arg1)' -p my-project
```

<Note>
  If you have stored several assertions that you want to submit to the same project, it's fastest to use the interactive mode for selecting the project and assertions.
</Note>

### `config`

Manage your `pcl` configuration including authentication token, pending assertions for submission, and project settings.

```bash theme={null}
Manage configuration

Usage: pcl config <COMMAND>

Commands:
  show    Display the current configuration
  delete  Delete the current configuration
  help    Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help
```

#### `config show`

Display the current configuration stored in `~/.pcl/config.toml`.

#### `config delete`

Delete the current configuration file.

## Environment Variables

### `PCL_AUTH_URL`

Base URL for authentication service. Default: `https://app.phylax.systems`

```bash theme={null}
export PCL_AUTH_URL=https://custom-auth-url.com
pcl auth login
```

### `PCL_DA_URL`

URL of the [Assertion DA](/credible/glossary#assertion-da-data-availability) server. Default: `https://da.phylax.systems`

```bash theme={null}
export PCL_DA_URL=https://custom-da-url.com
pcl store MyAssertion
```

### `PCL_API_URL`

Base URL for the [Credible Layer dApp](/credible/glossary#credible-dapp) API. Default: `https://app.phylax.systems/api/v1`

```bash theme={null}
export PCL_API_URL=https://custom-api-url.com/api/v1
pcl submit -a 'MyAssertion' -p my-project
```

## Configuration File

Configuration is stored in `~/.pcl/config.toml` and includes:

* Authentication token
* Pending assertions for submission (assertions that have been stored but not yet submitted)
* Project settings

You can view the configuration with `pcl config show` or delete it with `pcl config delete`.

## Next Steps

<CardGroup cols={2}>
  <Card title="Store and Submit" icon="upload" href="/credible/store-submit-assertions">
    Learn how to use pcl in your workflow
  </Card>

  <Card title="Quick Start Guide" icon="rocket" href="/credible/pcl-quickstart">
    Step-by-step tutorial for your first assertion
  </Card>

  <Card title="Installation" icon="download" href="/credible/credible-install">
    Install pcl
  </Card>

  <Card title="Deploy with dApp" icon="browser" href="/credible/deploy-assertions-dapp">
    Deploy assertions to protect your contracts
  </Card>
</CardGroup>
