npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@asudbring/loki-profile-manager

v0.1.22

Published

Cross-platform installer wrapper for the Loki Profile Manager CLI.

Readme

Loki Profile Manager

Loki Profile Manager is a local Go CLI for managing profile-specific dotfiles, app settings, AI-tool skills, shell prompt state, and secret-rendered templates from a synced Loki store.

Status

  • Repository visibility: public.
  • Current npm release: v0.1.22; latest full Windows app/manual dogfood validation: v0.1.7.
  • Current implementation: profile store setup, machine registration, migration/adoption bootstrap, guarded profile switching, pre-switch local-change capture, obsolete managed-target cleanup, safe stale managed-state repair, local active-profile marker, Windows redirected Documents support, snapshot inspection/restore, sync conflict cleanup, skill folder/zip/markdown import, plugin bundle import MVP, Infisical readiness/setup UX, and Bubble Tea TUI MVP.
  • Current commands: status, store status, store discover, store migrate, store use, store init, store unset, verify, switch, sync, tui, update, import-skill, import-plugin, secrets, doctor, snapshots list, snapshots show, snapshots restore, machine register, machine status, migrate repo, migrate local, and adopt.
  • Future work: Azure Key Vault/other secret providers.
  • License: MIT.

What it does

Loki treats a synced filesystem folder as profile source of truth. The store contains YAML manifests, profile files, templates, skills, and a machine registry. Each machine keeps local SQLite state for the configured store path, active profile/buckets, managed target hashes, snapshots, and recovery guards.

Activation is guarded by unsafe overwrite protection. Loki refuses to replace unmanaged local files or directories unless you explicitly move those blockers to a machine-local backup with switch --backup-unmanaged --yes. A target must be missing, already managed by Loki, adopted/migrated, or backed up before activation can overwrite it.

Before switching, Loki checks copied managed targets from the currently active profile for local edits. If a tool changed a copied settings file, loki switch reports the local change and blocks real activation until you resolve it or rerun with --capture-local to write safe copy-mode changes back to the store. Symlink targets already write directly to the store. Render outputs are never captured because they can contain secrets.

After a successful switch, Loki prunes obsolete managed targets that are not part of the newly active profile. Cleanup is hash-guarded: unchanged Loki-managed targets are removed and their state records are deleted; changed obsolete targets block and require manual capture, removal, or adoption.

Install

Recommended install path:

npm install -g @asudbring/loki-profile-manager
loki --version
loki doctor

Windows PowerShell uses the same npm command:

npm install -g @asudbring/loki-profile-manager
loki --version
loki doctor

Update an npm install in place:

loki update

loki update installs @asudbring/loki-profile-manager@latest with npm. Human CLI commands check npm at most once every 24 hours and print a stderr notice when a newer Loki version is available. Set LOKI_NO_UPDATE_CHECK=1 to disable the startup check.

If Windows cannot find loki after npm install, open a new shell and ensure the npm global bin directory is on PATH (usually %APPDATA%\npm). Node/npm also require C:\Program Files\nodejs on PATH.

Release binary archives, script installers, source builds, and Docker validation are documented in docs/INSTALL.md.

First-run paths

Use one of these workflows after installing the binary.

| Scenario | Start here | |---|---| | No profiles yet; starting from a blank store | docs/PROFILES.md | | Fresh machine or already-migrated store | docs/INSTALL.md#first-run-path-fresh-machine | | Existing machine with local profiles/settings not migrated | docs/INSTALL.md#first-run-path-existing-machine-with-profiles-not-migrated | | AI/operator install and validation | docs/ai-ops/install.ai.md |

Short fresh-machine example:

STORE="$HOME/OneDrive/LokiProfileManager"
loki store discover --manual "$STORE"
loki store use "$STORE"        # existing valid store with profiles
# or: loki store init "$STORE" # new empty store; add/migrate/import profiles before verify/switch
loki machine register --allow-profile work --allow-bucket content-dev
loki verify work content-dev
loki switch work content-dev --dry-run
loki switch work content-dev --yes
loki status --verbose

Short existing-machine example:

STORE="$HOME/OneDrive/LokiProfileManager"
loki store use "$STORE"
loki machine register --allow-profile work --allow-bucket content-dev
loki migrate local --profile work --dry-run
loki migrate local --profile work --yes
loki verify work content-dev
loki switch work content-dev --dry-run
loki switch work content-dev --yes

When switching away from a profile after a managed copy target changed locally and you want to preserve that change in the store:

loki switch work content-dev --capture-local --yes

--capture-local writes safe managed copy-mode local changes back to the store before switching. If a fresh install blocks on unmanaged files and the Loki store should win, use loki switch work content-dev --backup-unmanaged --yes to move those blockers to a local backup directory and switch.

Quick command examples

Update Loki from the latest npm build:

loki update

Show local status, active profile, and managed target count:

loki status
loki --verbose status

Discover, configure, or move a store:

loki store discover
loki store discover --manual /path/to/LokiProfileManager
loki store init /path/to/LokiProfileManager
loki store use /path/to/LokiProfileManager
loki store status
loki store migrate --to "$HOME/Dropbox/LokiProfileManager" --provider dropbox --dry-run
loki store migrate --to "$HOME/Dropbox/LokiProfileManager" --provider dropbox --yes
# If dry-run reports cloud-only files, materialize them explicitly:
loki store migrate --to "$HOME/Dropbox/LokiProfileManager" --provider dropbox --yes --hydrate

store migrate copies the current valid store to a hidden staging sibling, validates it, promotes it to the missing/empty destination, and rewires local SQLite state unless --copy-only is set. It reports progress by default during --yes, fails fast on cloud-only source files unless --hydrate is provided, retargets active Loki-managed symlinks after rewire, and never deletes the old store. Use --cleanup to remove interrupted staging directories and --capture-local if safe copy-mode local changes must be written back before copying.

Register this machine:

loki machine register --allow-profile work --allow-bucket content-dev --allow-bucket azure
loki machine status

Verify a profile and buckets:

loki verify work
loki verify work content-dev azure
loki verify work content-dev azure --json

Dry-run and activate a profile:

loki switch work content-dev --dry-run
loki switch work content-dev --yes
loki switch work content-dev --capture-local --yes
loki switch work content-dev --backup-unmanaged --yes

Migrate or adopt existing local files before the first real switch:

loki migrate local --profile work --dry-run
loki migrate local --profile work --yes
loki migrate repo ~/github/legacy-profile-repo --profile work --dry-run
loki adopt ~/.gitconfig --profile work --dry-run
loki adopt ~/.gitconfig --profile work --yes

Prepare Infisical-backed render secrets without printing values:

loki secrets configure infisical
loki secrets --infisical
loki secrets login
loki secrets status
loki secrets check OPENAI_API_KEY

loki secrets configure infisical prompts for Infisical Universal Auth details, validates them before writing, and writes only local ~/.config/infisical/.env config. If validation fails, the existing env file stays unchanged. Run loki secrets status afterward to verify readiness. loki secrets --infisical remains noninteractive for automation from existing safe local inputs. Output lists key names/readiness only, never values.

Run local diagnostics and safely repair stale managed-target SQLite state:

loki doctor
loki doctor --json
loki doctor --repair-managed-state
loki doctor --repair-managed-state --write-safe-files

loki doctor --repair-managed-state refreshes stale local managed-target records only when the local target and current manifest source are equivalent. --write-safe-files additionally canonicalizes safe local files before updating state. Semantic repair is implemented for JSON; other files must be byte-identical unless Loki can regenerate the canonical merge output safely.

Inspect and restore local activation snapshots:

loki snapshots list
loki snapshots show <snapshot-id>
loki snapshots restore <snapshot-id> --dry-run
loki snapshots restore <snapshot-id> --target ~/.config/git/ignore --dry-run
loki snapshots restore <snapshot-id> --target ~/.config/git/ignore --yes

Full snapshot restore without --target requires a matching prior dry-run guard and an interactive confirmation phrase: RESTORE <snapshot-id>.

Launch the terminal UI:

loki
loki tui
loki --store /path/to/LokiProfileManager tui

The TUI MVP covers dashboard diagnostics, persistent store setup, machine registration, Infisical setup/status, profile views, guarded profile switching, guarded sync conflict cleanup, and snapshot list/show/restore dry-run handoff. Restore writes still happen only through the guarded CLI restore flow.

Documentation

Development

Requires Go 1.23 or later.

git clone https://github.com/asudbring/loki-profile-manager.git
cd loki-profile-manager
go test ./...
go vet ./...
go build -o loki ./cmd/loki
./loki --help

If the host lacks Go but has Docker:

docker run --rm -v "$PWD:/work" -w /work golang:1.23 go test ./...

On Git Bash for Windows, set MSYS_NO_PATHCONV=1 for Docker volume paths that start with a Windows drive letter.

License

MIT. See LICENSE.