@erllecta/coding-helper 1.0.2 → 1.0.4

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.
@@ -1,27 +1,30 @@
1
1
  # ER-GPT Coding Helper
2
2
 
3
- CLI-утилита для настройки интеграции coding-ассистентов с [ER-GPT](https://er-gpt.ru).
3
+ CLI-утилита для настройки интеграции coding-ассистентов с [ER-GPT](https://er-gpt.ertelecom.loc).
4
4
 
5
5
  ## Установка
6
6
 
7
7
  ```bash
8
- npm install -g @ergpt/coding-helper
8
+ npm install -g @erllecta/coding-helper
9
9
  ```
10
10
 
11
11
  ## Использование
12
12
 
13
13
  ```bash
14
14
  # Интерактивная настройка
15
- @ergpt/coding-helper
15
+ ergpt-coding-helper
16
+
17
+ # Одноразовый запуск без установки
18
+ npm exec --yes --package=@erllecta/coding-helper ergpt-coding-helper
16
19
 
17
20
  # Показать текущую конфигурацию
18
- @ergpt/coding-helper --status
21
+ ergpt-coding-helper --status
19
22
 
20
23
  # Обновить конфигурацию ассистента
21
- @ergpt/coding-helper --refresh
24
+ ergpt-coding-helper --refresh
22
25
 
23
26
  # Очистить всю конфигурацию
24
- @ergpt/coding-helper --clear
27
+ ergpt-coding-helper --clear
25
28
  ```
26
29
 
27
30
  ## Поддерживаемые инструменты
@@ -46,43 +49,24 @@ npm install -g @ergpt/coding-helper
46
49
  3. **Base URL** — формируется автоматически на основе выбранного ассистента
47
50
  4. **MCP** — подключается MCP-сервер ER-GPT для расширенных возможностей
48
51
 
49
- ## Разработка
50
-
51
- ```bash
52
- # Установка зависимостей
53
- npm install
52
+ ## URL по умолчанию
54
53
 
55
- # Сборка
56
- npm run build
54
+ Пакет использует корпоративный контур:
57
55
 
58
- # Режим разработки (watch)
59
- npm run dev
56
+ - API: `https://api.er-gpt.ertelecom.loc`
57
+ - MCP SSE: `https://api.er-gpt.ertelecom.loc/mcp/sse`
60
58
 
61
- # Генерация типов API из OpenAPI
62
- npm run api:generate
63
- ```
59
+ Для другого окружения задайте переменную:
64
60
 
65
- ## Структура проекта
66
-
67
- ```
68
- src/
69
- ├── cli.tsx # Точка входа CLI
70
- ├── app.tsx # Главный компонент приложения
71
- ├── store.ts # Хранилище конфигурации
72
- ├── types.ts # TypeScript типы
73
- ├── api/
74
- │ ├── ergpt.ts # API клиент ER-GPT
75
- │ └── types/ # Сгенерированные типы OpenAPI
76
- ├── components/ # UI компоненты (Ink)
77
- └── tools/
78
- ├── claude-code.ts # Работа с конфигом Claude Code
79
- └── opencode.ts # Работа с конфигом OpenCode
61
+ ```bash
62
+ export ERGPT_API_BASE=https://api.example.com
63
+ ergpt-coding-helper
80
64
  ```
81
65
 
82
66
  ## Требования
83
67
 
84
68
  - Node.js >= 16
85
- - API ключ ER-GPT (получить на [er-gpt.ru](https://er-gpt.ru))
69
+ - API ключ ER-GPT (получить в [личном кабинете](https://er-gpt.ertelecom.loc/profile))
86
70
 
87
71
  ## Лицензия
88
72
 
package/dist/api/ergpt.js CHANGED
@@ -1,4 +1,4 @@
1
- const API_BASE = 'https://api.er-gpt.ru';
1
+ import { API_BASE } from '../config.js';
2
2
  async function request(path, apiKey, options) {
3
3
  const response = await fetch(`${API_BASE}${path}`, {
4
4
  method: options?.method ?? 'GET',
@@ -4,6 +4,7 @@ import SelectInput from 'ink-select-input';
4
4
  import { writeClaudeMcpConfig, getClaudeUserConfigPath, } from '../tools/claude-code.js';
5
5
  import { writeOpenCodeMcpConfig, getOpenCodeConfigPath, } from '../tools/opencode.js';
6
6
  import { getApiKey, getAssistantId, getAssistantName } from '../store.js';
7
+ import { MCP_SSE_URL } from '../config.js';
7
8
  const ALL_TOOLS = ['claude-code', 'opencode'];
8
9
  export default function McpSetup({ onBack, onComplete }) {
9
10
  const [selectedTools, setSelectedTools] = useState(new Set());
@@ -61,7 +62,7 @@ export default function McpSetup({ onBack, onComplete }) {
61
62
  React.createElement(Box, { marginBottom: 1 },
62
63
  React.createElement(Text, { bold: true, color: "green" }, "MCP \u0441\u0435\u0440\u0432\u0435\u0440 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043D!")),
63
64
  React.createElement(Box, { flexDirection: "column", marginBottom: 1 },
64
- React.createElement(Text, null, "URL: https://api.er-gpt.ru/mcp/sse"),
65
+ React.createElement(Text, null, "URL: ", MCP_SSE_URL),
65
66
  React.createElement(Text, null,
66
67
  "Assistant: ",
67
68
  assistantName),
@@ -97,7 +98,7 @@ export default function McpSetup({ onBack, onComplete }) {
97
98
  React.createElement(Box, { marginBottom: 1 },
98
99
  React.createElement(Text, { bold: true }, "\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430 MCP \u0441\u0435\u0440\u0432\u0435\u0440\u0430")),
99
100
  React.createElement(Box, { marginBottom: 1, flexDirection: "column" },
100
- React.createElement(Text, { dimColor: true }, "URL: https://api.er-gpt.ru/mcp/sse"),
101
+ React.createElement(Text, { dimColor: true }, "URL: ", MCP_SSE_URL),
101
102
  React.createElement(Text, { dimColor: true },
102
103
  "Assistant: ",
103
104
  assistantName)),
@@ -0,0 +1,3 @@
1
+ export declare const API_BASE: string;
2
+ export declare const MCP_SSE_URL: string;
3
+ export declare const PLATFORM_URL: string;
package/dist/config.js ADDED
@@ -0,0 +1,4 @@
1
+ /** Корпоративный API ER-GPT. Переопределение: ERGPT_API_BASE=https://... */
2
+ export const API_BASE = process.env.ERGPT_API_BASE ?? 'https://api.er-gpt.ertelecom.loc';
3
+ export const MCP_SSE_URL = `${API_BASE}/mcp/sse`;
4
+ export const PLATFORM_URL = 'https://er-gpt.ertelecom.loc';
@@ -1,6 +1,7 @@
1
1
  import * as fs from 'fs';
2
2
  import * as path from 'path';
3
3
  import * as os from 'os';
4
+ import { MCP_SSE_URL } from '../config.js';
4
5
  const CLAUDE_SETTINGS_PATH = path.join(os.homedir(), '.claude', 'settings.json');
5
6
  const CLAUDE_USER_CONFIG_PATH = path.join(os.homedir(), '.claude.json');
6
7
  const MCP_SERVER_NAME = 'ergpt';
@@ -81,7 +82,7 @@ export function writeClaudeMcpConfig(assistantId, apiKey) {
81
82
  }
82
83
  config.mcpServers[MCP_SERVER_NAME] = {
83
84
  type: 'sse',
84
- url: 'https://api.er-gpt.ru/mcp/sse',
85
+ url: MCP_SSE_URL,
85
86
  headers: {
86
87
  Authorization: `Bearer ${apiKey}`,
87
88
  'X-Assistant-Id': assistantId,
@@ -1,6 +1,7 @@
1
1
  import * as fs from 'fs';
2
2
  import * as path from 'path';
3
3
  import * as os from 'os';
4
+ import { MCP_SSE_URL } from '../config.js';
4
5
  const OPENCODE_CONFIG_PATH = path.join(os.homedir(), '.config', 'opencode', 'opencode.json');
5
6
  const MCP_SERVER_NAME = 'ergpt';
6
7
  export function readOpenCodeConfig() {
@@ -74,7 +75,7 @@ export function writeOpenCodeMcpConfig(assistantId, apiKey) {
74
75
  }
75
76
  config.mcp[MCP_SERVER_NAME] = {
76
77
  type: 'remote',
77
- url: 'https://api.er-gpt.ru/mcp/sse',
78
+ url: MCP_SSE_URL,
78
79
  headers: {
79
80
  Authorization: `Bearer ${apiKey}`,
80
81
  'X-Assistant-Id': assistantId,
package/package.json CHANGED
@@ -1,14 +1,19 @@
1
1
  {
2
2
  "name": "@erllecta/coding-helper",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "CLI tool for configuring coding assistants (Claude Code, OpenCode) with ER-GPT integration",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Никита",
8
8
  "email": "mrmamongo@gmail.com"
9
9
  },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://git.erllecta.ru/ergpt/coding-tool.git"
13
+ },
14
+ "homepage": "https://git.erllecta.ru/ergpt/coding-tool",
10
15
  "bin": {
11
- "ergpt-coding-helper": "./dist/cli.js"
16
+ "ergpt-coding-helper": "dist/cli.js"
12
17
  },
13
18
  "keywords": [
14
19
  "cli",
@@ -26,7 +31,7 @@
26
31
  "build": "tsc",
27
32
  "dev": "tsc --watch",
28
33
  "test": "prettier --check . && xo && ava",
29
- "api:generate": "openapi-typescript https://api.dev.infra.er-gpt.ru/openapi.json -o src/api/types/generated.ts"
34
+ "api:generate": "openapi-typescript https://api.er-gpt.ertelecom.loc/openapi.json -o src/api/types/generated.ts"
30
35
  },
31
36
  "files": [
32
37
  "dist"