# `jadpo new`

Start a project.

Write a new project into a folder that doesn't exist yet or is empty: app.jadpo on this jadpo's release line, config.jadpo, the domains/, database/ and tests/ folders, and one small domain with a route, the action it runs, its line in policy.jadpo, its API record and a route test. It passes `jadpo check`, `jadpo fmt --check` and `jadpo test` as written. Beside them: an AGENTS.md saying what Jadpo is and where its docs are, a .gitignore keeping build/ out of git, and a .gitattributes keeping record diffs readable. A folder that holds anything is refused, and nothing in it is changed.

```text
jadpo new <name>
```

## Arguments

- `name`: The project's folder, made if it doesn't exist

## On every command

- `--json`: Print data for tools instead of text
- `--full`: Show everything a report shortens
- `--help`: Show every flag, with examples
- `--color <when>`: Choose when to use colour

`jadpo new --json` writes one JSON document to standard output instead of text, with the same exit code. The document has `schemaVersion`, `command` (`"new"`), `ok`, `data` (what the command produced, `null` when it failed) and `diagnostics` (each error with its `rule`, `reason`, `next` and `help`). A command that needs a terminal refuses `--json` and names the flags that do the same job.

## Examples

```text
# Start a project in a new folder
jadpo new my-app
# Start one in the empty folder you're in
jadpo new .
```

## Errors

- [`cli.new_arguments`](/docs/errors/cli.new_arguments.md): A `jadpo new` command names no project, or more than one
- [`toolchain.scaffold_destination_exists`](/docs/errors/toolchain.scaffold_destination_exists.md): You ran `jadpo new` or `jadpo package new` with the name of a file that already exists
- [`toolchain.scaffold_destination_not_empty`](/docs/errors/toolchain.scaffold_destination_not_empty.md): You ran `jadpo new` or `jadpo package new` on a folder that already has files in it, hidden files included
- [`toolchain.scaffold_name_invalid`](/docs/errors/toolchain.scaffold_name_invalid.md): You ran `jadpo new` with a path that doesn't end in a folder's name, such as `..` or `/`
- [`toolchain.scaffold_read_failed`](/docs/errors/toolchain.scaffold_read_failed.md): You ran `jadpo new` or `jadpo package new` on a path Jadpo can't look into, such as a folder you can't read or a path through a file
- [`toolchain.scaffold_write_failed`](/docs/errors/toolchain.scaffold_write_failed.md): You ran `jadpo new` or `jadpo package new`, and writing its files failed, usually because the folder they go in can't be written
