From c54e768016418b242f23777ebfce983ebe13d73f Mon Sep 17 00:00:00 2001 From: Jiayuan Date: Sun, 1 Feb 2026 02:28:43 +0800 Subject: [PATCH] docs: update credential setup --- .env.example | 52 ---------------------------------------- CLAUDE.md | 13 ++++++---- README.md | 67 ++++++++++++++++++++++++++++++++++++---------------- 3 files changed, 55 insertions(+), 77 deletions(-) delete mode 100644 .env.example diff --git a/.env.example b/.env.example deleted file mode 100644 index 17135cb6..00000000 --- a/.env.example +++ /dev/null @@ -1,52 +0,0 @@ -# ============================================================================= -# LLM Provider Configuration -# ============================================================================= -# Copy this file to .env and fill in your values: -# cp .env.example .env -# -# Then load before running: -# source .env && pnpm dev:console -# ============================================================================= - -# Default LLM provider (e.g., openai, anthropic, deepseek, kimi-coding, groq, mistral) -export LLM_PROVIDER= - -# --- OpenAI --- -export OPENAI_API_KEY= -export OPENAI_BASE_URL= -export OPENAI_MODEL= - -# --- Anthropic --- -export ANTHROPIC_API_KEY= -export ANTHROPIC_BASE_URL= -export ANTHROPIC_MODEL= - -# --- DeepSeek --- -export DEEPSEEK_API_KEY= -export DEEPSEEK_BASE_URL= -export DEEPSEEK_MODEL= - -# --- Kimi (Moonshot) --- -export MOONSHOT_API_KEY= -export MOONSHOT_BASE_URL= -export MOONSHOT_MODEL= - -# --- Groq --- -export GROQ_API_KEY= -export GROQ_BASE_URL= -export GROQ_MODEL= - -# --- Mistral --- -export MISTRAL_API_KEY= -export MISTRAL_BASE_URL= -export MISTRAL_MODEL= - -# --- Together --- -export TOGETHER_API_KEY= -export TOGETHER_BASE_URL= -export TOGETHER_MODEL= - -# --- Google --- -export GOOGLE_API_KEY= -export GOOGLE_BASE_URL= -export GOOGLE_MODEL= diff --git a/CLAUDE.md b/CLAUDE.md index abee3f9f..4388f9b2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -73,15 +73,18 @@ Frontend (web:3001 / desktop) - **Backend**: NestJS 11, Socket.io, Pino logging - **CLI bundling**: esbuild → `bin/` directory -## Environment Setup +## Credentials Setup + +Use JSON5 credential files instead of `.env`: ```bash -cp .env.example .env -# Set LLM_PROVIDER and corresponding API keys -# Supported: openai, anthropic, deepseek, kimi-coding, groq, mistral, together, google -# .env is loaded automatically via --env-file in all dev/agent scripts +pnpm credentials:cli init ``` +This creates: +- `~/.super-multica/credentials.json5` (LLM providers + built-in tools) +- `~/.super-multica/skills.env.json5` (skills / plugins / integrations) + ## Atomic Commits After completing any task that modifies code, you MUST create atomic commits before ending the conversation. diff --git a/README.md b/README.md index 1843707b..dfa8e373 100644 --- a/README.md +++ b/README.md @@ -35,45 +35,72 @@ skills/ # Bundled skills (commit, code-review) pnpm install ``` -### Environment Configuration +### Credentials Configuration -The Agent requires LLM provider credentials. Copy the example and fill in your values: +The Agent reads credentials from JSON5 files (no `.env` required). + +Create empty templates: ```bash -cp .env.example .env -# Edit .env with your API keys +pnpm credentials:cli init ``` -Example `.env` for OpenAI: +This creates: -```bash -export LLM_PROVIDER=openai -export OPENAI_API_KEY=sk-xxx -export OPENAI_BASE_URL=https://api.openai.com/v1 -export OPENAI_MODEL=gpt-4o +- `~/.super-multica/credentials.json5` — core config (LLM providers + built-in tools) +- `~/.super-multica/skills.env.json5` — dynamic keys (skills / plugins / integrations) + +Example `credentials.json5` (OpenAI): + +```json5 +{ + version: 1, + llm: { + provider: "openai", + providers: { + openai: { + apiKey: "sk-xxx", + baseUrl: "https://api.openai.com/v1", + model: "gpt-4o" + } + } + }, + tools: { + brave: { apiKey: "brv-..." } + } +} ``` -Load the environment before starting services that use the Agent: +Example `skills.env.json5` (dynamic keys): + +```json5 +{ + env: { + LINEAR_API_KEY: "lin-...", + SLACK_BOT_TOKEN: "xoxb-..." + } +} +``` + +Start services directly (no `source .env`): ```bash -# Hub Console (requires LLM env vars) -source .env && pnpm dev:console - -# Agent CLI -source .env && pnpm agent:cli "hello" - -# Gateway (no LLM env vars needed) +pnpm dev:console +pnpm agent:cli "hello" pnpm dev:gateway ``` -See `.env.example` for all supported providers (OpenAI, Anthropic, DeepSeek, Kimi, Groq, Mistral, etc.). +Optional overrides: + +- `SMC_CREDENTIALS_PATH` — custom path for `credentials.json5` +- `SMC_SKILLS_ENV_PATH` — custom path for `skills.env.json5` ### Configuration Priority Each setting is resolved in order (first match wins): 1. **CLI argument** — `--provider`, `--model`, `--api-key`, `--base-url` -2. **Environment variable** — `LLM_PROVIDER`, `OPENAI_MODEL`, `OPENAI_API_KEY`, `OPENAI_BASE_URL`, etc. +2. **Credentials file** — `credentials.json5` (`llm.provider` + `llm.providers[provider]`) 3. **Session metadata** — restored from previous session 4. **Default** — `kimi-coding` provider with `kimi-k2-thinking` model