Skip to content

Add varlock explain command and override indicators#560

Merged
theoephraim merged 1 commit intomainfrom
feature/cli-explain
Apr 7, 2026
Merged

Add varlock explain command and override indicators#560
theoephraim merged 1 commit intomainfrom
feature/cli-explain

Conversation

@theoephraim
Copy link
Copy Markdown
Member

@theoephraim theoephraim commented Apr 7, 2026

Summary

  • Override indicators in varlock load: When a config item value comes from a process.env override rather than its file-based definitions, the pretty output now shows a yellow indicator. This helps users understand why their resolver functions (e.g. op()) are not being called.
  • New varlock explain ITEM_KEY command: Shows detailed information about how a single config item is resolved - all definitions/sources in priority order, which is active, whether a process.env override is in effect (and what would be used without it), type info, decorators, and documentation links.

Motivation

Users were getting confused when setting a config item via op() but the function was never invoked because a process.env override was silently taking precedence.

Test plan

  • Run varlock load with a process.env override set - verify the override indicator appears
  • Run varlock explain ITEM_KEY for items with/without overrides
  • Run varlock explain ITEM_KEY for items with multiple definitions
  • Run varlock explain NONEXISTENT - verify clear error message
  • Existing tests pass (329 passed, 0 failed)

Screenshots

override indicators
image

explain output
image

Not 100% set on either of these, but probably a good start and can improve later

Generated with Claude Code

Users were confused when setting config items via `op()` but never seeing
the function run because a process.env override was taking precedence.

- Show override indicator (🟡) in `varlock load` pretty output when a
  value comes from process.env rather than file definitions
- Add `varlock explain ITEM_KEY` command showing all definitions, sources,
  active resolver, override status, decorators, and docs for an item

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 7, 2026

🦋 Changeset detected

Latest commit: 8ea0ba0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
varlock Minor
@varlock/astro-integration Major
@varlock/cloudflare-integration Major
@varlock/expo-integration Major
@varlock/nextjs-integration Major
@varlock/vite-integration Major
@varlock/1password-plugin Major
@varlock/aws-secrets-plugin Major
@varlock/azure-key-vault-plugin Major
@varlock/bitwarden-plugin Major
@varlock/dashlane-plugin Major
@varlock/google-secret-manager-plugin Major
@varlock/hashicorp-vault-plugin Major
@varlock/infisical-plugin Major
@varlock/keepass-plugin Major
@varlock/pass-plugin Major
@varlock/passbolt-plugin Major
@varlock/proton-pass-plugin Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 7, 2026

Open in StackBlitz

varlock

npm i https://pkg.pr.new/varlock@560

@varlock/astro-integration

npm i https://pkg.pr.new/@varlock/astro-integration@560

@varlock/cloudflare-integration

npm i https://pkg.pr.new/@varlock/cloudflare-integration@560

@varlock/expo-integration

npm i https://pkg.pr.new/@varlock/expo-integration@560

@varlock/nextjs-integration

npm i https://pkg.pr.new/@varlock/nextjs-integration@560

@varlock/vite-integration

npm i https://pkg.pr.new/@varlock/vite-integration@560

@varlock/1password-plugin

npm i https://pkg.pr.new/@varlock/1password-plugin@560

@varlock/aws-secrets-plugin

npm i https://pkg.pr.new/@varlock/aws-secrets-plugin@560

@varlock/azure-key-vault-plugin

npm i https://pkg.pr.new/@varlock/azure-key-vault-plugin@560

@varlock/bitwarden-plugin

npm i https://pkg.pr.new/@varlock/bitwarden-plugin@560

@varlock/dashlane-plugin

npm i https://pkg.pr.new/@varlock/dashlane-plugin@560

@varlock/google-secret-manager-plugin

npm i https://pkg.pr.new/@varlock/google-secret-manager-plugin@560

@varlock/hashicorp-vault-plugin

npm i https://pkg.pr.new/@varlock/hashicorp-vault-plugin@560

@varlock/infisical-plugin

npm i https://pkg.pr.new/@varlock/infisical-plugin@560

@varlock/keepass-plugin

npm i https://pkg.pr.new/@varlock/keepass-plugin@560

@varlock/pass-plugin

npm i https://pkg.pr.new/@varlock/pass-plugin@560

@varlock/passbolt-plugin

npm i https://pkg.pr.new/@varlock/passbolt-plugin@560

@varlock/proton-pass-plugin

npm i https://pkg.pr.new/@varlock/proton-pass-plugin@560

commit: 8ea0ba0

@theoephraim theoephraim requested a review from philmillman April 7, 2026 04:29
Copy link
Copy Markdown
Member

@philmillman philmillman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweet! 🚀

@theoephraim theoephraim merged commit 0ea6641 into main Apr 7, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants