src/: TypeScript source. Key areas:providers/(provider integrations),fetcher/,processor/,output/,config/,models/,commands/.build/anddist/: build outputs (library + CLI).config/: default provider configuration definitions.manual-templates/: provider JSON templates used by normalizers/writers.
- CLI (
src/cli.ts) loads config → instantiatesproviders/*→fetcher/pulls data →processor/normalizes/dedupes/validates →output/writes{provider}.jsonand aggregates. - Library build is configured via
vite.config.ts; CLI bundle viavite.cli.config.ts.
pnpm install: install dependencies.pnpm dev: run CLI in TS via ts-node (defaults tofetch-all).pnpm build: build library and CLI tobuild/using Vite.pnpm start: run built CLI (node build/cli.js fetch-all).pnpm clean: remove build artifacts.
Examples:
- Run specific providers:
node build/cli.js fetch-providers -p ppinfra,groq -o dist - Local binary after build:
./build/cli.js fetch-all
- Language: TypeScript targeting Node 18; prefer ES module syntax in
src/. - Linting: ESLint (
.eslintrc.json). Fix issues before PRs. - Indentation: 2 spaces; no trailing whitespace; end files with newline.
- Naming: PascalCase for classes/types, camelCase for vars/functions, kebab-case for folders/files (existing mixed names may remain until refactors).
- Exports: prefer named exports; keep module boundaries small and focused.
- Implement
Providerinsrc/providers/yourprovider.tswithfetchModels(),providerId(),providerName(). - Export in
src/providers/index.ts, register insrc/cli.ts#createProvider. - Add templates (if needed) under
manual-templates/, update docs/README sections, and manually verify via CLI commands.
- Use Conventional Commits (
feat:,fix:,docs:,chore:,ci:). Optional scopes:feat(providers): ...,ci(actions): .... - PRs must include: clear description, linked issues, test updates/new tests, and notes on config/template changes. Add screenshots/log snippets for CLI output when relevant.
- When you pick up a new feature or refactor, create a scratch file under
docs/namedfeat_<short-task-name>.md. - Use that file to break down subtasks, capture progress notes, and log any open questions while you work.
- Remove the tracking file once the task is complete or handed off so
docs/stays tidy.
- Provider defaults ship with the repo (
src/config/app-config.ts). - API keys: only
GROQ_API_KEYis needed for live fetching; models.dev covers OpenAI/Anthropic/OpenRouter/Gemini/etc. without extra credentials. - Never commit secrets.
- GitHub Actions fetch workflow runs on manual dispatch and release tags, builds, fetches models, and uploads JSON artifacts.
- Keep CI green: run
pnpm buildlocally before pushing.
{
"provider": "ppinfra",
"providerName": "PPInfra",
"lastUpdated": "2025-01-15T10:30:00Z",
"models": [
{
"id": "model-id",
"name": "Model Name",
"contextLength": 32768,
"maxTokens": 4096,
"vision": false,
"functionCall": true,
"reasoning": {
"supported": true,
"default": true
},
"type": "chat"
}
]
}- Templates: add/update under
manual-templates/*.jsonwhen normalizing names or capabilities. - Normalization:
processor/trims, dedupes, sorts; keep IDs stable across runs. - Validation:
output/json-validator.tsenforces schema before write; prefer failing fast.