# `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
- `--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`](../errors/cli.new_arguments.md): New command has invalid arguments
- [`toolchain.scaffold_destination_exists`](../errors/toolchain.scaffold_destination_exists.md): Scaffold destination is an existing file
- [`toolchain.scaffold_destination_not_empty`](../errors/toolchain.scaffold_destination_not_empty.md): Scaffold destination directory is not empty
- [`toolchain.scaffold_name_invalid`](../errors/toolchain.scaffold_name_invalid.md): Project destination has no valid name
- [`toolchain.scaffold_read_failed`](../errors/toolchain.scaffold_read_failed.md): Scaffold destination could not be inspected
- [`toolchain.scaffold_write_failed`](../errors/toolchain.scaffold_write_failed.md): Project scaffold file could not be written
