@kenkaiiii/gg-core
v5.92.0
Published
Provider-agnostic, UI-free shared foundation: model registry, auth, paths, telegram, voice
Downloads
7,237
Readme
@kenkaiiii/gg-core
The shared foundation under GG Coder's app and CLI. It depends only on @kenkaiiii/gg-ai, never on React, Ink or the agent loop.
Part of the GG Framework monorepo.
Install
npm i @kenkaiiii/gg-coreWhat's inside
| Area | Main exports |
| --------------- | ----------------------------------------------------------------------------------------- |
| Model registry | getModel, getAllModels, getModelsForProvider, getDefaultModel, getContextWindow |
| Thinking levels | getSupportedThinkingLevels, getMaxThinkingLevel, getDefaultThinkingLevel |
| Auth storage | AuthStorage (reads and writes ~/.gg/auth.json, refreshes OAuth tokens) |
| OAuth | Anthropic, OpenAI, Gemini, Kimi and xAI login flows |
| Local models | discoverLocalModels (Ollama, LM Studio, llama.cpp, vLLM, custom endpoints) |
| Paths | getAppPaths (every file under ~/.gg/) |
| Other | Logger, file lock, usage limits, Telegram, voice transcription, auto-update |
Two lighter subpath entries skip the rest of the package:
import { getModel } from "@kenkaiiii/gg-core/models";
import { getAppPaths } from "@kenkaiiii/gg-core/paths";Example
import { AuthStorage, discoverLocalModels, getModel } from "@kenkaiiii/gg-core";
const model = getModel("claude-sonnet-5-5");
console.log(model?.contextWindow);
const auth = new AuthStorage();
const token = await auth.resolveToken("anthropic");
const { models } = await discoverLocalModels();
console.log(models.map((m) => m.id));AuthStorage throws NotLoggedInError when a provider has no stored credentials.
License
AGPL-3.0-only. See LICENSE.
