# Configuration Where `niksi` writes files, which environment variables it reads, what the lockfile contains, and what a project's `niksi.json` sets. Commands and flags are in [commands.md](commands.md). ## Scope A skill is installed in one scope. | scope | flag | skills live in | lockfile | | --- | --- | --- | --- | | project | `-p` | `/.niksi/skills` | `/niksi-lock.json` | | global | `-g` | `~/.local/share/niksi/skills` | `~/.config/niksi/niksi-lock.json` | The project root is the nearest parent directory that holds `niksi-lock.json`, `.agents`, `.claude`, `.opencode`, `.kiro`, `.cline`, `.qwen`, or `.git`. The search stops at your home directory. Without a marker, the current directory is the root. `nik add` asks for the scope. Every other command defaults to project scope. Running from your home directory selects global scope. ## Agents An agent is a tool that loads skills. `niksi` writes a relative symlink from a skills directory that the agent reads to the skill in the scope's `skills` directory, or a real copy when you pass `--copy`. | id | skills directory | project | global | | --- | --- | --- | --- | | `universal` | Universal | `.agents/skills` | `~/.agents/skills` | | `claude` | Claude Code | `.claude/skills` | `$CLAUDE_HOME/skills` or `~/.claude/skills` | | `opencode` | OpenCode | `.opencode/skills` | `$XDG_CONFIG_HOME/opencode/skills` or `~/.config/opencode/skills` | | `kiro` | Kiro | `.kiro/skills` | `~/.kiro/skills` | | `cline` | Cline | `.cline/skills` | `~/.cline/skills` | | `qwen` | Qwen Code | `.qwen/skills` | `~/.qwen/skills` | `--agent` takes an id from the table above or an agent name from the table below. An id selects its own directory, so `--agent opencode` means `.opencode/skills`. A name resolves to the first directory listed for that agent, so `--agent cursor` means `.agents/skills`. `niksi` detects an agent when its config directory, project directory, or binary exists, and only in a scope where the agent reads a directory from the table. | agent | `--agent` name | reads in project scope | reads in global scope | detected when | | --- | --- | --- | --- | --- | | Claude Code | `claude` | `claude` | `claude` | `$CLAUDE_HOME` or `~/.claude` exists, or `.claude` exists in the project | | Codex | `codex` | `universal` | `universal` | `$CODEX_HOME` or `~/.codex` exists, `/etc/codex` exists, or `codex` is on `PATH` | | Cursor | `cursor` | `universal`, `claude` | `universal`, `claude` | `~/.cursor` exists, or `.cursor` exists in the project | | Gemini CLI | `gemini` | `universal` | `universal` | `~/.gemini` exists, `.gemini` exists in the project, or `gemini` is on `PATH` | | GitHub Copilot | `copilot` | `universal`, `claude` | `universal` | `~/.copilot` exists, or `copilot` is on `PATH` | | Windsurf | `windsurf` | `universal` | `universal` | `~/.codeium/windsurf` exists, or `.windsurf` exists in the project | | Amp | `amp` | `universal`, `claude` | `universal`, `claude` | `$XDG_CONFIG_HOME/amp` or `~/.config/amp` exists, or `amp` is on `PATH` | | Antigravity | `antigravity` | `universal` | none | `~/.gemini/antigravity` exists | | Factory Droid | `droid` | `universal` | `universal` | `~/.factory` exists, `.factory` exists in the project, or `droid` is on `PATH` | | Roo Code | `roo` | `universal` | `universal` | `~/.roo` exists, or `.roo` exists in the project | | Zed | `zed` | `universal` | `universal` | `$XDG_CONFIG_HOME/zed` or `~/.config/zed` exists, or `zed` is on `PATH` | | Junie | `junie` | `universal` | `universal` | `~/.junie` exists, or `.junie` exists in the project | | Kilo Code | `kilo` | `universal` | none | `~/.kilo` or `~/.kilocode` exists, or `.kilo` exists in the project | | Warp | `warp` | `universal`, `claude`, `opencode` | `universal`, `claude`, `opencode` | `~/.warp` exists, or `warp` is on `PATH` | | Augment Code | `augment` | `universal`, `claude` | `universal`, `claude` | `~/.augment` exists, or `.augment` exists in the project | | Trae | `trae` | `universal` | none | `~/.trae` exists, or `.trae` exists in the project | | Kiro | `kiro` | `kiro` | `kiro` | `~/.kiro` exists, `.kiro` exists in the project, or `kiro` is on `PATH` | | Cline | `cline` | `cline`, `claude` | `cline` | `~/.cline` exists, or `.cline` exists in the project | | Qwen Code | `qwen` | `qwen` | `qwen` | `~/.qwen` exists, or `.qwen` exists in the project | | OpenCode | `opencode` | `universal`, `claude`, `opencode` | `universal`, `claude`, `opencode` | `$XDG_CONFIG_HOME/opencode` or `~/.config/opencode` exists, `.opencode` exists in the project, or `opencode` is on `PATH` | Without `--agent`, `niksi` asks which agents to link to, one row per skills directory. It preselects the cover: the smallest set of directories that every detected agent reads. Rows a detected agent reads sit under `Detected`, with those agents named beside them. The rest sit under `Other`. Without a terminal it uses the remembered choice, else the cover, else `claude`. When a detected agent reads two or more of the chosen directories, `niksi` warns that the agent loads skills twice and names the directories you can drop. A directory can be dropped when every detected agent still reads one of the remaining ones. When every chosen directory is needed, there is no warning. Editing a linked skill changes it for every linked agent. `niksi` won't write to a skills directory that lands inside its data directory (`NIKSI_HOME`, or `~/.local/share/niksi` by default, see [Paths](#paths)). In project scope, it also won't write to one that lands inside a global skills directory from the table above. This covers a project `.claude` that links to `~/.claude`, a project inside a global skills directory, and `-p` run from your home directory, where `.claude/skills` is `~/.claude/skills`. `add`, `install`, `enable`, `remove`, and `disable` check every skills directory they will touch first, and exit `1` before they change any skill, so one refused directory stops the whole selection. When a symlink causes the overlap, the error names it so you can remove it. Otherwise, run project installs from a project outside that directory, and point global agent directories outside the data directory. In project scope, `.niksi/.gitignore` keeps the skill directories out of Git. Links in the agents' skills directories are hidden with `.git/info/exclude`, in a block that `niksi` rebuilds after every write. Commit `niksi-lock.json`. Copies made with `--copy` can be committed. ## Path copies `nik add --copy --path ` writes each selected skill to `/`. The destination root uses project scope. This command does not select or remember agents. Path copies remain visible to Git. `niksi` resolves relative input from the project root, even when the command runs in a subdirectory. It accepts absolute input only inside the project root. `niksi` records a normalized project-relative `copyPath`. It rejects traversal and symlinks that escape the project. `niksi` repeats this check when it reads the lockfile. `niksi` manages a named skill directory only when the lockfile contains a matching entry. `update` and an approved `install` may replace that directory. `remove` deletes the skill directory. It keeps the destination root and its other contents. ## Remembered choices When you pick a scope or agents in a prompt, or pass `-g`, `-p`, or `--agent`, `niksi` remembers the choice in `config.json` and preselects it next time. A new choice replaces the remembered one. A config file that fails to parse is ignored. ```json { "scope": "project", "agents": ["claude", "universal"] } ``` ## Project configuration Commit a `niksi.json` at the project root, next to `niksi-lock.json`, to set the cooldown for the project, the sources its skills may come from, and whether a warn finding needs approval. `niksi` reads it in project scope only. `add`, `update`, `install`, `enable`, and `audit` read it. Global scope ignores it. ```json { "minimumReleaseAge": 7, "policy": { "sources": { "github": ["osrim", "anthropics"], "git": ["https://git.example.com/team/skills"] }, "denyWarn": true } } ``` Every key is optional. | key | type | meaning | | --- | --- | --- | | `minimumReleaseAge` | whole number, `0` or more | The [cooldown](commands.md#cooldown) in days for `add` and `update` in this project. Without it, the cooldown is 3 days. `--min-release-age` overrides it for one run. `0` turns it off. | | `policy` | object | The project policy. `add`, `adopt`, `update`, `install`, and `enable` check it before they write anything. | | `policy.sources` | object | The Git sources that skills may come from. Leave it out to allow every source. An empty object allows local sources only. | | `policy.sources.github` | array of strings | GitHub organizations or users. A skill from a repository on `github.com` that one of them owns is allowed, over HTTPS or SSH. Names match in any case. | | `policy.sources.git` | array of strings | Whole repository URLs. A skill whose `source` in `niksi-lock.json` is exactly one of them is allowed. | | `policy.denyWarn` | boolean | `true` makes `add`, `adopt`, and `update` treat a warn finding like a critical one: it needs approval in a terminal, and `--yes` doesn't accept it. `audit` exits `3` on a warn finding, the same code as for a critical one. Default `false`. See [security-scan.md](security-scan.md#severities). | Local sources are always allowed. A `github` entry matches only a plain repository path: each path segment holds letters, digits, `.`, `_`, or `-`, and none is `.` or `..`. Any other form of a GitHub URL is refused, so list it under `git` if you need it. A `file://` URL is a Git source, so list it under `git`. `git` doesn't normalize URLs: `https://git.example.com/team/skills.git` doesn't match `https://git.example.com/team/skills`. Copy the `source` from `niksi-lock.json`. When the source of an enabled skill isn't allowed, `nik install` names each such skill, installs nothing, and exits `1`. `nik enable` checks the skills you select the same way, enables nothing, and exits `1`. `install` doesn't check disabled skills, since it doesn't restore them. `nik add` checks the source before it fetches anything. When the source isn't allowed, it adds nothing and exits `1`. `nik update` leaves out each skill whose source isn't allowed, updates the others, and exits `3`. Its report lists the skill under **Needs a person**. See [commands.md](commands.md#update). A `niksi.json` that isn't a JSON object, has a value of the wrong type, or has a key that this table doesn't list stops the command with exit `2`. The error names the file and the key: ```text /work/repo/niksi.json: unknown key policy.source ``` ## Paths `niksi` follows the XDG base directory specification. | path | default | variable | | --- | --- | --- | | global skills | `~/.local/share/niksi/skills` | `XDG_DATA_HOME` | | global lockfile | `~/.config/niksi/niksi-lock.json` | `XDG_CONFIG_HOME` | | store | `~/.local/share/niksi/store` | `XDG_DATA_HOME` | | config | `~/.config/niksi/config.json` | `XDG_CONFIG_HOME` | | update-check cache | `~/.cache/niksi/last-update-check` | `XDG_CACHE_HOME` | `NIKSI_HOME` replaces the data and config roots at once. `NIKSI_HOME=/tmp/x` puts the global skills, the global lockfile, the store, and the config under `/tmp/x`. It does not move the cache. ### Moving an existing global lockfile The global lockfile is `$XDG_CONFIG_HOME/niksi/niksi-lock.json`, or `~/.config/niksi/niksi-lock.json` when `XDG_CONFIG_HOME` is unset or relative. If that file does not exist, `niksi` keeps using the legacy lockfile at `$XDG_DATA_HOME/niksi/niksi-lock.json`, which defaults to `~/.local/share/niksi/niksi-lock.json`. Reads and writes keep using the legacy file until you move it. When both files exist, `niksi` uses the config file. Confirm that the config file does not already exist, then migrate by moving the legacy file. The commands assume that each XDG variable is unset or absolute: ```sh config_home=${XDG_CONFIG_HOME:-"$HOME/.config"} data_home=${XDG_DATA_HOME:-"$HOME/.local/share"} mkdir -p "$config_home/niksi" mv "$data_home/niksi/niksi-lock.json" "$config_home/niksi/niksi-lock.json" ``` Do not copy the file. Leaving both paths populated makes the legacy file inactive and lets the two files drift. `NIKSI_HOME` users do not need to migrate because both paths resolve to `$NIKSI_HOME/niksi-lock.json`. Path variables take absolute paths, and `~` is not expanded. A relative `HOME`, `NIKSI_HOME`, or `CLAUDE_HOME` stops the command with an error. A relative XDG variable counts as unset, so its default applies, as the [XDG Base Directory specification](https://specifications.freedesktop.org/basedir-spec/latest/) requires. `niksi` treats a relative `CODEX_HOME` the same way and uses `~/.codex`. The store is a download cache. A lockfile entry installs without the network when the store holds its content, and installed skills do not depend on it. `nik prune` deletes unrecorded store entries. It keeps every entry that the global lockfile or the current project's lockfile records. See [commands.md](commands.md#prune). ## Lockfile `niksi-lock.json` records every installed skill in a scope. `nik install` recreates the installation from it. Each entry records the skill's source, path, revision, integrity, and placement, what its review accepted, and whether it is disabled. [lockfile.md](lockfile.md) defines every field, how the integrity is computed, and how lockfile versions change, with a complete example. ## Environment variables | variable | effect | | --- | --- | | `NIKSI_HOME` | Root for data and config. See [Paths](#paths). | | `XDG_DATA_HOME`, `XDG_CONFIG_HOME`, `XDG_CACHE_HOME` | Standard XDG roots. | | `CLAUDE_HOME` | Global Claude directory. Default `~/.claude`. | | `CODEX_HOME` | Codex directory, used to detect Codex. Default `~/.codex`. | | `NO_COLOR` | Disable color. | | `FORCE_COLOR` | Enable color when stdout is not a terminal. | | `CI`, `NO_UPDATE_NOTIFIER`, `NIKSI_NO_UPDATE_NOTIFIER` | Disable the update notice and its release check. | Color is also off when stdout is not a terminal or `TERM=dumb`. Without a terminal, spinners print one plain line per step with no cursor codes. ## Update notice Every `nik` run that exits `0` prints a notice on stderr, after its own output, while the installed version is older than the latest GitHub release. This includes `nik`, `nik --version`, `nik list`, and `nik remove`. Help for a single command, such as `nik add --help`, prints no notice. The notice names `brew upgrade` for a Homebrew install and `npm install -g niksi` for an npm install. Otherwise it links to the latest release. It stops on the first run after you upgrade. `niksi` asks GitHub for the latest release once a day and stores the check time and the version it found in the update-check cache. Runs between checks reuse the cached version. A failed request is silent and leaves the cache untouched, so the next run checks again. A cache file that does not parse, does not match the expected shape, holds the legacy bare timestamp, or records a check time in the future counts as no prior check, so the run asks GitHub again. No request is made and no notice is printed when stdout is not a terminal, when `--json` is set, when `niksi` runs from a Git checkout, or when one of the variables above is set. A command that fails prints no notice.