# FAQ

<details>

<summary>Do I need Foundry installed before using KRNL CLI?</summary>

No. The CLI automatically checks for Foundry (forge, cast, anvil) during project initialization. If Foundry is missing or the version is below 1.0.0, it will install or update it automatically.

</details>

<details>

<summary>How does KRNL CLI detect project structure?</summary>

* Source contracts: Auto-detects `src/` or `contracts/`
* Output artifacts: Auto-detects `out/` or `artifacts/`
* Configuration: Reads `foundry.toml` if present

You can override these paths using the `-c`, `-o`, and `-p` flags with `krnl compile`.

</details>

<details>

<summary>How does deployment network detection work?</summary>

KRNL CLI prioritizes networks in this order:

1. Network specified via `--network` flag
2. RPC URLs defined in `.env` (e.g., `SEPOLIA_RPC_URL`)
3. `[rpc_endpoints]` section in `foundry.toml`
4. Defaults to `localhost:8545`

</details>

<details>

<summary>What is an attestor, and why do I need one?</summary>

Attestor is a component which will attest and also resolve the secrets in your DSL workflow. You create one using:

```bash
krnl create-attestor
```

</details>

<details>

<summary>What happens if my PRIVATE_KEY is missing the 0x prefix?</summary>

KRNL CLI automatically detects this and adds `0x` if needed during deployment.

</details>

<details>

<summary>Where are the compiled artifacts stored?</summary>

By default:

* Foundry outputs: `out/` or `artifacts/`
* Can be overridden with the `-o` flag in `krnl compile`

</details>

<details>

<summary>Can I create a custom project template?</summary>

Yes. Use the `-t, --template` flag with `krnl init`:

```bash
krnl init --name my-project --template custom-template
```

Your template must follow the KRNL project structure.

</details>

<details>

<summary>How do I update KRNL CLI?</summary>

```bash
npm install -g krnl-cli@latest
```

This will install the latest version globally.

</details>
