Skip to content

l-mbert/confik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

confik

confik is a small CLI that temporarily stages files from .config/ into the project root while a command runs, then cleans them up afterward.

Install

npm install -D @confik/cli
# or
yarn add -D @confik/cli
# or
pnpm add -D @confik/cli
# or
bun add -D @confik/cli

Usage

confik
confik yarn dev
confik -- vite build
confik --dry-run npm run test
confik --clean

Behavior

  • Looks for .config/ in the current working directory.
  • Copies eligible files into the project root before running your command.
  • If no command is provided, enters standalone mode and keeps files staged until interrupted (Ctrl+C).
  • Never overwrites existing root files (they are skipped).
  • Removes staged files on exit (including SIGINT, SIGTERM, SIGHUP).
  • Adds a temporary block to .git/info/exclude so staged files are not accidentally committed.
  • Uses a lock file in .config/ to serialize concurrent runs in the same directory.

Config

Create .config/confik.json:

{
  "$schema": "https://raw.githubusercontent.com/l-mbert/confik/refs/heads/main/confik.schema.json",
  "exclude": ["**/*.local", "private/**"],
  "registry": true,
  "registryOverride": ["vite.config.ts"],
  "gitignore": true,
  "vscodeExclude": false
}
  • exclude: glob patterns (relative to .config/) to skip.
  • registry: enable the built-in registry skip list.
  • registryOverride: force-copy patterns that would otherwise be skipped by the registry.
  • gitignore: enable temporary .git/info/exclude handling (default true).
  • vscodeExclude: temporarily add staged files to .vscode/settings.json files.exclude (default false). JSONC is supported and comments are preserved.

Registry

The built-in registry lives in registry.json and contains filenames that are considered safe to leave in .config/ without copying. You can disable it with --no-registry or override with registryOverride.

Cleanup

If the process crashes, you can run:

confik --clean

This removes any leftover staged files from .config/.confik-manifest.json and clears any confik blocks in .git/info/exclude.

Build (local dev)

go build -o dist/confik

Build platform packages (for publishing)

pnpm run build:binaries

This produces native binaries in packages/ for darwin/arm64, darwin/x64, linux/x64, and win32/x64.

About

Get rid of config files polluting your root directory

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors