# Directory Structure

When you create a Copper project using the Copper CLI, you'll get a directory structure similar to this -

```
cmd/
├─ app/
│  ├─ main.go
│  ├─ wire.go
pkg/
├─ app/
│  ├─ handler.go
│  ├─ router.go
│  ├─ wire.go
web/
```

All binaries are defined under the `cmd/` directory. By default, the `app` binary is present, and you are welcome to create more binaries here based on your project needs. If your project uses storage, there will be a `migrate` binary that runs database migrations.

Your application code lives under the `pkg/` directory. It is mostly freeform but it is recommended to keep the directory structure as flat as possible. To create new packages, use the Copper CLI's `copper scaffold:pkg <package>` command.

Depending on which template you chose to generate your project with, you may get a `web/` directory. This is where all HTML, CSS, and JS files go. The only Go file here is that enables the embedding of static data into the app binary - so you get a single binary to run your backend and frontend together.


---

# Agent Instructions: 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:

```
GET https://gocopper.gitbook.io/copper/the-basics/directory-structure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
