LPM CLI

lpm init

Create a new package manifest for LPM.dev Registry or npm-compatible publishing.

lpm init [--lpm | --npm] [-y] [--name <name>] [--owner <owner>] [--no-agents]

Generates a minimal package.json for a new package, plus repository hints that make the project clearly managed by LPM CLI.

In an interactive terminal, prompts for the package target first: LPM.dev Registry package or npm-compatible package. With -y, skips every prompt and keeps the backward-compatible default: an LPM.dev Registry package named @lpm.dev/<owner>.package. Refuses to overwrite an existing package.json.

For LPM.dev Registry packages, the interactive owner prompt is pre-filled from your lpm whoami profile username (with a 3-second timeout to keep lpm init from blocking on the network). If you're offline or not logged in, the placeholder is the literal string username — change it before publishing.

Successful human output is a short status transcript:

✓ Wrote package.json
✓ Wrote AGENTS.md
✓ Added lpm.lockb binary to .gitattributes
✓ Done · initialized @lpm.dev/<owner>.<name>

Examples

mkdir my-pkg && cd my-pkg
lpm init                         # interactive walk
lpm init -y                      # default LPM.dev Registry package
lpm init --lpm -y --owner acme --name design-system
lpm init --npm -y --name @acme/widget
lpm init --npm -y --name widget --no-agents

What it writes

For LPM.dev Registry packages:

package.json
{
  "name": "@lpm.dev/<owner>.<name>",
  "version": "1.0.0",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "type": "module",
  "license": "MIT",
  "files": ["dist"],
  "packageManager": "lpm@<version>"
}

For npm-compatible packages:

package.json
{
  "name": "@scope/name",
  "version": "1.0.0",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "type": "module",
  "license": "MIT",
  "files": ["dist"],
  "packageManager": "lpm@<version>"
}
lpm.json
{
  "publish": {
    "registries": ["npm"]
  }
}

All targets also write an agent/tooling hint by default:

AGENTS.md
## Package Manager

This project uses lpm.

- Install dependencies with `lpm install`.
- Add source packages with `lpm add <package>`.
- Run scripts with `lpm run <script>`.
- Use `--json` when you need machine-readable output from lpm commands.
- CLI docs: https://cli.lpm.dev/

lpm init writes AGENTS.md only; it does not create provider-specific files such as CLAUDE.md.

And an entry in .gitattributes:

.gitattributes
lpm.lockb binary

Package name format

LPM CLI publishes under @lpm.dev/<owner>.<name> through LPM.dev Registry. init constructs the full name from your owner and name answers. You can publish under any owner you've claimed on LPM.dev Registry — see lpm publish for the upload flow.

Npm-compatible packages use the normal npm name contract, such as widget or @acme/widget. lpm init --npm writes publish.registries = ["npm"] in lpm.json so a later plain lpm publish targets npm instead of LPM.dev Registry.

packageManager is written as an LPM CLI environment signal for agents and tooling. Corepack does not currently install LPM CLI from that field.

Defaults under -y

FieldValue
targetlpm
ownerYour lpm whoami profile username, or the literal "username" if not logged in / offline
name"package" (literal — not the directory name)
version1.0.0
description(empty)

Pass --npm, --owner, or --name when those placeholder defaults aren't what you want.

Flags

FlagEffect
-y, --yesSkip prompts, use defaults
--lpmCreate an LPM.dev Registry package name
--npmCreate an npm-compatible package name and write npm publish config
--name <name>Package name to write. For --lpm, this can be the package half (widget), short form (owner.widget), or full form (@lpm.dev/owner.widget)
--owner <owner>LPM.dev Registry owner or org slug. Only valid with LPM.dev Registry packages
--no-agentsDo not create or update AGENTS.md

Plus the global flags. --json emits a brief envelope confirming what was created, including {success, target, name, version, path, package_manager, agents_status, lpm_json_status}.

See also