arkor init
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 pnpm create arkor my-app flow runs the same scaffolder one directory up).
By default, the command is partly interactive: it prompts for a project name and a starter template, then runs the package manager’s install step automatically (no confirmation prompt) unless --skip-install is set, and prompts before running git init. 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.
Synopsis
Options
--git and --skip-git are mutually exclusive; passing both throws.
Templates
All three pair the same small open-weight base (
unsloth/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:
- If the current directory is already inside a git repo, skip (and log it).
- If
--skip-gitis passed, skip. - If
--gitor-yis passed, run without asking. - In an interactive shell, prompt (default: yes).
- In a non-interactive shell with no flag, skip.
git commit --amend -S later.
In CI / non-interactive shells
Whenprocess.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 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.
Common errors
Examples
Interactive: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.