aux4/init

Scaffold a new aux4 package (project skeleton, metadata and git init).

aux4/init creates a minimal aux4 package layout for you: it copies a package template, writes a package README, initializes a .aux4 manifest from the template, adds a .gitignore, and runs git init. This is useful when you want to start a new aux4 package quickly with consistent metadata and structure.

Main use cases:

  • Quickly scaffold a new aux4 package from the built-in template.
  • Pre-populate package metadata (scope, name, version, description, owner, license, tags, dependencies).
  • Initialize the package repository (git) and basic package files.

Installation

aux4 aux4 pkger install aux4/init

System Dependencies

This package requires system utilities that help process JSON and run template commands. Installers available for:

  • brew
  • linux

For more details, see system-installer.

Quick Start

Create a new package named mypkg under the scope example:

aux4 aux4 init --scope example --name mypkg --owner "Your Name" --license Apache-2.0

This creates a directory mypkg containing:

  • mypkg/package/.aux4 (manifest populated from template)
  • mypkg/package/README.md (scaffolded README with your description/license)
  • mypkg/.gitignore
  • initializes a git repository in mypkg

Initialize a package

This command is the primary entrypoint for scaffolding packages. It reads a small package template (misc/aux4.json) and writes a new package manifest and README based on the variables you provide.

Usage:

aux4 aux4 init --scope <scope> --name <name> --owner <owner> --license <license> [--version <version>] [--description "<text>"] [--tags "tag1,tag2"] [--dependencies "scope/pkg1,scope/pkg2"]

For command docs see aux4 aux4 init.

Metadata and variables

The init command accepts the following variables (those without defaults are required):

  • scope — The scope/namespace for the package (required).
  • name — The package name (required).
  • version — Initial version for the package (default: 0.0.1).
  • description — Short description for the package (default: empty).
  • owner — Owner of the package (required).
  • license — License identifier to apply (required).
  • tags — Comma-separated tags (optional).
  • dependencies — Comma-separated package dependencies (optional).

These variables populate the generated package manifest and README. Tags and dependencies may be passed as comma-separated lists; they will be split into arrays in the generated .aux4.

Examples

Basic scaffold

Create a minimal package called demo under the scope acme:

aux4 aux4 init --scope acme --name demo --owner "Jane Developer" --license Apache-2.0

This writes demo/package/.aux4 (based on the template), demo/package/README.md with the package description and license link, copies .gitignore into demo/ and runs git init inside the new package.

Add tags and dependencies

Create a package and set tags and dependencies in one command:

aux4 aux4 init --scope example --name http-client --owner "Dev Team" --license Apache-2.0 --tags "http,client,network" --dependencies "aux4/logger,aux4/releaser"

Tags become a JSON array in the generated .aux4. Dependencies are split on commas and written into the package manifest as an array.

Custom version and description

Create a package with a specific initial version and a short description:

aux4 aux4 init --scope tools --name cli-utils --owner "CLI Team" --license Apache-2.0 --version 0.1.0 --description "Small utilities for CLI workflows"

This sets version to 0.1.0 in the generated cli-utils/package/.aux4 and adds the provided description to cli-utils/package/README.md.

What the command produces

After running init you should expect:

  • <name>/package/.aux4 — manifest populated from the template (scope, name, version, description, dependencies, tags).
  • <name>/package/README.md — a small README containing title, description and license link.
  • <name>/.gitignore — copied from the template (contains entries like *.zip, local-test).
  • A git repository initialized in <name>.

Troubleshooting

If jq (or equivalent JSON tooling) is not available on your system, the scaffold step that patches the template may fail. Install a supported system package manager listed above (brew or linux-packages) and ensure jq is on your PATH.

If you receive permission errors when creating files, make sure you have write access to the current directory.

License

This package is licensed under the Apache License.

See LICENSE for details.