# `mix nbpr.new`
[🔗](https://github.com/jimsynz/nbpr/blob/v0.2.0/lib/mix/tasks/nbpr.new.ex#L1)

Scaffolds a new NBPR package under `./packages/nbpr_<name>/`.

    mix nbpr.new <name> [options]

`<name>` must be lowercase, start with a letter, and contain only
`[a-z0-9_]` (e.g. `jq`, `dnsmasq`, `containerd`).

By default the generator looks the package up in the Buildroot tree
pinned by the workspace's `nerves_system_br` dep and pre-fills the
scaffolded `mix.exs` and module with the upstream version, SPDX
licences, homepage, and a starter description. Run `mix deps.get` for a
target first so `deps/nerves_system_br/` exists; on the first run the
BR tarball (~50 MB) is cached under `$NERVES_ARTIFACTS_DIR/nbpr/`
(defaulting to `~/.local/share/nerves/nbpr/`).

## Options

  * `--no-lookup` — skip BR metadata lookup; emit a stub the user fills
    in. Use for vendored packages (`br_external_path:`) or air-gapped
    workflows.
  * `--br-package <name>` — Buildroot package name when it differs from
    the Hex package name. The Hex name `<name>` becomes `nbpr_<name>`
    regardless.
  * `--licenses "<id>[,<id>...]"` — override the SPDX licences. Required
    when BR's `<NAME>_LICENSE` strings aren't valid SPDX identifiers
    (e.g. `GPL-2.0+`); the generator prints similarity-ranked
    suggestions to choose from.

## What gets generated

The generator owns the package-name → module-name mapping (`nbpr_foo` →
`NBPR.Foo`). It writes a `mix.exs` with full Hex metadata, a
`lib/nbpr/<name>.ex` containing the `NBPR.BrPackage` `use` block, a
README, and a smoke test.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
