> For the complete documentation index, see [llms.txt](https://docs.krnl.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.krnl.xyz/krnl-cli/faq.md).

# 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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.krnl.xyz/krnl-cli/faq.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
