src/
├── bin.ts # CLI entry point (yargs command routing)
├── cli.config.ts # App configuration (model, URLs)
├── run.ts # Installer orchestration entry point
├── lib/
│ ├── agent-runner.ts # Core agent execution
│ ├── agent-interface.ts # Claude Agent SDK interface
│ ├── installer-core.ts # Headless installer core (XState)
│ ├── config.ts # Framework detection config
│ ├── constants.ts # Integration types, shared constants
│ ├── credential-store.ts # OAuth credential storage (keyring + file fallback)
│ ├── config-store.ts # Environment config storage (keyring + file fallback)
│ ├── api-key.ts # API key resolution (env var → flag → config)
│ ├── workos-api.ts # Generic WorkOS REST API client
│ ├── credential-proxy.ts # Token refresh proxy for long sessions
│ ├── ensure-auth.ts # Startup auth guard
│ └── adapters/ # CLI and dashboard adapters
├── commands/
│ ├── env.ts # workos env (add/remove/switch/list)
│ ├── organization.ts # workos organization (create/update/get/list/delete)
│ ├── user.ts # workos user (get/list/update/delete)
│ ├── install.ts # workos install
│ ├── install-skill.ts # workos install-skill
│ ├── auth-status.ts # workos auth status
│ ├── login.ts # workos auth login
│ └── logout.ts # workos auth logout
├── dashboard/ # Ink/React TUI components
├── nextjs/ # Next.js installer agent
├── react/ # React SPA installer agent
├── react-router/ # React Router installer agent
├── tanstack-start/ # TanStack Start installer agent
├── vanilla-js/ # Vanilla JS installer agent
└── utils/
├── table.ts # Terminal table formatter
├── clack-utils.ts # CLI prompts
├── debug.ts # Logging with redaction
├── redact.ts # Credential redaction
└── ... # Additional utilities
# Install dependencies
pnpm install
# Build
pnpm build# Build, link globally, and watch for changes
pnpm dev
# Test installer in another project
cd /path/to/test/nextjs-app
workos dashboard
# Test management commands
workos env add sandbox sk_test_xxx
workos organization list
workos user list# Build
pnpm build
# Clean and rebuild
pnpm clean && pnpm build
# Format code
pnpm format
# Check types
pnpm typecheck
# Run tests
pnpm test
pnpm test:watch- Target: ES2022
- Module: NodeNext (ESM)
- Strict mode enabled
- JSX: react-jsx (for Ink/React dashboard)
- Create
src/your-framework/your-framework-installer-agent.ts - Define
FrameworkConfigwith metadata, detection, environment, UI - Export
runYourFrameworkInstallerAgent(options)function - Add to
Integrationenum inlib/constants.ts - Add detection logic to
lib/config.ts - Wire up in
run.ts
See nextjs/nextjs-installer-agent.ts as reference.
The installer prompt in agent-runner.ts tells Claude to:
- Fetch live docs from workos.com
- Fetch SDK README from GitHub/npm
- Follow official documentation
To change instructions, edit buildIntegrationPrompt() in lib/agent-runner.ts.
Credential redaction is in utils/redact.ts. Add patterns:
export function redactCredentials(obj: any): any {
// Add new patterns here
const redacted = JSON.stringify(obj).replace(/sk_test_[a-zA-Z0-9]+/g, (match) => `sk_test_...${match.slice(-3)}`);
return JSON.parse(redacted);
}Manual testing:
- Run installer in a test app:
workos dashboard - Check logs at
~/.workos/logs/workos-{timestamp}.log - Verify integration works in test app
What to test:
- Framework detection
- API key masking (should show
*****) - Log redaction (keys show as
sk_test_...X6Y) - SDK installation
- File creation
- Environment variables
- UI components
Automated eval framework for testing installer skills across frameworks and project states.
pnpm eval # Run all scenarios
pnpm eval --framework=nextjs # Single framework
pnpm eval --quality # Include LLM quality grading
pnpm eval:history # List recent runs
pnpm eval:diff <id1> <id2> # Compare runsSee tests/evals/README.md for full documentation.
Verbose logs:
workos --debugCheck logs:
tail -f ~/.workos/logs/workos-{timestamp}.logSee README for user-facing docs.