← Catalog

@victor-software-house/pi-credential-vault

Managed-provider credential vault for Pi with built-in age, keychain, and passthrough backends

Extension

Install

Install with PiG

pig install npm:@victor-software-house/pi-credential-vault

Install with Pi

pi install npm:@victor-software-house/pi-credential-vault
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 1.0.0 (README.md). PiG does not review it.

pi-credential-vault

Pi extension package that moves managed-provider credential storage out of plaintext ~/.pi/agent/auth.json and into a selectable backend.

Status

Implemented now:

  • built-in age, keychain, and passthrough backends
  • request-time credential injection through provider overrides
  • OAuth login and refresh interception for supported providers
  • /vault commands for setup, import, verify, show, providers, path, and help
  • direct settings.json configuration plus a minimal /vault settings panel
  • CI validation and npm publishing through GitHub Actions and semantic-release

Not implemented yet:

  • runtime backend plugin registration
  • shared storage integration with pi-multicodex
  • dedicated migration and bootstrap workflows
  • full settings UX for all config fields

Use PLAN.md for the detailed implementation plan and ROADMAP.md for milestone order.

Install

pi install npm:@victor-software-house/pi-credential-vault

Quick start

# Open pi
pi

# For the default age backend, generate a local identity
/vault setup

# Import existing credentials from auth.json into the active backend
/vault import

# Verify the backend and inspect managed providers
/vault verify
/vault show

# Export credentials to another backend or rewrite current backend
/vault export keychain
/vault export age        # same-backend rewrite: re-encrypts with current recipients

If you use pi-multicodex, exclude openai-codex from vault management until shared storage integration is implemented.

What the extension does

  1. Loads pi-credential-vault settings from ~/.pi/agent/settings.json
  2. Creates the configured built-in backend
  3. Re-registers managed providers through pi.registerProvider()
  4. Resolves credentials from the active backend before each request
  5. Stores OAuth login and refresh results back into the backend
  6. Exposes /vault commands for setup and inspection

Architecture

AreaFilesResponsibility
Entrypointindex.ts, src/extension.tsLoad controller, register commands, expose minimal event-bus API, update session status
Typessrc/types.tsCredential entry types, backend interface, config types, extension API types
Built-in backendssrc/backends/*.tsEncrypted file storage, OS keychain storage, passthrough compatibility storage
Backend registrysrc/backends/registry.tsCreate and cache built-in backend instances
Configurationsrc/config/*.tsDefaults, settings file I/O, normalization, settings panel
Provider integrationsrc/providers/*.tsProvider mirroring, request-time API key resolution, OAuth wrapping
Commandssrc/commands/vault-command.ts, src/commands/parse-args.ts/vault command family and argument parsing
Servicessrc/services/credential-transfer.tsCredential transfer between backends
Testssrc/__tests__/*.test.tsBackend, registry, command parsing, transfer, and stream helper validation

Built-in backends

age (default)

Credentials are encrypted with the age-encryption JavaScript library and stored in ~/.pi/agent/vault.age.json by default.

  • safe to commit as ciphertext
  • supports additional recipients in config
  • reads the local identity from ~/.config/pi-vault/age.txt or PI_VAULT_AGE_KEY

Recipient changes are applied by running /vault export age, which re-reads and re-writes every credential with the current recipient list.

keychain

Credentials are stored in the platform keychain through cross-keychain.

  • macOS: Keychain
  • Linux: Secret Service
  • Windows: Credential Manager

This backend is suitable for single-machine local storage, not for syncing encrypted files between machines.

passthrough

Credentials are read from and written to Pi's native auth.json format.

Use this for backward compatibility or as a fallback when a secure backend is unavailable.

Configuration

Settings live under the pi-credential-vault key in ~/.pi/agent/settings.json.

{
  "pi-credential-vault": {
    "backend": "age",
    "managedProviders": "all",
    "excludeProviders": ["openai-codex"],
    "age": {
      "vaultPath": "~/.pi/agent/vault.age.json",
      "identityPath": "~/.config/pi-vault/age.txt",
      "recipients": ["age1abc..."]
    },
    "keychain": {
      "service": "pi-credential-vault"
    }
  }
}
SettingTypeNotes
backendage | keychain | passthroughActive built-in backend
managedProviders"all" | string[]Which provider IDs are managed by the extension
excludeProvidersstring[]Providers intentionally left to other extensions or native Pi behavior
age.vaultPathstringOptional encrypted vault file path
age.identityPathstringOptional age identity path
age.recipientsstring[]Additional age recipients
keychain.servicestringService name used in the OS keychain

Commands

CommandCurrent behavior
/vaultOpen the settings panel
/vault showShow active backend status, credential count, and managed providers
/vault verifyCheck backend health and stored credential count
/vault providersShow managed and excluded provider IDs with scope
/vault setupGenerate an age identity for the default backend
/vault importImport credentials from auth.json into the active backend
/vault export [target]Export credentials to a target backend. Same-backend export rewrites all entries (forces re-encryption for age).
/vault pathShow backend-specific file or service locations
/vault helpShow command summary

Operator notes

pi-multicodex coexistence

Today, pi-credential-vault and pi-multicodex should not both manage openai-codex.

{
  "pi-credential-vault": {
    "excludeProviders": ["openai-codex"]
  }
}

Shared storage integration remains planned work.

Fallback behavior

If the configured backend is unavailable at startup, the extension currently leaves providers on native Pi behavior and reports the problem through session status and /vault verify.

Status indicator

The repository contains a placeholder status-line module, but current status reporting is performed directly from src/extension.ts during session events.

Development

Install dependencies and run the current validation commands:

pnpm install
pnpm typecheck
pnpm test
npm pack --dry-run

Notes:

  • There is currently no repository source-lint script.
  • CI runs commitlint, typecheck, test, and npm pack --dry-run.
  • Releases are produced by semantic-release from .github/workflows/publish.yml.

Release and documentation rules

  • README.md describes implemented behavior only.
  • ROADMAP.md tracks milestone order, not pre-assigned semantic versions.
  • PLAN.md contains detailed implementation sequencing and design constraints.
  • AGENTS.md contains repository-specific contributor and automation rules.
  • package.json is part of the operational contract for scripts, package metadata, publish shape, and extension entrypoints.
  • When command surface, config shape, release flow, packaging, or architecture changes, update all relevant files together, including package.json when manifest-facing behavior changes.

Known limitations

  • The backend registry only supports built-in backends.
  • The settings panel currently edits only a subset of config.
  • There is no multi-step migration workflow yet (/vault export copies but does not clean up source data).
  • PLAN.md — detailed implementation plan and phased delivery
  • ROADMAP.md — ordered milestone view
  • AGENTS.md — contributor and automation guidance