@rquanx/config-manager
v0.1.0
Published
CLI tool for managing configuration snapshots across multiple files and folders.
Readme
@rquanx/config-manager
A local CLI for managing multiple configuration snapshots across files and folders.
Install
pnpm add -g @rquanx/config-managerOr run it locally from the repo:
pnpm install
pnpm build
node dist/index.js --help
node dist/index.js --versionWhat It Does
config-manager lets you define a named group of paths, then save multiple item snapshots for that group and switch between them later.
Example use cases:
- switch between multiple proxy configs
- keep several app profile directories
- store local machine-specific config variants
All metadata and snapshots are stored under the current user's home directory in ~/.config-manager/.
Concepts
group: a named set of managed pathsitem: a snapshot for one groupactive item: the snapshot currently considered active for that group
When you create a group, the CLI automatically creates a default snapshot named default.
Commands
Create a group
config-manager create <group-name> <path1> <path2> ...Notes:
- relative paths are resolved from the current working directory
- paths are stored internally as absolute paths
- missing paths require confirmation, or
--forcein non-interactive usage - overlapping paths with another group require confirmation
Example:
config-manager create quanx ~/.config/quanx/profile.conf ~/.config/quanx/rulesAdd or overwrite a snapshot
config-manager group add <group-name> <item-name>If the item already exists, the CLI asks for confirmation before overwriting it.
Delete a group
config-manager group delete <group-name>
config-manager group delete <group-name> --forceThis removes the group metadata and all stored snapshots.
Delete one item
config-manager group delete <group-name> <item-name>
config-manager group delete <group-name> <item-name> --forceIf the deleted item is currently active, the CLI automatically switches the group to the first remaining item. Empty groups are allowed.
Switch to another item
config-manager switch <group-name> <item-name>
config-manager switch <group-name> <item-name> --forceBehavior:
- only the paths configured in the group are restored
- files and directories are overwritten from the target snapshot
- extra unmanaged files are left untouched
- if current files differ from the active item, the CLI asks whether to overwrite the current item, save a new item, or ignore current changes and switch anyway
--forceskips that prompt and switches immediately
Show all groups with active item
config-manager listShow the active item for one group
config-manager current <group-name>List groups or items
config-manager group list
config-manager group list <group-name>Behavior:
- without a name, lists all groups
- with a group name, lists all items in that group and marks the active item with
*
Snapshot Rules
- supports files and directories
- directories are saved recursively
- hidden files are included
- empty directories are ignored
- symlinks are stored and restored as symlinks, not as copied target content
Naming Rules
group and item names may only contain:
- letters
- numbers
-_
Non-Interactive Usage
If an operation needs confirmation and the CLI is running without a TTY, it fails with a message asking you to rerun with --force.
Development
pnpm install
pnpm lint
pnpm build
pnpm test
pnpm pack:check
pnpm publish --access public