Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@quantpartners/pca) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
PCA CLI
PCA = Persistent Context Architecture.
Markdown files are the source of truth. RAG is the mandatory access layer. Agents must not read the full pca/ folder by default.
Install
npm install -g @quantpartners/pca
pca helpOnboarding
Recommended fresh-machine flow:
pca loginpca login is designed to:
- Open a browser login flow for PCA.
- Complete Clerk Google login through a hosted PCA backend.
- Store the PCA CLI auth session in
~/.pca/auth.json. - Ask for an OpenAI API key when needed.
- Validate the key against OpenAI.
- Store the key in global PCA credentials.
The CLI does not include Clerk secrets. A hosted PCA backend must provide the browser login and code exchange. Configure it with:
pca config set auth-base-url https://your-pca-auth-host.exampleor:
PCA_AUTH_BASE_URL=https://your-pca-auth-host.example pca loginGlobal Storage
PCA stores user-level configuration under:
~/.pca/
auth.json
config.json
secrets.jsonProject .pca/config.json stores only project data:
{
"projectName": "...",
"projectSlug": "...",
"vectorStoreId": "...",
"createdAt": "...",
"updatedAt": "..."
}Secrets are never stored in project files.
Local Context Memory
These commands are fully local and work offline.
Offline init
pca init works without PCA auth, an OpenAI API key, Clerk, a backend, or network access. In offline mode it creates a local-only PCA project. .pca/config.json keeps vectorStoreId: "local-only" until cloud/vector credentials are available. Vector store creation only happens after PCA auth and OpenAI credentials are configured.
pca status
pca commit "Documented checkout flow decision" --type decision
pca commit "Updated onboarding context"
pca logs
pca logs --last 10
pca logs --type decisionContext commits are stored in:
.pca/context-commits.jsonCommands
pca help
pca doctor
pca login
pca logout
pca whoami
pca setup
pca config
pca status
pca commit "record local context update"
pca commit "ADR: keep Markdown as source of truth" --type decision
pca logs
pca logs --last 10
pca logs --type decision
pca init
pca sync
pca query "project architecture"
pca task "crear hero mobile"
pca visual add ./example.png --type reference --note "landing reference"
pca closeOpenAI API Key
Use:
pca setupor as part of:
pca loginpca setup validates the key with real OpenAI API calls before saving it. Existing project .env files are only used for explicit migration:
Found OPENAI_API_KEY in project .env.
Move it to PCA global credentials? y/NPCA never deletes .env automatically.
Typical Flow
pca login
pca init
pca sync
pca task "crear hero mobile"
# paste .pca/last-task-context.md into Codex
pca close
pca syncDevelopment
npm install
npm run build
npm run typecheck
npm test
node dist/index.js help
node dist/index.js doctorWindows PowerShell may block npm .ps1 shims depending on ExecutionPolicy. Use npm.cmd:
npm.cmd install
npm.cmd run build
npm.cmd run typecheck
npm.cmd test
node dist\index.js help
node dist\index.js doctorLocal global install:
npm link
pca helpWindows CLI note:
- PowerShell may block npm
.ps1shims depending on ExecutionPolicy. Usepca.cmd help. - CMD can use
pca help.
Publish
npm run build
npm pack --dry-run
npm publish --access publicDo not publish until build and local install tests pass.
Limitations
- The Clerk browser login requires a hosted PCA backend. The CLI implements the callback/exchange pattern but does not ship backend secrets.
- OpenAI API keys are stored in
~/.pca/secrets.jsonas the current fallback. OS keychain integration is a future upgrade. - No web dashboard yet.
- No billing.
- No multiuser project sharing.
- No advanced Vector Store deduplication/replacement yet.
- Visual memory stores local images plus textual metadata in
pca/visual/visual-index.md; real multimodal analysis comes in v2.
References
- Clerk custom OAuth flows: https://clerk.com/docs/guides/development/custom-flows/authentication/oauth-connections
- OpenAI models list endpoint: https://platform.openai.com/docs/api-reference/models/list