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.
Files changed (2) hide show
  1. package/README.md +162 -85
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,146 +1,223 @@
1
- # ⚙️ scai — Smart Commit AI
1
+ # ⚙️ scai — Semantic CLI Assistant
2
2
 
3
- > AI-powered CLI tool for smart commit messages, code comments, summaries, test generation, and changelogsall powered by local models.
3
+ > AI-powered CLI tool for commits, summaries, search, questions, and moreusing local models.
4
4
 
5
- **scai** (Smart Commit AI) is a lightweight, privacy-focused CLI tool that helps developers work faster and cleaner:
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 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
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
- - ⚡️ Powered by local AI models (e.g., `llama3`, `codellama`)
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
- - 🔒 No external services or APIs required
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
- At scai, we believe your code and your workflow — should stay **yours**. That's why we prioritize **local models** and **privacy-first** development:
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
- - ✅ **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.
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
- - On **Windows**: [Download Ollama](https://ollama.com/download)
41
- - On **macOS**: via Homebrew (`brew install ollama`) or [download from Ollama](https://ollama.com)
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
- ```bash
45
- npm install -g scai
45
+ ```bash
46
+ npm install -g scai
46
47
  ```
47
48
 
48
- 3. **Initialize the tool and models:**
49
- ```bash
50
- scai init
51
- ```
49
+ 3. **Initialize models:**
52
50
 
53
- This will download required models and set up scai.
51
+ ```bash
52
+ scai init
53
+ ```
54
54
 
55
- ---
56
55
 
57
- ## ⚒️ Usage Examples
56
+ ## ⚒️ Usage Overview
58
57
 
59
- ### 🔧 Git Commands
58
+ ### 🔧 Git Commit Suggestions
60
59
 
61
- - **Suggest a commit message:**
62
- ```bash
63
- git add .
64
- scai git sugg
65
- ```
60
+ ```bash
61
+ git add .
62
+ scai git sugg
63
+ ```
66
64
 
67
- *Example output:*
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
- To commit automatically with the suggestion:
73
- ```bash
74
- scai git sugg --commit
75
- ```
68
+ ```bash
69
+ scai git sugg --commit
70
+ ```
76
71
 
77
- ### 🛠️ Generate Code-Related Output (`gen` commands)
72
+ ---
78
73
 
79
- - **Summarize a code file:**
80
- ```bash
81
- scai gen summ <file>
82
- ```
74
+ ### 🛠️ Code Generation Commands (`gen` group)
83
75
 
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
- ```
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
- - **Generate tests for a code file:**
90
- ```bash
91
- scai gen tests <file>
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
- Creates a Jest test file for the specified JavaScript/TypeScript module.
88
+ You can also pipe file content directly:
95
89
 
96
- - **Update the changelog:**
97
- ```bash
98
- scai gen changelog
99
- ```
90
+ ```bash
91
+ cat src/utils/math.ts | scai gen summ
92
+ ```
100
93
 
101
- Analyzes the current Git diff and updates (or creates) a `CHANGELOG.md` file with relevant changes.
94
+ ---
102
95
 
103
96
  ## ⚙️ Configuration
104
97
 
105
- scai stores your configuration locally in the `~/.scai/config.json` file. You can configure the model and programming language settings as follows:
98
+ scai stores settings in `~/.scai/config.json`. You can override or view them:
106
99
 
107
- - **Set the model:**
108
- ```bash
109
- scai set model <model>
110
- ```
100
+ * **Set model:**
111
101
 
112
- e.g., `scai set model codellama:7b`
102
+ ```bash
103
+ scai set model codellama:7b
104
+ ```
105
+ * **Set language:**
113
106
 
114
- - **Set the programming language:**
115
- ```bash
116
- scai set lang <lang>
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
- e.g., `scai set lang rust`
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 config
147
+ scai set index-dir /path/to/repo
124
148
  ```
125
149
 
126
- You can also use global options `--model` and `--lang` with any command to override the settings:
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 --model codellama:34b --lang ts git sugg
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 companies — including in commercial work.
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
- But you may not:
143
- - Repackage or resell **scai** as a product or SaaS
144
- - Claim ownership of the tool
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
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scai",
3
- "version": "0.1.30",
3
+ "version": "0.1.31",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "scai": "./dist/index.js"