@erllecta/coding-helper 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/ergpt.d.ts +12 -0
- package/dist/api/ergpt.js +48 -0
- package/dist/api/types/generated.d.ts +3629 -0
- package/dist/api/types/generated.js +5 -0
- package/dist/app.d.ts +8 -0
- package/dist/app.js +157 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +56 -0
- package/dist/components/ApiKeyInput.d.ts +7 -0
- package/dist/components/ApiKeyInput.js +47 -0
- package/dist/components/AssistantDetail.d.ts +10 -0
- package/dist/components/AssistantDetail.js +125 -0
- package/dist/components/AssistantList.d.ts +9 -0
- package/dist/components/AssistantList.js +86 -0
- package/dist/components/MainMenu.d.ts +14 -0
- package/dist/components/MainMenu.js +48 -0
- package/dist/components/McpSetup.d.ts +7 -0
- package/dist/components/McpSetup.js +109 -0
- package/dist/components/ModeSelect.d.ts +7 -0
- package/dist/components/ModeSelect.js +26 -0
- package/dist/components/ReviewScreen.d.ts +12 -0
- package/dist/components/ReviewScreen.js +77 -0
- package/dist/components/SuccessScreen.d.ts +9 -0
- package/dist/components/SuccessScreen.js +24 -0
- package/dist/components/ToolSelect.d.ts +9 -0
- package/dist/components/ToolSelect.js +48 -0
- package/dist/store.d.ts +12 -0
- package/dist/store.js +52 -0
- package/dist/tools/claude-code.d.ts +19 -0
- package/dist/tools/claude-code.js +108 -0
- package/dist/tools/opencode.d.ts +26 -0
- package/dist/tools/opencode.js +99 -0
- package/dist/types.d.ts +67 -0
- package/dist/types.js +1 -0
- package/package.json +83 -0
- package/readme.md +87 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface Assistant {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
prompt: string;
|
|
6
|
+
temperature: number;
|
|
7
|
+
tags?: string[];
|
|
8
|
+
kb_id?: string;
|
|
9
|
+
private: boolean;
|
|
10
|
+
created_at: string;
|
|
11
|
+
updated_at: string;
|
|
12
|
+
}
|
|
13
|
+
export interface AssistantTool {
|
|
14
|
+
id: string;
|
|
15
|
+
active: boolean;
|
|
16
|
+
created_at: string;
|
|
17
|
+
tool: {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
} | null;
|
|
22
|
+
config: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
export interface AssistantWithTools extends Assistant {
|
|
25
|
+
tools: AssistantTool[];
|
|
26
|
+
}
|
|
27
|
+
export interface KnowledgeBase {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
config: Record<string, unknown>;
|
|
32
|
+
created_at: string;
|
|
33
|
+
updated_at: string;
|
|
34
|
+
user_id: string;
|
|
35
|
+
}
|
|
36
|
+
export interface PaginatedResponse<T> {
|
|
37
|
+
result: T[];
|
|
38
|
+
total: number;
|
|
39
|
+
pagination: {
|
|
40
|
+
cursor?: string;
|
|
41
|
+
has_more: boolean;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export type SearchGroup = 'public' | 'personal' | 'system';
|
|
45
|
+
export interface StoreConfig {
|
|
46
|
+
apiKey?: string;
|
|
47
|
+
assistantId?: string;
|
|
48
|
+
assistantName?: string;
|
|
49
|
+
targets?: Tool[];
|
|
50
|
+
}
|
|
51
|
+
export type Tool = 'claude-code' | 'opencode';
|
|
52
|
+
export type Screen = 'api-key-input' | 'main-menu' | 'mode-select' | 'assistant-list' | 'assistant-detail' | 'tool-select' | 'review' | 'success' | 'mcp-setup';
|
|
53
|
+
export interface McpServerConfig {
|
|
54
|
+
type: 'sse';
|
|
55
|
+
url: string;
|
|
56
|
+
headers: Record<string, string>;
|
|
57
|
+
}
|
|
58
|
+
export interface ClaudeUserConfig {
|
|
59
|
+
mcpServers?: Record<string, McpServerConfig>;
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
}
|
|
62
|
+
export interface OpenCodeMcpServerConfig {
|
|
63
|
+
type: 'remote';
|
|
64
|
+
url: string;
|
|
65
|
+
headers: Record<string, string>;
|
|
66
|
+
enabled?: boolean;
|
|
67
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@erllecta/coding-helper",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CLI tool for configuring coding assistants (Claude Code, OpenCode) with ER-GPT integration",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Никита",
|
|
8
|
+
"email": "mrmamongo@gmail.com"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"ergpt-coding-helper": "./dist/cli.js"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"cli",
|
|
15
|
+
"coding",
|
|
16
|
+
"assistant",
|
|
17
|
+
"claude",
|
|
18
|
+
"opencode",
|
|
19
|
+
"er-gpt"
|
|
20
|
+
],
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://git.infra.er-gpt.ru/ergpt/code-helper.git"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://git.infra.er-gpt.ru/ergpt/code-helper/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://git.infra.er-gpt.ru/ergpt/code-helper",
|
|
29
|
+
"type": "module",
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=16"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc",
|
|
35
|
+
"dev": "tsc --watch",
|
|
36
|
+
"test": "prettier --check . && xo && ava",
|
|
37
|
+
"api:generate": "openapi-typescript https://api.dev.infra.er-gpt.ru/openapi.json -o src/api/types/generated.ts"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"conf": "^15.1.0",
|
|
44
|
+
"ink": "^4.1.0",
|
|
45
|
+
"ink-select-input": "^5.0.0",
|
|
46
|
+
"ink-text-input": "^5.0.1",
|
|
47
|
+
"meow": "^11.0.0",
|
|
48
|
+
"openapi-typescript": "^7.13.0",
|
|
49
|
+
"react": "^18.2.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@sindresorhus/tsconfig": "^3.0.1",
|
|
53
|
+
"@types/react": "^18.0.32",
|
|
54
|
+
"@vdemedes/prettier-config": "^2.0.1",
|
|
55
|
+
"ava": "^5.2.0",
|
|
56
|
+
"chalk": "^5.6.2",
|
|
57
|
+
"eslint-config-xo-react": "^0.27.0",
|
|
58
|
+
"eslint-plugin-react": "^7.32.2",
|
|
59
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
60
|
+
"ink-testing-library": "^3.0.0",
|
|
61
|
+
"prettier": "^2.8.7",
|
|
62
|
+
"ts-node": "^10.9.1",
|
|
63
|
+
"typescript": "^5.0.3",
|
|
64
|
+
"xo": "^0.53.1"
|
|
65
|
+
},
|
|
66
|
+
"ava": {
|
|
67
|
+
"extensions": {
|
|
68
|
+
"ts": "module",
|
|
69
|
+
"tsx": "module"
|
|
70
|
+
},
|
|
71
|
+
"nodeArguments": [
|
|
72
|
+
"--loader=ts-node/esm"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"xo": {
|
|
76
|
+
"extends": "xo-react",
|
|
77
|
+
"prettier": true,
|
|
78
|
+
"rules": {
|
|
79
|
+
"react/prop-types": "off"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"prettier": "@vdemedes/prettier-config"
|
|
83
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# ER-GPT Coding Helper
|
|
2
|
+
|
|
3
|
+
CLI-утилита для настройки интеграции coding-ассистентов с [ER-GPT](https://er-gpt.ru).
|
|
4
|
+
|
|
5
|
+
## Установка
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @ergpt/coding-helper
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Использование
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Интерактивная настройка
|
|
15
|
+
ergpt-coding-helper
|
|
16
|
+
|
|
17
|
+
# Показать текущую конфигурацию
|
|
18
|
+
ergpt-coding-helper --status
|
|
19
|
+
|
|
20
|
+
# Обновить конфигурацию ассистента
|
|
21
|
+
ergpt-coding-helper --refresh
|
|
22
|
+
|
|
23
|
+
# Очистить всю конфигурацию
|
|
24
|
+
ergpt-coding-helper --clear
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Поддерживаемые инструменты
|
|
28
|
+
|
|
29
|
+
### Claude Code
|
|
30
|
+
|
|
31
|
+
Настраивает файлы:
|
|
32
|
+
- `~/.claude/settings.json` — переменные окружения (`ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_BASE_URL`)
|
|
33
|
+
- `~/.claude.json` — MCP-сервер `ergpt`
|
|
34
|
+
|
|
35
|
+
### OpenCode
|
|
36
|
+
|
|
37
|
+
Настраивает файл:
|
|
38
|
+
- `~/.config/opencode/opencode.json` — провайдер `ergpt` и MCP-сервер
|
|
39
|
+
|
|
40
|
+
## Что происходит при настройке
|
|
41
|
+
|
|
42
|
+
1. **API ключ** — сохраняется в локальное хранилище и прописывается в конфиги инструментов
|
|
43
|
+
2. **Ассистент** — выбирается из каталога ER-GPT (опционально)
|
|
44
|
+
3. **Base URL** — формируется автоматически на основе выбранного ассистента
|
|
45
|
+
4. **MCP** — подключается MCP-сервер ER-GPT для расширенных возможностей
|
|
46
|
+
|
|
47
|
+
## Разработка
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Установка зависимостей
|
|
51
|
+
npm install
|
|
52
|
+
|
|
53
|
+
# Сборка
|
|
54
|
+
npm run build
|
|
55
|
+
|
|
56
|
+
# Режим разработки (watch)
|
|
57
|
+
npm run dev
|
|
58
|
+
|
|
59
|
+
# Генерация типов API из OpenAPI
|
|
60
|
+
npm run api:generate
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Структура проекта
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
src/
|
|
67
|
+
├── cli.tsx # Точка входа CLI
|
|
68
|
+
├── app.tsx # Главный компонент приложения
|
|
69
|
+
├── store.ts # Хранилище конфигурации
|
|
70
|
+
├── types.ts # TypeScript типы
|
|
71
|
+
├── api/
|
|
72
|
+
│ ├── ergpt.ts # API клиент ER-GPT
|
|
73
|
+
│ └── types/ # Сгенерированные типы OpenAPI
|
|
74
|
+
├── components/ # UI компоненты (Ink)
|
|
75
|
+
└── tools/
|
|
76
|
+
├── claude-code.ts # Работа с конфигом Claude Code
|
|
77
|
+
└── opencode.ts # Работа с конфигом OpenCode
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Требования
|
|
81
|
+
|
|
82
|
+
- Node.js >= 16
|
|
83
|
+
- API ключ ER-GPT (получить на [er-gpt.ru](https://er-gpt.ru))
|
|
84
|
+
|
|
85
|
+
## Лицензия
|
|
86
|
+
|
|
87
|
+
MIT
|