Skip to main content

arkor init

Scaffolds src/arkor/index.ts, src/arkor/trainer.ts, arkor.config.ts, and a starter package.json in the current directory. Use this when you want to add Arkor to an existing repo (the Quickstart scaffolding flow runs the same scaffolder one directory up).

Synopsis

Options

--git and --skip-git are mutually exclusive; passing both throws.

Behavior

Default flow

By default, the command is partly interactive: it prompts for a project name, a starter template, and (when not in a git repo) whether to run git init, and only then starts the package manager’s install step (no confirmation prompt) unless --skip-install is set. The git init confirmation is surfaced before install so you can answer every prompt upfront and walk away while install runs unattended; the actual git init + initial commit still execute after install so the generated lockfile lands in the initial commit. If no package manager can be resolved (no --use-* flag and detection from npm_config_user_agent fails), the install step is skipped and the outro prints a manual install hint.

Templates

All three pair the same small open-weight base (gemma-4-E4B-it) with a curated public dataset on HuggingFace.

Package manager detection

When no --use-* flag is passed, the CLI inspects npm_config_user_agent to detect the package manager that invoked it (this is the standard mechanism corepack uses, so pnpm dlx, yarn dlx, bunx, etc. all work). If detection fails and no flag is passed, the install step is skipped and the outro prints a manual install hint.

Git policy

arkor init decides whether to run git init + initial commit by walking these rules in order:
  1. If the current directory is already inside a git repo, skip (and log it).
  2. If --skip-git is passed, skip.
  3. If --git or -y is passed, run without asking.
  4. In an interactive shell, prompt (default: yes).
  5. In a non-interactive shell with no flag, skip.
The interactive confirmation is shown before install (so you don’t sit at a prompt after a multi-minute <pm> install), but git init execution still runs after install so the lockfile generated by the package manager is part of the initial commit. If commit signing fails (e.g. GPG agent isn’t running), the CLI falls back to an unsigned commit and warns; you can re-sign with git commit --amend -S later.

CI / non-interactive shells

When process.stdout is not a TTY, or CI is set in the environment, arkor init is non-interactive: prompts skip with their default values and never block waiting for input. To get a deterministic scaffold from CI:
--yes accepts the project-name and template defaults (the directory’s basename and triage), --use-pnpm (or the matching --use-<pm>) short-circuits package-manager detection, and --skip-git opts out of git init. Pass --skip-install as well if your CI image already has node_modules/. If you forget --yes in a non-interactive shell, the command still completes (prompts use their defaults) but the experience is silent and easy to miss in logs. Prefer the explicit form above.

Errors

Examples

Interactive:
Accept defaults, skip install, skip git:
Pin the template and force the package manager:

What gets written

The scaffolder touches six paths. None of them overwrites existing user content: The CLI prints the file list as a “Files” note before installing, with an action (created / kept / patched / ok) per path so you can see exactly what changed.

See also