scai 0.1.30 → 0.1.31
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 +162 -85
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,146 +1,223 @@
|
|
|
1
|
-
# ⚙️ scai —
|
|
1
|
+
# ⚙️ scai — Semantic CLI Assistant ✨
|
|
2
2
|
|
|
3
|
-
> AI-powered CLI tool for
|
|
3
|
+
> AI-powered CLI tool for commits, summaries, search, questions, and more — using local models.
|
|
4
4
|
|
|
5
|
-
**scai**
|
|
5
|
+
**scai** is a privacy-first, local AI assistant for developers. It brings semantic understanding to your codebase, directly from the terminal:
|
|
6
6
|
|
|
7
|
-
- 💬 Suggest
|
|
8
|
-
- ✨
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
7
|
+
- 💬 Suggest intelligent Git commit messages
|
|
8
|
+
- ✨ Comment and refactor code files
|
|
9
|
+
- 🧐 Summarize files in plain English
|
|
10
|
+
- 📜 Auto-update your changelog
|
|
11
|
+
- 🧪 Generate Jest tests (ALPHA)
|
|
12
|
+
- 🔍 Search and ask questions across your codebase (BETA)
|
|
13
|
+
- 🔐 100% local — no API keys, no cloud, no telemetry
|
|
13
14
|
|
|
14
15
|
---
|
|
15
16
|
|
|
16
17
|
## 🚀 Features
|
|
17
18
|
|
|
18
|
-
-
|
|
19
|
+
- ⚡ Powered by open-source models (e.g. `llama3`, `codellama`)
|
|
20
|
+
- 🔍 Full-text indexing & semantic search (BETA)
|
|
19
21
|
- 🛠️ Built with Node.js and TypeScript
|
|
20
|
-
-
|
|
21
|
-
- ✅ Global options to select model and programming language
|
|
22
|
+
- ✅ Easily configurable via CLI or global flags
|
|
22
23
|
|
|
23
24
|
---
|
|
24
25
|
|
|
25
26
|
## ❤️ Why Local AI?
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
**Your code stays yours.**
|
|
29
|
+
scai runs entirely on your machine and doesn't require cloud APIs or API keys. That means:
|
|
28
30
|
|
|
29
|
-
- ✅ **
|
|
30
|
-
- ✅ **
|
|
31
|
-
- ✅ **
|
|
32
|
-
|
|
33
|
-
By running everything locally, you can be sure that your sensitive code and workflows stay safe, private, and within your control.
|
|
31
|
+
- ✅ **Privacy-first**: no telemetry, no server round-trips
|
|
32
|
+
- ✅ **EU & GDPR-friendly**: designed with compliance in mind
|
|
33
|
+
- ✅ **Developer control**: full transparency and override options
|
|
34
34
|
|
|
35
35
|
---
|
|
36
36
|
|
|
37
37
|
## 📦 Installation
|
|
38
38
|
|
|
39
|
-
1. **Install Ollama
|
|
40
|
-
-
|
|
41
|
-
-
|
|
39
|
+
1. **Install Ollama (for local models)**
|
|
40
|
+
- macOS: `brew install ollama`
|
|
41
|
+
- Windows: [Download here](https://ollama.com/download)
|
|
42
|
+
- Start Ollama after installing.
|
|
42
43
|
|
|
43
44
|
2. **Install scai globally:**
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
```bash
|
|
46
|
+
npm install -g scai
|
|
46
47
|
```
|
|
47
48
|
|
|
48
|
-
3. **Initialize
|
|
49
|
-
```bash
|
|
50
|
-
scai init
|
|
51
|
-
```
|
|
49
|
+
3. **Initialize models:**
|
|
52
50
|
|
|
53
|
-
|
|
51
|
+
```bash
|
|
52
|
+
scai init
|
|
53
|
+
```
|
|
54
54
|
|
|
55
|
-
---
|
|
56
55
|
|
|
57
|
-
## ⚒️ Usage
|
|
56
|
+
## ⚒️ Usage Overview
|
|
58
57
|
|
|
59
|
-
### 🔧 Git
|
|
58
|
+
### 🔧 Git Commit Suggestions
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
```
|
|
60
|
+
```bash
|
|
61
|
+
git add .
|
|
62
|
+
scai git sugg
|
|
63
|
+
```
|
|
66
64
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
feat(api): add error handling to user service
|
|
70
|
-
```
|
|
65
|
+
Suggests a meaningful commit message based on your staged code.
|
|
66
|
+
To auto-commit:
|
|
71
67
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
```
|
|
68
|
+
```bash
|
|
69
|
+
scai git sugg --commit
|
|
70
|
+
```
|
|
76
71
|
|
|
77
|
-
|
|
72
|
+
---
|
|
78
73
|
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
scai gen summ <file>
|
|
82
|
-
```
|
|
74
|
+
### 🛠️ Code Generation Commands (`gen` group)
|
|
83
75
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
```bash
|
|
77
|
+
scai gen summ <file>
|
|
78
|
+
scai gen comm <file>
|
|
79
|
+
scai gen changelog
|
|
80
|
+
scai gen tests <file>
|
|
81
|
+
```
|
|
88
82
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
* `summ`: Summarize a file
|
|
84
|
+
* `comm`: Add comments or refactor suggestions
|
|
85
|
+
* `changelog`: Update or create `CHANGELOG.md` from Git diff
|
|
86
|
+
* `tests`: Create Jest test stubs (ALPHA)
|
|
93
87
|
|
|
94
|
-
|
|
88
|
+
You can also pipe file content directly:
|
|
95
89
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
```
|
|
90
|
+
```bash
|
|
91
|
+
cat src/utils/math.ts | scai gen summ
|
|
92
|
+
```
|
|
100
93
|
|
|
101
|
-
|
|
94
|
+
---
|
|
102
95
|
|
|
103
96
|
## ⚙️ Configuration
|
|
104
97
|
|
|
105
|
-
scai stores
|
|
98
|
+
scai stores settings in `~/.scai/config.json`. You can override or view them:
|
|
106
99
|
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
scai set model <model>
|
|
110
|
-
```
|
|
100
|
+
* **Set model:**
|
|
111
101
|
|
|
112
|
-
|
|
102
|
+
```bash
|
|
103
|
+
scai set model codellama:7b
|
|
104
|
+
```
|
|
105
|
+
* **Set language:**
|
|
113
106
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
107
|
+
```bash
|
|
108
|
+
scai set lang ts
|
|
109
|
+
```
|
|
110
|
+
* **Show config:**
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
scai config
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
<br>
|
|
117
|
+
|
|
118
|
+
## 🔁 Background Daemon and Indexing ⚠️ Beta Notice
|
|
119
|
+
|
|
120
|
+
These features are experimental and subject to change:
|
|
121
|
+
|
|
122
|
+
* `index`, `find`, `ask`
|
|
123
|
+
* `daemon`, `stop-daemon`
|
|
124
|
+
* `gen tests` (test generation)
|
|
125
|
+
|
|
126
|
+
<br>
|
|
127
|
+
|
|
128
|
+
> **Note:** Indexing very large repositories (millions of lines) may take **hours or days**. Please be patient, and only index huge codebases if you are ok with some extra processing taking place on your computer.
|
|
118
129
|
|
|
119
|
-
|
|
130
|
+
The `scai index` command **automatically** starts a background daemon that continuously:
|
|
131
|
+
|
|
132
|
+
* Scans your target directory
|
|
133
|
+
* Summarizes new or changed files
|
|
134
|
+
* Updates embeddings and the search index
|
|
135
|
+
|
|
136
|
+
You won't gain much value from the index unless you scope it to one repository.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### 🔍 Codebase Search & Ask (BETA)
|
|
141
|
+
|
|
142
|
+
> **Important:** You must `index` a **code repository** first or `find` and `ask` have no context to work with.
|
|
143
|
+
|
|
144
|
+
1. **Set index directory:**
|
|
120
145
|
|
|
121
|
-
- **Show current configuration:**
|
|
122
146
|
```bash
|
|
123
|
-
scai
|
|
147
|
+
scai set index-dir /path/to/repo
|
|
124
148
|
```
|
|
125
149
|
|
|
126
|
-
|
|
150
|
+
2. **Index your repo (once):**
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
scai index
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
3. The daemon is designed to **consume minimal resources** and run unobtrusively. You can control it with:
|
|
157
|
+
|
|
127
158
|
```bash
|
|
128
|
-
scai
|
|
159
|
+
scai daemon # Start or show daemon status
|
|
160
|
+
scai stop-daemon # Stop the background indexer
|
|
129
161
|
```
|
|
130
162
|
|
|
163
|
+
|
|
164
|
+
4. **Keyword search:**
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
scai find YourClassName
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
5. **Natural-language questions:**
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
scai ask "How does mapcontrol work?"
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
`find` and `ask` rely on that index—without it they will return no useful results.
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## 🛍️ Maintenance & Utilities
|
|
182
|
+
|
|
183
|
+
* **Reset database (w/ backup):**
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
scai reset-db
|
|
187
|
+
```
|
|
188
|
+
* **Manual backup of `~/.scai`:**
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
scai backup
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## 🧺 Module Pipeline Mode
|
|
197
|
+
|
|
198
|
+
For custom pipelines on a single file:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
scai src/file.ts -m summary,comments
|
|
202
|
+
```
|
|
203
|
+
|
|
131
204
|
---
|
|
132
205
|
|
|
133
206
|
## 🔐 License & Fair Use
|
|
134
207
|
|
|
135
|
-
**scai is free to use** for individuals, teams, and
|
|
208
|
+
**scai is free to use** for individuals, teams, and commercial projects.
|
|
136
209
|
|
|
137
210
|
You may:
|
|
138
|
-
- ✅ Use it internally in your projects
|
|
139
|
-
- ✅ Use it at work or in commercial development
|
|
140
|
-
- ✅ Share and recommend it
|
|
141
211
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
212
|
+
* ✅ Use internally or commercially
|
|
213
|
+
* ✅ Fork and improve
|
|
214
|
+
* ✅ Recommend to others
|
|
215
|
+
|
|
216
|
+
You may **not**:
|
|
217
|
+
|
|
218
|
+
* ❌ Resell as a product or service
|
|
219
|
+
* ❌ Claim ownership of the tool
|
|
145
220
|
|
|
146
221
|
See [LICENSE](./LICENSE) for full terms.
|
|
222
|
+
|
|
223
|
+
```
|