@ikyyofc/gemini-cli 3.0.7 โ 3.0.8
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/README.md +29 -29
- package/index.js +16 -2
- package/package.json +1 -1
- package/src/skills.js +11 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Gemini CLI ๐ค
|
|
2
2
|
|
|
3
|
-
> AI Agent CLI โ native function calling ยท GEMINI.md context ยท extension system
|
|
3
|
+
> AI Agent CLI โ native function calling ยท Skills ยท GEMINI.md context ยท extension system
|
|
4
4
|
|
|
5
5
|
```
|
|
6
6
|
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
@@ -8,19 +8,7 @@
|
|
|
8
8
|
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Gemini CLI adalah asisten terminal bertenaga AI yang menggunakan model Gemini dari Google. CLI ini bukan sekadar antarmuka chat biasa, melainkan sebuah **AI Agent** yang dapat berinteraksi langsung dengan sistem file
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## ๐ Dokumentasi Lengkap
|
|
16
|
-
|
|
17
|
-
Untuk detail lebih lanjut mengenai arsitektur dan fitur spesifik, silakan baca dokumentasi berikut:
|
|
18
|
-
|
|
19
|
-
- [**Architecture Overview**](./docs/ARCHITECTURE.md) - Penjelasan tentang ReAct loop dan cara kerja agent.
|
|
20
|
-
- [**API Reference**](./docs/API.md) - Referensi fungsi utama (`callGemini`, `chat`).
|
|
21
|
-
- [**Tools (Function Calling)**](./docs/TOOLS.md) - Daftar lengkap tool yang tersedia untuk agent (baca file, jalankan shell, dll).
|
|
22
|
-
- [**Extensions System**](./docs/EXTENSIONS.md) - Cara membuat dan mengelola ekstensi serta custom commands.
|
|
23
|
-
- [**Memory & Context**](./docs/MEMORY.md) - Panduan menggunakan `GEMINI.md` untuk memberikan konteks pada agent.
|
|
11
|
+
Gemini CLI adalah asisten terminal bertenaga AI yang menggunakan model Gemini dari Google. CLI ini bukan sekadar antarmuka chat biasa, melainkan sebuah **AI Agent** yang dapat berinteraksi langsung dengan sistem file, menjalankan perintah shell, dan menggunakan *skills* pihak ketiga secara mandiri (*native function calling*).
|
|
24
12
|
|
|
25
13
|
---
|
|
26
14
|
|
|
@@ -39,23 +27,27 @@ npm link # optional: pakai sebagai `gemini` di terminal
|
|
|
39
27
|
Anda dapat menggunakan Gemini CLI dalam mode interaktif (REPL) atau mode *one-shot* langsung dari terminal.
|
|
40
28
|
|
|
41
29
|
```bash
|
|
42
|
-
gemini
|
|
43
|
-
gemini "buatkan REST API di ./api"
|
|
30
|
+
gemini # Masuk ke mode interactive agent
|
|
31
|
+
gemini "buatkan REST API di ./api" # One-shot task
|
|
44
32
|
gemini --system "Kamu senior backend engineer" # Set system prompt
|
|
45
33
|
gemini --file ./app.js "jelaskan kode ini" # Lampirkan file
|
|
46
34
|
gemini --yolo "refactor semua file di src/" # Skip semua konfirmasi tool (HATI-HATI)
|
|
47
|
-
gemini --chat
|
|
35
|
+
gemini --chat # Plain chat tanpa tools (bukan agent)
|
|
48
36
|
```
|
|
49
37
|
|
|
50
38
|
### Interactive Commands
|
|
51
39
|
|
|
52
40
|
Saat berada di dalam mode interaktif, Anda dapat menggunakan perintah berikut:
|
|
53
41
|
|
|
54
|
-
```
|
|
42
|
+
```text
|
|
55
43
|
/agent โ Toggle agent mode (tools on/off)
|
|
56
44
|
/yolo โ Skip all tool confirmations
|
|
57
45
|
/file <path> โ Attach file to next message
|
|
58
46
|
/system <text> โ Set system instruction
|
|
47
|
+
/skill โ Manage skills (/skill list, add, remove, find, update, init)
|
|
48
|
+
/memory โ Manage memory/context (/memory show, reload, add)
|
|
49
|
+
/ext โ Manage extensions (/ext list, install, uninstall, enable, disable)
|
|
50
|
+
/proxy โ Toggle proxy rotation (/proxy on, /proxy off)
|
|
59
51
|
/history โ Show conversation turns
|
|
60
52
|
/export <file> โ Export history to JSON
|
|
61
53
|
/cd <path> โ Change working directory
|
|
@@ -71,34 +63,42 @@ Saat berada di dalam mode interaktif, Anda dapat menggunakan perintah berikut:
|
|
|
71
63
|
## ๐ง Fitur Utama
|
|
72
64
|
|
|
73
65
|
### 1. Native Function Calling (Tools)
|
|
74
|
-
Agent dapat membaca file, menulis file, menjalankan perintah shell, dan mencari file secara mandiri untuk menyelesaikan tugas yang Anda berikan.
|
|
66
|
+
Agent dapat membaca file, menulis file, menjalankan perintah shell, dan mencari file secara mandiri untuk menyelesaikan tugas yang Anda berikan.
|
|
67
|
+
|
|
68
|
+
### 2. Skills System
|
|
69
|
+
Gemini CLI mendukung integrasi *Skills* melalui `npx skills`. Anda dapat menginstal keahlian tambahan yang akan otomatis dimuat ke dalam prompt system agent.
|
|
70
|
+
Contoh: `/skill add anthropics/skills --skill frontend-design`
|
|
71
|
+
|
|
72
|
+
### 3. Hierarchical Context (`GEMINI.md`)
|
|
73
|
+
Berikan instruksi spesifik proyek atau global menggunakan file `GEMINI.md`. Agent akan memuat konteks ini secara otomatis. Gunakan `/memory` untuk mengatur teks konteks di memori secara dinamis selama sesi berlangsung.
|
|
75
74
|
|
|
76
|
-
###
|
|
77
|
-
|
|
75
|
+
### 4. Extension System
|
|
76
|
+
Perluas kemampuan CLI dengan membuat ekstensi yang berisi custom commands dan konteks tambahan. Kelola menggunakan perintah `/ext`.
|
|
78
77
|
|
|
79
|
-
###
|
|
80
|
-
|
|
78
|
+
### 5. Proxy Rotation
|
|
79
|
+
Sistem menggunakan proxy rotasi secara otomatis (`src/utils/proxy.js`) sehingga requests Anda stabil. Status dapat diatur menggunakan perintah `/proxy`.
|
|
81
80
|
|
|
82
81
|
---
|
|
83
82
|
|
|
84
83
|
## ๐ Struktur Direktori
|
|
85
84
|
|
|
86
|
-
```
|
|
85
|
+
```text
|
|
87
86
|
gemini-cli/
|
|
88
87
|
โโโ index.js โ CLI entry + REPL + commands
|
|
89
88
|
โโโ package.json
|
|
90
|
-
โโโ docs/ โ Dokumentasi lengkap
|
|
91
89
|
โโโ src/
|
|
92
90
|
โ โโโ gemini.js โ API client (native function calling)
|
|
93
91
|
โ โโโ tools.js โ functionDeclarations + executor
|
|
94
92
|
โ โโโ agent.js โ ReAct loop
|
|
95
93
|
โ โโโ memory.js โ GEMINI.md hierarchy loader
|
|
96
94
|
โ โโโ extensions.js โ Extension manager
|
|
95
|
+
โ โโโ skills.js โ Skills manager via npx skills
|
|
97
96
|
โ โโโ renderer.js โ Terminal UI + markdown
|
|
98
|
-
โ
|
|
99
|
-
โโโ utils/
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
โ โโโ input.js โ Bracketed paste via Transform stream
|
|
98
|
+
โ โโโ utils/
|
|
99
|
+
โ โโโ proxy.js โ Global proxy manager
|
|
100
|
+
โ โโโ spinner.js โ Loading spinner
|
|
101
|
+
โ
|
|
102
102
|
~/.gemini/ โ Global config dir (dibuat otomatis)
|
|
103
103
|
โโโ GEMINI.md โ Global context
|
|
104
104
|
โโโ extensions/ โ Folder instalasi ekstensi
|
package/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import { Spinner } from "./src/utils/spinner.js";
|
|
|
27
27
|
import {
|
|
28
28
|
listInstalledSkills, installSkill, removeSkillNpx,
|
|
29
29
|
findSkills, listNpxSkills, updateSkill, initSkill,
|
|
30
|
-
ensureSkillsDirs, loadSkills,
|
|
30
|
+
ensureSkillsDirs, loadSkills, cleanLockFile,
|
|
31
31
|
} from "./src/skills.js";
|
|
32
32
|
|
|
33
33
|
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
36
36
|
ensureGlobalDir();
|
|
37
37
|
ensureSkillsDirs();
|
|
38
|
+
cleanLockFile(); // remove skills-lock.json from cwd on every startup
|
|
38
39
|
setupGlobalProxy(); // aktifkan rotasi proxy sebelum request apapun
|
|
39
40
|
|
|
40
41
|
let extensions = loadExtensions();
|
|
@@ -133,10 +134,23 @@ function attachFile(fp) {
|
|
|
133
134
|
// Send message
|
|
134
135
|
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
135
136
|
async function send(rawLine) {
|
|
136
|
-
// Decode \x00 โ \n from paste encoding
|
|
137
137
|
const userText = restorePaste(rawLine).trim();
|
|
138
138
|
if (!userText) return;
|
|
139
139
|
|
|
140
|
+
// Clear terminal when there's previous history so it stays light.
|
|
141
|
+
// Keep last exchange visible by reprinting it first.
|
|
142
|
+
if (history.length >= 2) {
|
|
143
|
+
process.stdout.write("\x1Bc");
|
|
144
|
+
// Reprint the last assistant response as context
|
|
145
|
+
const lastAssistant = history.filter(m => m.role === "assistant").at(-1);
|
|
146
|
+
if (lastAssistant) {
|
|
147
|
+
process.stdout.write(chalk.hex("#4A4A5E").dim(
|
|
148
|
+
` (${Math.ceil(history.length / 2)} turns in memory)\n`
|
|
149
|
+
));
|
|
150
|
+
printAssistant(lastAssistant.content);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
140
154
|
printUser(userText + (pendingFile ? chalk.dim(` [${path.basename(pendingPath)}]`) : ""));
|
|
141
155
|
|
|
142
156
|
if (agentMode) {
|
package/package.json
CHANGED
package/src/skills.js
CHANGED
|
@@ -25,6 +25,14 @@ export function ensureSkillsDirs() {
|
|
|
25
25
|
fs.mkdirSync(AGENTS_DIR, { recursive: true });
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
29
|
+
// Delete skills-lock.json from cwd (npx skills drops this on install)
|
|
30
|
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
31
|
+
export function cleanLockFile(cwd = process.cwd()) {
|
|
32
|
+
const p = path.join(cwd, "skills-lock.json");
|
|
33
|
+
try { if (fs.existsSync(p)) fs.unlinkSync(p); } catch {}
|
|
34
|
+
}
|
|
35
|
+
|
|
28
36
|
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
29
37
|
// Scan a dir tree for SKILL.md files
|
|
30
38
|
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
@@ -127,6 +135,9 @@ export async function installSkill(rawSource, opts = {}) {
|
|
|
127
135
|
|
|
128
136
|
const { stdout, stderr } = await npxSkills(parts.join(" "));
|
|
129
137
|
|
|
138
|
+
// Cleanup skills-lock.json that npx skills drops in cwd
|
|
139
|
+
cleanLockFile();
|
|
140
|
+
|
|
130
141
|
// Report what was newly installed
|
|
131
142
|
const after = loadSkills().map(s => s.slug);
|
|
132
143
|
const newSlugs = after.filter(s => !before.has(s));
|