scai 0.1.117 β 0.1.119
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 +88 -503
- package/dist/agents/MainAgent.js +255 -0
- package/dist/agents/contextReviewStep.js +104 -0
- package/dist/agents/finalPlanGenStep.js +123 -0
- package/dist/agents/infoPlanGenStep.js +126 -0
- package/dist/agents/planGeneratorStep.js +118 -0
- package/dist/agents/planResolverStep.js +95 -0
- package/dist/agents/planTargetFilesStep.js +48 -0
- package/dist/agents/preFileSearchCheckStep.js +95 -0
- package/dist/agents/selectRelevantSourcesStep.js +100 -0
- package/dist/agents/semanticAnalysisStep.js +144 -0
- package/dist/agents/structuralAnalysisStep.js +46 -0
- package/dist/agents/transformPlanGenStep.js +107 -0
- package/dist/agents/understandIntentStep.js +72 -0
- package/dist/agents/validationAnalysisStep.js +87 -0
- package/dist/commands/AskCmd.js +47 -116
- package/dist/commands/ChangeLogUpdateCmd.js +11 -5
- package/dist/commands/CommitSuggesterCmd.js +50 -75
- package/dist/commands/DaemonCmd.js +119 -29
- package/dist/commands/IndexCmd.js +41 -24
- package/dist/commands/InspectCmd.js +0 -1
- package/dist/commands/ReadlineSingleton.js +18 -0
- package/dist/commands/ResetDbCmd.js +20 -21
- package/dist/commands/ReviewCmd.js +89 -54
- package/dist/commands/SummaryCmd.js +12 -18
- package/dist/commands/WorkflowCmd.js +41 -0
- package/dist/commands/factory.js +254 -0
- package/dist/config.js +67 -15
- package/dist/constants.js +20 -4
- package/dist/context.js +10 -11
- package/dist/daemon/daemonQueues.js +63 -0
- package/dist/daemon/daemonWorker.js +40 -63
- package/dist/daemon/generateSummaries.js +58 -0
- package/dist/daemon/runFolderCapsuleBatch.js +247 -0
- package/dist/daemon/runIndexingBatch.js +147 -0
- package/dist/daemon/runKgBatch.js +104 -0
- package/dist/db/fileIndex.js +168 -63
- package/dist/db/functionExtractors/extractFromJava.js +210 -6
- package/dist/db/functionExtractors/extractFromJs.js +173 -214
- package/dist/db/functionExtractors/extractFromTs.js +159 -160
- package/dist/db/functionExtractors/index.js +7 -5
- package/dist/db/schema.js +55 -20
- package/dist/db/sqlTemplates.js +50 -19
- package/dist/fileRules/builtins.js +31 -14
- package/dist/fileRules/codeAllowedExtensions.js +4 -0
- package/dist/fileRules/fileExceptions.js +0 -13
- package/dist/fileRules/ignoredExtensions.js +10 -0
- package/dist/index.js +128 -325
- package/dist/lib/generate.js +37 -14
- package/dist/lib/generateFolderCapsules.js +109 -0
- package/dist/lib/spinner.js +12 -5
- package/dist/modelSetup.js +1 -11
- package/dist/pipeline/modules/changeLogModule.js +16 -19
- package/dist/pipeline/modules/chunkManagerModule.js +24 -0
- package/dist/pipeline/modules/cleanupModule.js +95 -91
- package/dist/pipeline/modules/codeTransformModule.js +208 -0
- package/dist/pipeline/modules/commentModule.js +20 -11
- package/dist/pipeline/modules/commitSuggesterModule.js +36 -14
- package/dist/pipeline/modules/contextReviewModule.js +52 -0
- package/dist/pipeline/modules/fileReaderModule.js +72 -0
- package/dist/pipeline/modules/fileSearchModule.js +136 -0
- package/dist/pipeline/modules/finalAnswerModule.js +53 -0
- package/dist/pipeline/modules/gatherInfoModule.js +176 -0
- package/dist/pipeline/modules/generateTestsModule.js +63 -54
- package/dist/pipeline/modules/kgModule.js +26 -11
- package/dist/pipeline/modules/preserveCodeModule.js +91 -49
- package/dist/pipeline/modules/refactorModule.js +19 -7
- package/dist/pipeline/modules/repairTestsModule.js +44 -36
- package/dist/pipeline/modules/reviewModule.js +23 -13
- package/dist/pipeline/modules/summaryModule.js +27 -35
- package/dist/pipeline/modules/writeFileModule.js +86 -0
- package/dist/pipeline/registry/moduleRegistry.js +38 -93
- package/dist/pipeline/runModulePipeline.js +22 -19
- package/dist/scripts/dbcheck.js +143 -228
- package/dist/utils/buildContextualPrompt.js +245 -172
- package/dist/utils/debugContext.js +24 -0
- package/dist/utils/fileTree.js +16 -6
- package/dist/utils/loadRelevantFolderCapsules.js +64 -0
- package/dist/utils/log.js +2 -0
- package/dist/utils/normalizeData.js +23 -0
- package/dist/utils/planActions.js +60 -0
- package/dist/utils/promptBuilderHelper.js +67 -0
- package/dist/utils/promptLogHelper.js +52 -0
- package/dist/utils/sanitizeQuery.js +20 -8
- package/dist/utils/sleep.js +3 -0
- package/dist/utils/splitCodeIntoChunk.js +65 -32
- package/dist/utils/vscode.js +49 -0
- package/dist/workflow/workflowResolver.js +14 -0
- package/dist/workflow/workflowRunner.js +103 -0
- package/package.json +6 -5
- package/dist/agent/agentManager.js +0 -39
- package/dist/agent/workflowManager.js +0 -95
- package/dist/commands/ModulePipelineCmd.js +0 -31
- package/dist/daemon/daemonBatch.js +0 -186
- package/dist/fileRules/scoreFiles.js +0 -71
- package/dist/lib/generateEmbedding.js +0 -22
package/README.md
CHANGED
|
@@ -1,607 +1,192 @@
|
|
|
1
|
-
# βοΈ
|
|
1
|
+
# βοΈ SCAI β Source Code AI πΏ
|
|
2
2
|
|
|
3
|
-
> AI-powered CLI
|
|
3
|
+
> **AI-powered CLI for local code analysis, commit message suggestions, and natural-language queries.** 100% local, private, GDPR-friendly, made in Denmark/EU with β€οΈ.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
SCAI is your AI coding companion in the terminal. Focus on coding while Scai helps you understand, comment, and analyze your code. **Local Model Note:** Using local LLMs ensures privacy and offline usage, and **NO token cost, but capabilities are more limited compared to cloud-hosted AI.**
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
* π€ **Reviews open pull requests** and provides AIβdriven feedback (BETA)
|
|
9
|
-
* π **Generates comments for multiple files** while you keep coding
|
|
10
|
-
* π€ **Runs agent workflows** to automate repetitive tasks like summarizing, commenting, or running tests β run agents on single files or entire folders with custom goals
|
|
11
|
-
* π Autoβupdates your changelog
|
|
12
|
-
* π (ALPHA) Search & ask questions across your codebase
|
|
13
|
-
* π 100% local β no API keys, no cloud, no telemetry
|
|
7
|
+
> β οΈ **Alpha Version Notice:** If you have previously installed Scai, please run `scai db reset && scai index start` before using this version.
|
|
14
8
|
|
|
15
9
|
---
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
## π» Getting Started
|
|
18
12
|
|
|
19
|
-
|
|
13
|
+
### 1οΈβ£ Install & Initialize
|
|
20
14
|
|
|
21
15
|
```bash
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# Run summary on all files in a folder
|
|
26
|
-
$ scai agent run summary -f path/to/myfolder
|
|
16
|
+
npm install -g scai
|
|
17
|
+
scai init
|
|
18
|
+
scai index start
|
|
27
19
|
```
|
|
28
20
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## π Features
|
|
35
|
-
|
|
36
|
-
- β‘ Powered by open-source models (e.g. `llama3`, `codellama`)
|
|
37
|
-
- π Full-text indexing & semantic search (ALPHA)
|
|
38
|
-
- π οΈ Built with Node.js and TypeScript
|
|
39
|
-
- β
Easily configurable via CLI or global flags
|
|
21
|
+
This will initialize local models (recommended: `qwen3-coder:30b`) and start indexing your code repository.
|
|
40
22
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
## β€οΈ Why Local AI?
|
|
44
|
-
|
|
45
|
-
**Your code stays yours.**
|
|
46
|
-
scai runs entirely on your machine and doesn't require cloud APIs or API keys. That means:
|
|
47
|
-
|
|
48
|
-
- β
**Privacy-first**: no telemetry, no server round-trips
|
|
49
|
-
- β
**EU & GDPR-friendly**: designed with compliance in mind
|
|
50
|
-
- β
**Developer control**: full transparency and override options
|
|
51
|
-
- β
**Offline support**: works even without an internet connection
|
|
52
|
-
|
|
53
|
-
---
|
|
23
|
+
### 2οΈβ£ Check Available Commands
|
|
54
24
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- macOS: `brew install ollama`
|
|
59
|
-
- Windows: [Download here](https://ollama.com/download)
|
|
60
|
-
- Start Ollama after installing.
|
|
61
|
-
|
|
62
|
-
2. **Install scai globally:**
|
|
63
|
-
```bash
|
|
64
|
-
npm install -g scai
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
3. **Initialize models:**
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
scai init
|
|
71
|
-
```
|
|
25
|
+
```bash
|
|
26
|
+
scai --help
|
|
27
|
+
```
|
|
72
28
|
|
|
73
29
|
---
|
|
74
30
|
|
|
75
|
-
##
|
|
31
|
+
## π REPL Mode (Local AI Queries)
|
|
76
32
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
### Usage
|
|
33
|
+
Start an interactive REPL to ask natural-language questions about your code:
|
|
80
34
|
|
|
81
35
|
```bash
|
|
82
|
-
|
|
83
|
-
scai agent run comments tests -f path/to/file.ts
|
|
84
|
-
|
|
85
|
-
# Run agent on an entire folder
|
|
86
|
-
scai agent run comments tests -f path/to/folder
|
|
36
|
+
scai shell
|
|
87
37
|
```
|
|
88
38
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
* `summary` β Summarize a file
|
|
92
|
-
* `comments` β Add inline comments to code
|
|
93
|
-
* `tests` β Generate test stubs (ALPHA)
|
|
39
|
+
Once in the REPL, you can:
|
|
94
40
|
|
|
95
|
-
|
|
41
|
+
* Ask questions freely about your codebase:
|
|
96
42
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
43
|
+
```text
|
|
44
|
+
scai> How many functions in spatialmap.js are missing tests?
|
|
45
|
+
scai> Summarize utils/helpers.ts
|
|
46
|
+
scai> Where are all the database queries defined?
|
|
47
|
+
scai> List files involved in authentication
|
|
48
|
+
```
|
|
102
49
|
|
|
103
|
-
*
|
|
104
|
-
* The agent resolves folders into all supported files (`.ts`, `.js`, etc.) automatically.
|
|
105
|
-
* Background processing allows you to queue multiple files without waiting for each one to finish interactively.
|
|
50
|
+
* Run slash commands inside the REPL for standard CLI operations:
|
|
106
51
|
|
|
107
|
-
|
|
52
|
+
```text
|
|
53
|
+
scai> /git commit
|
|
54
|
+
scai> /index list
|
|
55
|
+
scai> /index set /path/to/repo
|
|
56
|
+
scai> /index switch
|
|
57
|
+
scai> /index delete
|
|
58
|
+
```
|
|
108
59
|
|
|
109
|
-
|
|
60
|
+
* Execute shell commands directly:
|
|
110
61
|
|
|
111
|
-
|
|
62
|
+
```text
|
|
63
|
+
scai> !ls -la
|
|
64
|
+
scai> !git status
|
|
65
|
+
```
|
|
112
66
|
|
|
113
|
-
>
|
|
114
|
-
Ping [@ticcr](https://bsky.app/profile/ticcr.xyz) on Bluesky β I'd love to hear your thoughts!
|
|
67
|
+
> β
Asking questions in the REPL is free, GDPR-friendly, and entirely local.
|
|
115
68
|
|
|
116
69
|
---
|
|
117
70
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
To interact with GitHub and create pull requests, `scai` needs a personal access token with **repo** permissions.
|
|
121
|
-
|
|
122
|
-
1. **Create your GitHub Access Token**
|
|
123
|
-
Follow this link to generate a token: [https://github.com/settings/personal-access-tokens](https://github.com/settings/personal-access-tokens)
|
|
124
|
-
|
|
125
|
-
Make sure you enable at least:
|
|
126
|
-
|
|
127
|
-
* `repo` (Full control of private repositories)
|
|
128
|
-
* `workflow` (If you want PRs to trigger CI)
|
|
129
|
-
|
|
130
|
-
2. **Set the token in scai:**
|
|
131
|
-
|
|
132
|
-
```bash
|
|
133
|
-
scai auth set
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
This stores your token locally in a secure config file. You can inspect the setup at any time:
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
scai auth check
|
|
140
|
-
```
|
|
71
|
+
## π¦ Indexing Commands
|
|
141
72
|
|
|
142
|
-
|
|
73
|
+
Before asking questions, you should index your code repository:
|
|
143
74
|
|
|
144
|
-
|
|
145
|
-
scai index set /path/to/repo
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
This is the repo from which scai will look up pull requests that can be reviewed.
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
## βοΈ Usage Overview
|
|
152
|
-
|
|
153
|
-
### π§ How to Use `scai git commit`
|
|
154
|
-
|
|
155
|
-
Use AI to suggest a meaningful commit message based on your staged code:
|
|
75
|
+
* **Set index directory**
|
|
156
76
|
|
|
157
77
|
```bash
|
|
158
|
-
|
|
159
|
-
scai git commit
|
|
78
|
+
scai index set /path/to/repo
|
|
160
79
|
```
|
|
161
80
|
|
|
162
|
-
|
|
81
|
+
* **Start indexing**
|
|
163
82
|
|
|
164
83
|
```bash
|
|
165
|
-
scai
|
|
84
|
+
scai index start
|
|
166
85
|
```
|
|
167
86
|
|
|
168
|
-
|
|
169
|
-
1. Suggest a commit message based on your `git diff --cached`
|
|
170
|
-
2. Propose a changelog entry (if relevant)
|
|
171
|
-
3. Allow you to approve, regenerate, or skip the changelog
|
|
172
|
-
4. Automatically stage and commit the changes
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
### π§ How to Use `scai git review`
|
|
87
|
+
* **List all indexed repositories**
|
|
177
88
|
|
|
178
89
|
```bash
|
|
179
|
-
scai
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
This will show you pull requests assigned to you for review:
|
|
183
|
-
|
|
184
|
-
* Understand the diffs using a local model
|
|
185
|
-
* Generate a structured pull request:
|
|
186
|
-
|
|
187
|
-
* β
Title
|
|
188
|
-
* β
Summary of changes
|
|
189
|
-
* β
Explanation of why the changes matter
|
|
190
|
-
* β
Optional changelog bullets
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
SCAI supports an integrated review flow for GitHub pull requests. To get started:
|
|
194
|
-
|
|
195
|
-
1. **Set your working index directory (once per repo):**
|
|
196
|
-
|
|
197
|
-
```sh
|
|
198
|
-
scai index set /path/to/repo
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
2. **Authenticate with GitHub:**
|
|
202
|
-
```sh
|
|
203
|
-
scai git review
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
This command will query you for the Personal Access Token and set it for you.
|
|
207
|
-
You may also do this with the auth commands below
|
|
208
|
-
|
|
209
|
-
```sh
|
|
210
|
-
scai auth set
|
|
211
|
-
scai auth check
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
3. **Fetch and review pull requests:**
|
|
215
|
-
|
|
216
|
-
```sh
|
|
217
|
-
scai git review
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
Use `-a` to list all PRs that require a review:
|
|
221
|
-
|
|
222
|
-
```sh
|
|
223
|
-
scai git review -a
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
#### Example Workflow
|
|
227
|
-
|
|
228
|
-
```sh
|
|
229
|
-
$ scai git review -a
|
|
230
|
-
π¦ Resolving GitHub repo info from indexDir: ./
|
|
231
|
-
π Git origin URL: git@github.com:org/repo.git
|
|
232
|
-
β
Parsed: owner='org', repo='repo'
|
|
233
|
-
π€ Authenticated user: dev-user123
|
|
234
|
-
|
|
235
|
-
π Fetching pull requests and diffs...
|
|
236
|
-
β
Fetched 5 PR(s) with diffs.
|
|
237
|
-
|
|
238
|
-
π¦ Open Pull Requests with review requested:
|
|
239
|
-
| # | ID | TITLE | AUTHOR | STATUS | CREATED | REVIEWERS | REVIEWS |
|
|
240
|
-
| - | ---- | ----------------------------- | ---------- | ------ | ---------- | ----------------------------- | ------------------- |
|
|
241
|
-
| 1 | #120 | fix/session-timeout | dev-alice | Open | 2025-08-08 | code-analyzer\[bot], dev-bob | β
Approved |
|
|
242
|
-
| 2 | #118 | feature/1482-support-wfs2 | dev-carol | Open | 2025-08-07 | code-analyzer\[bot], dev-dave | β
Approved |
|
|
243
|
-
| 3 | #117 | refactor/win-server-support | dev-erin | Open | 2025-08-06 | dev-frank, dev-alice | β Changes Requested |
|
|
244
|
-
| 4 | #114 | bump/vue-i18n-9.14.5 | dependabot | Open | 2025-08-04 | code-analyzer\[bot] | β
Approved |
|
|
245
|
-
| 5 | #113 | bugfix/null-navigator-check | dev-bob | Open | 2025-08-03 | dev-alice, dev-carol | β
Approved |
|
|
246
|
-
|
|
247
|
-
π Choose a PR to review [1-2]: 1
|
|
248
|
-
β
Model response received.
|
|
249
|
-
|
|
250
|
-
π‘ AI-suggested review:
|
|
251
|
-
|
|
252
|
-
Solid improvement β this patch improves session stability and handles async state more reliably.
|
|
253
|
-
You might consider renaming `sessionManager` to better reflect its dual role in auth and persistence.
|
|
254
|
-
|
|
255
|
-
---
|
|
256
|
-
1) β
Approve
|
|
257
|
-
2) β Reject
|
|
258
|
-
3) βοΈ Edit
|
|
259
|
-
4) Write your own review
|
|
260
|
-
5) πͺ Cancel
|
|
90
|
+
scai index list
|
|
261
91
|
```
|
|
262
92
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
If you want to generate a changelog entry without committing:
|
|
93
|
+
* **Switch active repository**
|
|
266
94
|
|
|
267
95
|
```bash
|
|
268
|
-
scai
|
|
96
|
+
scai index switch
|
|
269
97
|
```
|
|
270
98
|
|
|
271
|
-
|
|
272
|
-
- Analyze the current `git diff` (staged or unstaged)
|
|
273
|
-
- Propose a list of **user-facing changes** in clean markdown bullet points
|
|
274
|
-
- Let you accept, regenerate, or skip the update
|
|
275
|
-
- Append the entry to `CHANGELOG.md` and stage it if accepted
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
### π οΈ Code Generation Commands (`gen` group)
|
|
99
|
+
* **Delete a repository from index**
|
|
279
100
|
|
|
280
101
|
```bash
|
|
281
|
-
scai
|
|
282
|
-
scai gen summ <file>
|
|
283
|
-
scai gen changelog
|
|
284
|
-
scai gen tests <file>
|
|
102
|
+
scai index delete
|
|
285
103
|
```
|
|
286
104
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
</br>
|
|
290
|
-
|
|
291
|
-
```bash
|
|
292
|
-
scai gen comm src/ utils/helpers.ts
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
</br>
|
|
296
|
-
|
|
297
|
-
This will add comments to all `.ts` and `.js` files under `src/` and to `utils/helpers.ts`.
|
|
298
|
-
|
|
299
|
-
</br>
|
|
300
|
-
|
|
301
|
-
* `summ`: Summarize a file
|
|
302
|
-
|
|
303
|
-
You can also pipe file content directly:
|
|
304
|
-
|
|
305
|
-
```bash
|
|
306
|
-
cat src/utils/math.ts | scai gen summ
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
</br>
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
* `changelog`: Update or create `CHANGELOG.md` from Git diff
|
|
313
|
-
|
|
314
|
-
* `tests`: Create Jest test stubs (ALPHA)
|
|
105
|
+
> Only indexed repositories can be queried by scai.
|
|
315
106
|
|
|
316
107
|
---
|
|
317
108
|
|
|
318
109
|
## βοΈ Configuration
|
|
319
110
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
* **Set model:**
|
|
323
|
-
|
|
324
|
-
```bash
|
|
325
|
-
scai config set-model codellama:7b
|
|
326
|
-
```
|
|
327
|
-
* **Set language:**
|
|
328
|
-
|
|
329
|
-
```bash
|
|
330
|
-
scai config set-lang ts
|
|
331
|
-
```
|
|
332
|
-
* **Show config:**
|
|
333
|
-
|
|
334
|
-
To see the config for the active repo
|
|
335
|
-
```bash
|
|
336
|
-
scai config show
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
To see the config for all repos
|
|
340
|
-
|
|
341
|
-
```bash
|
|
342
|
-
scai config show --raw
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
---
|
|
346
|
-
|
|
347
|
-
## Commands
|
|
348
|
-
|
|
349
|
-
### `index`
|
|
350
|
-
The `index` command is used to manage and perform operations on the indexed files and repositories. It allows you to control which repository you're working with and have indexed.
|
|
351
|
-
|
|
352
|
-
#### `scai index start`
|
|
353
|
-
|
|
354
|
-
Index supported files in the configured index directory.
|
|
355
|
-
|
|
356
|
-
```bash
|
|
357
|
-
scai index set <dir>
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
Or just this for cwd (current working dir)
|
|
111
|
+
Set the AI model for local usage (recommended: `qwen3-coder:30b`):
|
|
361
112
|
|
|
362
113
|
```bash
|
|
363
|
-
scai
|
|
114
|
+
scai config set-model qwen3-coder:30b
|
|
364
115
|
```
|
|
365
116
|
|
|
366
|
-
|
|
367
|
-
```bash
|
|
368
|
-
scai index list
|
|
369
|
-
```
|
|
117
|
+
Check current configuration:
|
|
370
118
|
|
|
371
|
-
List all indexed repositories.
|
|
372
119
|
```bash
|
|
373
|
-
scai
|
|
120
|
+
scai config show --raw
|
|
374
121
|
```
|
|
375
122
|
|
|
376
|
-
|
|
123
|
+
---
|
|
377
124
|
|
|
378
|
-
|
|
125
|
+
## π§ Git Commit Assistant
|
|
379
126
|
|
|
380
|
-
|
|
381
|
-
This removes the repository entry from the `config.json` file, but does **not** delete the repository folder on disk.
|
|
127
|
+
Use AI to suggest meaningful commit messages based on your staged changes:
|
|
382
128
|
|
|
383
129
|
```bash
|
|
384
|
-
|
|
130
|
+
git add .
|
|
131
|
+
scai git commit
|
|
385
132
|
```
|
|
386
133
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
## ποΈ Maintenance & Utilities
|
|
390
|
-
# Database Commands
|
|
391
|
-
|
|
392
|
-
Your CLI now supports a set of **database management commands** under the `db` namespace. These commands allow you to check the status of the database, reset it, or run migrations.
|
|
134
|
+
This generates a commit message reflecting your changes and context, entirely locally.
|
|
393
135
|
|
|
394
136
|
---
|
|
395
137
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
#### π Check Database
|
|
399
|
-
|
|
400
|
-
```bash
|
|
401
|
-
scai db check
|
|
402
|
-
```
|
|
138
|
+
## π GitHub Authentication
|
|
403
139
|
|
|
404
|
-
|
|
140
|
+
To work with GitHub for repositories, scai needs a Personal Access Token:
|
|
405
141
|
|
|
406
|
-
*
|
|
407
|
-
* Prints detailed output directly in the console.
|
|
408
|
-
|
|
409
|
-
---
|
|
410
|
-
|
|
411
|
-
#### β»οΈ Reset Database
|
|
142
|
+
* **Set your token:**
|
|
412
143
|
|
|
413
144
|
```bash
|
|
414
|
-
scai
|
|
145
|
+
scai auth set
|
|
415
146
|
```
|
|
416
147
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
* Will ask for confirmation before proceeding.
|
|
420
|
-
* Respond with `y` or `Y` to confirm.
|
|
421
|
-
* Any other key (including `n`, `N`, or just pressing **Enter**) will cancel the reset.
|
|
422
|
-
|
|
423
|
-
---
|
|
424
|
-
|
|
425
|
-
#### π¦ Run Migrations
|
|
148
|
+
* **Check your token:**
|
|
426
149
|
|
|
427
150
|
```bash
|
|
428
|
-
scai
|
|
151
|
+
scai auth check
|
|
429
152
|
```
|
|
430
153
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
Note the **Migrate** command is for **internal use only**. Do **not** run it unless explicitly instructed, as it may delete existing data or corrupt your local database.
|
|
434
|
-
|
|
435
|
-
If you're upgrading from an earlier version, please run the following commands to avoid indexing issues:
|
|
154
|
+
* **Reset your token:**
|
|
436
155
|
|
|
437
156
|
```bash
|
|
438
|
-
scai
|
|
439
|
-
scai index
|
|
157
|
+
scai auth reset
|
|
440
158
|
```
|
|
441
|
-
</br>
|
|
442
|
-
|
|
443
|
-
---
|
|
444
|
-
|
|
445
|
-
### β
Example Workflow
|
|
446
|
-
|
|
447
|
-
1. **Check** current database state:
|
|
448
|
-
|
|
449
|
-
```bash
|
|
450
|
-
scai db check
|
|
451
|
-
```
|
|
452
|
-
|
|
453
|
-
2. Confirm you're in the correct repo.
|
|
454
|
-
|
|
455
|
-
```bash
|
|
456
|
-
scai index list
|
|
457
|
-
```
|
|
458
|
-
|
|
459
|
-
Use the switch command to switch if necessary.
|
|
460
|
-
|
|
461
|
-
```bash
|
|
462
|
-
scai index switch
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
2. If necessary, **reset** the database:
|
|
466
|
-
|
|
467
|
-
```bash
|
|
468
|
-
scai db reset
|
|
469
|
-
```
|
|
470
|
-
|
|
471
|
-
β Confirm with `y` when prompted.
|
|
472
|
-
|
|
473
|
-
</br>
|
|
474
159
|
|
|
475
160
|
---
|
|
476
161
|
|
|
477
|
-
##
|
|
478
|
-
|
|
479
|
-
These features are experimental and subject to change:
|
|
480
|
-
|
|
481
|
-
* `find`, `ask`
|
|
482
|
-
* `daemon`, `stop-daemon`
|
|
483
|
-
* `gen tests` (test generation)
|
|
484
|
-
|
|
485
|
-
<br>
|
|
162
|
+
## π§ Example Queries in REPL
|
|
486
163
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
*
|
|
492
|
-
*
|
|
493
|
-
*
|
|
494
|
-
|
|
495
|
-
You won't gain much value from the index unless you scope it to one repository.
|
|
164
|
+
* `Summarize spatialmap.js`
|
|
165
|
+
* `Explain utils/helpers.ts architecture`
|
|
166
|
+
* `List all functions without tests in services/`
|
|
167
|
+
* `Show where database queries are defined`
|
|
168
|
+
* `Highlight potential memory leaks`
|
|
169
|
+
* `Describe how authentication works`
|
|
170
|
+
* `Which files handle error handling in contextReview.ts`
|
|
171
|
+
* `Summarize repo architecture`
|
|
496
172
|
|
|
497
173
|
---
|
|
498
174
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
1. **Set index directory:**
|
|
502
|
-
|
|
503
|
-
```bash
|
|
504
|
-
scai index set /path/to/repo
|
|
505
|
-
```
|
|
506
|
-
|
|
507
|
-
2. **Index your repo (once):**
|
|
508
|
-
|
|
509
|
-
```bash
|
|
510
|
-
scai index start
|
|
511
|
-
```
|
|
512
|
-
|
|
513
|
-
3. The daemon is designed to **consume minimal resources** and run unobtrusively. You can control it with:
|
|
514
|
-
|
|
515
|
-
```bash
|
|
516
|
-
scai daemon # Start or show daemon status
|
|
517
|
-
scai stop-daemon # Stop the background indexer
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
4. **Keyword search:**
|
|
522
|
-
|
|
523
|
-
```bash
|
|
524
|
-
scai find YourClassName
|
|
525
|
-
```
|
|
526
|
-
|
|
527
|
-
5. **Natural-language questions:**
|
|
528
|
-
|
|
529
|
-
### π§ Natural-language questions
|
|
530
|
-
|
|
531
|
-
Ask questions about your codebase using `scai ask`.
|
|
532
|
-
|
|
533
|
-
You can run it in two ways:
|
|
175
|
+
## π Privacy & GDPR
|
|
534
176
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
scai ask "How does the controller work?"
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
2. **Interactive prompt**
|
|
542
|
-
|
|
543
|
-
```bash
|
|
544
|
-
scai ask
|
|
545
|
-
```
|
|
546
|
-
|
|
547
|
-
**Press enter**
|
|
548
|
-
, then type your question when prompted:
|
|
549
|
-
|
|
550
|
-
```
|
|
551
|
-
> How does the controller work?
|
|
552
|
-
```
|
|
553
|
-
|
|
554
|
-
</br>
|
|
555
|
-
|
|
556
|
-
### π¨ **OBS** π¨
|
|
557
|
-
|
|
558
|
-
`find` and `ask` rely on that indexβwithout it they will return no useful results.
|
|
177
|
+
* Fully local β no API keys, no cloud
|
|
178
|
+
* GDPR-friendly, made in Denmark/EU with love β€οΈ
|
|
179
|
+
* Free to ask questions about your code
|
|
559
180
|
|
|
560
181
|
---
|
|
561
182
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
Creates a backup of the .scai folder in the user root dir.
|
|
565
|
-
|
|
566
|
-
```bash
|
|
567
|
-
scai backup
|
|
568
|
-
```
|
|
569
|
-
|
|
570
|
-
Results in this:
|
|
571
|
-
~/.scai_backup_2025-08-12T06-58-00-227Z/
|
|
183
|
+
## π Feedback & Support
|
|
572
184
|
|
|
573
|
-
|
|
185
|
+
Reach out with feedback or questions:
|
|
574
186
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
**scai is free to use** for individuals, teams, and commercial projects.
|
|
578
|
-
|
|
579
|
-
You may:
|
|
580
|
-
|
|
581
|
-
* β
Use internally or commercially
|
|
582
|
-
* β
Fork and improve
|
|
583
|
-
* β
Recommend to others
|
|
584
|
-
|
|
585
|
-
You may **not**:
|
|
586
|
-
|
|
587
|
-
* β Resell as a product or service
|
|
588
|
-
* β Claim ownership of the tool
|
|
589
|
-
|
|
590
|
-
</br>
|
|
591
|
-
|
|
592
|
-
### π License
|
|
593
|
-
|
|
594
|
-
Free for personal and internal company use only.
|
|
595
|
-
Commercial use (resale, SaaS, inclusion in paid tools) is prohibited.
|
|
596
|
-
Contact me for commercial licensing.
|
|
187
|
+
* Threads: [@scai.dk](https://threads.net/@scai.dk)
|
|
188
|
+
* Bugs, feature requests, or ideas welcome!
|
|
597
189
|
|
|
598
190
|
---
|
|
599
191
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
## π Feedback
|
|
603
|
-
|
|
604
|
-
Questions, ideas, or bugs?
|
|
605
|
-
Ping [@ticcr](https://bsky.app/profile/ticcr.xyz) on Bluesky β I'd love to hear your thoughts!
|
|
606
|
-
|
|
607
|
-
---
|
|
192
|
+
Enjoy your AI-powered coding companion, fully local, private, and developer-friendly!
|