scai 0.1.30 → 0.1.32

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