@callakrsos/my-ollama-cli 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/.env_example +19 -0
- package/FilesUtils.js +54 -0
- package/LICENSE.txt +201 -0
- package/README.md +201 -0
- package/cli-agent.js +275 -0
- package/commands/register.js +238 -0
- package/index.js +6 -0
- package/lib/history.js +30 -0
- package/lib/logger.js +46 -0
- package/lib/mcp.js +63 -0
- package/lib/model.js +52 -0
- package/package.json +32 -0
- package/search/search/LICENSE +22 -0
- package/search/search/README.md +213 -0
- package/search/search/dist/index.d.ts +33 -0
- package/search/search/dist/index.js +193 -0
- package/search/search/package.json +92 -0
- package/settings.example.json +46 -0
- package/skills/index.js +50 -0
- package/skills.example.json +15 -0
- package/tools/fileTools.js +65 -0
- package/tools/index.js +13 -0
- package/tools/shellTools.js +83 -0
- package/tools/utils.js +19 -0
- package/ui/fileSelector.js +44 -0
- package/ui/prompt.js +347 -0
package/.env_example
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# -------------------------------------------------------
|
|
2
|
+
# Ollama (기본값)
|
|
3
|
+
# -------------------------------------------------------
|
|
4
|
+
OLLAMA_BASE_URL=http://localhost:11434
|
|
5
|
+
|
|
6
|
+
# 권장: cloud 모델 — 로컬 GPU 없이도 고성능 응답
|
|
7
|
+
OLLAMA_MODEL=kimi-k2.5:cloud
|
|
8
|
+
|
|
9
|
+
# 로컬 실행 모델 예시 (주석 해제 후 사용)
|
|
10
|
+
# OLLAMA_MODEL=qwen2.5:7b
|
|
11
|
+
# OLLAMA_MODEL=llama3.1:8b
|
|
12
|
+
# OLLAMA_MODEL=mistral:7b
|
|
13
|
+
|
|
14
|
+
# -------------------------------------------------------
|
|
15
|
+
# vLLM (OpenAI 호환 서버 사용 시)
|
|
16
|
+
# -------------------------------------------------------
|
|
17
|
+
# LLM_PROVIDER=vllm
|
|
18
|
+
# VLLM_BASE_URL=http://localhost:8000
|
|
19
|
+
# VLLM_MODEL=meta-llama/Llama-3.2-3B-Instruct
|
package/FilesUtils.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*******************************************************************************/
|
|
2
|
+
//제작자 : 김영준
|
|
3
|
+
// 오픈소스를 활용한 CLI를 학습 목적으로 만들었습니다.
|
|
4
|
+
// AI는 틀릴 수 있습니다.
|
|
5
|
+
// 생성된 결과에 대한 책임은 본인에게 있습니다.
|
|
6
|
+
// 혹시 저를 본다면 커피라도 한잔~
|
|
7
|
+
/*******************************************************************************/
|
|
8
|
+
import fs from 'fs/promises';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* BOM을 감지하여 적절한 인코딩으로 파일을 읽고 문자열을 반환합니다.
|
|
12
|
+
* BOM이 없다면 utf8로 읽습니다.
|
|
13
|
+
* @param {string} filePath
|
|
14
|
+
*/
|
|
15
|
+
export async function readFileWithBOM(filePath) {
|
|
16
|
+
// 1. 파일을 Buffer로 한 번만 읽습니다. (비동기 방식 권장)
|
|
17
|
+
const buffer = await readBytes(filePath);
|
|
18
|
+
|
|
19
|
+
let encoding = 'utf8';
|
|
20
|
+
let skipBytes = 0;
|
|
21
|
+
|
|
22
|
+
// 2. 바이트 패턴 매칭 (BOM 검사)
|
|
23
|
+
if (buffer[0] === 0xef && buffer[1] === 0xbb && buffer[2] === 0xbf) {
|
|
24
|
+
// UTF-8 BOM
|
|
25
|
+
encoding = 'utf8';
|
|
26
|
+
skipBytes = 3;
|
|
27
|
+
} else if (buffer[0] === 0xff && buffer[1] === 0xfe) {
|
|
28
|
+
// UTF-16 LE
|
|
29
|
+
encoding = 'utf16le';
|
|
30
|
+
skipBytes = 2;
|
|
31
|
+
} else if (buffer[0] === 0xfe && buffer[1] === 0xff) {
|
|
32
|
+
// UTF-16 BE (Node.js 기본 toString에서는 지원하지 않으므로 주의)
|
|
33
|
+
console.warn('Warning: UTF-16 BE detected. standard Node.js might not decode this correctly.');
|
|
34
|
+
encoding = 'utf16le'; // 실제로는 변환 라이브러리(iconv-lite 등) 권장
|
|
35
|
+
skipBytes = 2;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// 3. 감지된 인코딩으로 변환하되, BOM 부분은 잘라내고(subarray) 반환합니다.
|
|
39
|
+
return buffer.subarray(skipBytes).toString(encoding);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export async function readBytes(filePath){
|
|
43
|
+
return fs.readFile(filePath);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//사용 예시 (Top-level await 지원 환경)
|
|
47
|
+
// try {
|
|
48
|
+
// const content = await readFileWithBOM('current_time.txt');
|
|
49
|
+
// console.log('--- Content ---');
|
|
50
|
+
// console.log(content);
|
|
51
|
+
// } catch (err) {
|
|
52
|
+
// console.error('File read failed:', err.message);
|
|
53
|
+
// }
|
|
54
|
+
|
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# KYJ CLI Agent (vCli)
|
|
2
|
+
|
|
3
|
+
Ollama / vLLM 기반 로컬 AI CLI Agent입니다.
|
|
4
|
+
AI 사용이 제한된 환경에서 Claude Code 같은 경험을 로컬에서 구현하는 것을 목표로 합니다.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 🚀 빠른 시작
|
|
9
|
+
|
|
10
|
+
### 1. Ollama 설치 및 모델 다운로드
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Windows: https://ollama.ai/download 에서 다운로드
|
|
14
|
+
# macOS
|
|
15
|
+
brew install ollama
|
|
16
|
+
|
|
17
|
+
# 권장 모델 (cloud 모델 — 원격 추론, 무료)
|
|
18
|
+
ollama pull kimi-k2.5:cloud
|
|
19
|
+
|
|
20
|
+
# 로컬 실행 권장 모델
|
|
21
|
+
ollama pull qwen2.5:7b
|
|
22
|
+
ollama pull llama3.1:8b
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 2. 프로젝트 설정
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
git clone <repo>
|
|
29
|
+
cd myOllamacli
|
|
30
|
+
|
|
31
|
+
npm install
|
|
32
|
+
|
|
33
|
+
# 환경 변수 설정
|
|
34
|
+
cp .env_example .env
|
|
35
|
+
# .env 에서 OLLAMA_MODEL 변경 가능
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 3. 실행
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm run start
|
|
42
|
+
# 또는
|
|
43
|
+
node index.js
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 📦 권장 모델
|
|
49
|
+
|
|
50
|
+
| 모델 | 종류 | 속도 | 품질 | 비고 |
|
|
51
|
+
|------|------|------|------|------|
|
|
52
|
+
| **kimi-k2.5:cloud** | ☁️ cloud | ⚡⚡⚡ | ⭐⭐⭐⭐⭐ | **기본값** — 원격 추론, 설치 불필요 |
|
|
53
|
+
| qwen2.5:7b | 💻 local | ⚡⚡ | ⭐⭐⭐⭐ | 코딩 특화, 로컬 권장 |
|
|
54
|
+
| llama3.1:8b | 💻 local | ⚡⚡ | ⭐⭐⭐ | 범용 |
|
|
55
|
+
| mistral:7b | 💻 local | ⚡⚡ | ⭐⭐⭐ | 빠른 추론 |
|
|
56
|
+
| gemma2:2b | 💻 local | ⚡⚡⚡ | ⭐⭐ | 저사양 PC |
|
|
57
|
+
|
|
58
|
+
> **cloud 모델**은 `ollama pull` 만 하면 Ollama가 원격 서버에서 추론합니다.
|
|
59
|
+
> 별도 GPU 없이도 고성능 응답이 가능합니다.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 🎯 명령어 전체 목록
|
|
64
|
+
|
|
65
|
+
| 명령어 | 설명 |
|
|
66
|
+
|--------|------|
|
|
67
|
+
| `@<검색어>` | 단일 파일 첨부 후 질문 (예: `@index`) |
|
|
68
|
+
| `@@<검색어>` | 멀티 파일 첨부 — Space 선택, Enter 확인 |
|
|
69
|
+
| `/skill <이름>` | 스킬 실행 (예: `/skill commit`) |
|
|
70
|
+
| `/skills` | 사용 가능한 스킬 전체 목록 출력 |
|
|
71
|
+
| `/clear` | 터미널 화면 + 대화 기록 초기화 |
|
|
72
|
+
| `/list` | 현재 대화 기록 콘솔 출력 |
|
|
73
|
+
| `/save` | 대화 기록을 Markdown 파일로 저장 |
|
|
74
|
+
| `/log` | 로그 파일 현황 및 오늘 최근 에러 미리보기 |
|
|
75
|
+
| `/mcp` | 연결된 MCP 서버 목록 출력 |
|
|
76
|
+
| `/baseDir` | 작업 디렉토리 변경 |
|
|
77
|
+
| `/help` | 명령어 도움말 출력 |
|
|
78
|
+
| `/exit` | 프로그램 종료 |
|
|
79
|
+
|
|
80
|
+
> ↑↓ 방향키로 이전 입력 내용을 탐색할 수 있습니다.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## ✨ 주요 기능
|
|
85
|
+
|
|
86
|
+
### AI 내장 도구 (Tools)
|
|
87
|
+
|
|
88
|
+
| 도구 | 설명 |
|
|
89
|
+
|------|------|
|
|
90
|
+
| `read_file` | 파일 읽기 및 분석 (BOM 자동 처리) |
|
|
91
|
+
| `write_file` | 파일 생성 / 수정 |
|
|
92
|
+
| `execute_shell_command` | 셸 명령어 실행 (PowerShell) |
|
|
93
|
+
| `execute_python_code` | Python 코드 작성 후 즉시 실행 |
|
|
94
|
+
| `read_pdf` | PDF 텍스트 추출 |
|
|
95
|
+
|
|
96
|
+
### Skills 시스템
|
|
97
|
+
|
|
98
|
+
자주 쓰는 작업을 슬래시 한 줄로 실행합니다.
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
/skill commit → git diff 분석 후 Conventional Commits 메시지 작성
|
|
102
|
+
/skill review → 코드 리뷰 (버그/성능/보안)
|
|
103
|
+
/skill explain → 코드 단계별 설명
|
|
104
|
+
/skill test → 단위 테스트 코드 작성
|
|
105
|
+
/skill refactor → 리팩토링 제안
|
|
106
|
+
/skill doc → JSDoc / README 작성
|
|
107
|
+
/skill analyze → Python으로 데이터 분석
|
|
108
|
+
/skill security → OWASP 기준 보안 취약점 검토
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**커스텀 스킬** — `skills.json` 파일을 만들면 스킬을 추가/덮어쓸 수 있습니다.
|
|
112
|
+
(`skills.example.json` 참고)
|
|
113
|
+
|
|
114
|
+
### 파일 첨부
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
KYJ_AI > @cli ← 'cli' 포함 파일 검색 후 단일 선택
|
|
118
|
+
KYJ_AI > @@src ← 'src' 포함 파일 목록에서 복수 선택 (Space)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 로그
|
|
122
|
+
|
|
123
|
+
실행 중 모든 대화와 에러가 `./logs/` 에 날짜별로 기록됩니다.
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
logs/
|
|
127
|
+
├── chat_2026-03-15.log ← 입력·응답·소요시간·툴 호출 목록
|
|
128
|
+
├── error_2026-03-15.log ← 에러 메시지 + 스택트레이스
|
|
129
|
+
└── system_2026-03-15.log ← 시작/종료 이벤트
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`/log` 명령어로 현황 및 오늘 최근 에러를 바로 확인할 수 있습니다.
|
|
133
|
+
|
|
134
|
+
### MCP (Model Context Protocol) 서버 연동
|
|
135
|
+
|
|
136
|
+
`settings.json` 에 MCP 서버를 등록하면 AI가 사용할 수 있는 도구가 자동으로 확장됩니다.
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"mcp": {
|
|
141
|
+
"enabled": true,
|
|
142
|
+
"mcpServers": {
|
|
143
|
+
"chrome-devtools": {
|
|
144
|
+
"command": "npx",
|
|
145
|
+
"args": ["-y", "chrome-devtools-mcp@latest"]
|
|
146
|
+
},
|
|
147
|
+
"비활성서버": { "enabled": false, "...": "enabled: false 로 비활성화" }
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## ⚙️ 환경 변수 (.env)
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Ollama (기본)
|
|
159
|
+
OLLAMA_BASE_URL=http://localhost:11434
|
|
160
|
+
OLLAMA_MODEL=kimi-k2.5:cloud
|
|
161
|
+
|
|
162
|
+
# vLLM (OpenAI 호환 서버)
|
|
163
|
+
LLM_PROVIDER=vllm
|
|
164
|
+
VLLM_BASE_URL=http://localhost:8000
|
|
165
|
+
VLLM_MODEL=meta-llama/Llama-3.2-3B-Instruct
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 🔒 보안
|
|
171
|
+
|
|
172
|
+
- 작업 디렉토리 외부 파일 접근 차단
|
|
173
|
+
- 위험 명령어 차단: `rm`, `del`, `sudo`, `su`, `shutdown`, `reboot`
|
|
174
|
+
- 명령어 히스토리: `~/.kyj_cli_history` (최대 200개)
|
|
175
|
+
- 로그 파일은 `.gitignore` 에 포함되어 git에 올라가지 않음
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 🐛 트러블슈팅
|
|
180
|
+
|
|
181
|
+
### npm install 오류
|
|
182
|
+
```bash
|
|
183
|
+
rm -rf node_modules package-lock.json
|
|
184
|
+
npm install
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Ollama 연결 실패
|
|
188
|
+
```bash
|
|
189
|
+
ollama list # 설치 확인
|
|
190
|
+
ollama serve # 서버 시작
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### 모델 응답이 느림
|
|
194
|
+
- cloud 모델 사용: `OLLAMA_MODEL=kimi-k2.5:cloud`
|
|
195
|
+
- 더 작은 로컬 모델: `gemma2:2b`, `qwen2.5:3b`
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## 📄 라이선스
|
|
200
|
+
|
|
201
|
+
Apache 2.0 — 제작: 김영준
|