scai
Version:
> **AI-powered CLI for local code analysis, commit message suggestions, and natural-language queries.** > **100% local • No token cost • Private by design • GDPR-friendly** — made in Denmark/EU with ❤️.
309 lines (195 loc) • 8.11 kB
Markdown
# ⚙️ SCAI — Source Code AI 🌿
> **AI-powered CLI for local code analysis, commit message suggestions, and natural-language queries.**
> **100% local • No token cost • Private by design • GDPR-friendly** — made in Denmark/EU with ❤️.
🔗 **Website:** [https://scai.dk](https://scai.dk)
SCAI is your AI coding companion in the terminal. Stay focused on coding while SCAI helps you understand, analyze, and reason about your codebase using local language models.
**Local Model Note:** SCAI runs entirely on local LLMs. This means **no API keys, no token cost, and full privacy**, but also **more limited capabilities** compared to cloud-hosted AI.
> ⚠️ **Alpha Version Notice**
> If you have previously installed SCAI, please run:
>
> bash
> scai db reset && scai index start
>
>
> before using this version.
## 🧠 Why SCAI?
SCAI is not just another AI tool — it's a **developer-first**, **privacy-focused**, and **local-first** coding companion. Here's why SCAI stands out:
### 🔐 **100% Local & Private by Design**
Unlike cloud-based AI tools, SCAI runs entirely on your machine. No data leaves your environment — making it ideal for **sensitive codebases** and **GDPR-compliant workflows**.
### 🧠 **Deep Code Understanding**
SCAI doesn't just parse code — it **understands** it. With background indexing, static analysis, and language-aware parsing, SCAI helps you explore, refactor, and debug with confidence.
### 📦 **No Token Costs or API Keys**
SCAI works offline, with **zero token usage**. You don’t pay for API calls or subscribe to cloud services. Just install and go.
### 🛠️ **Developer-Focused Toolset**
From commit message generation to architecture summaries, SCAI integrates directly into your workflow. It's built for developers, by developers.
### 🇩🇰 **Built in Denmark/EU**
SCAI is developed in the European Union, ensuring compliance with data protection laws and a focus on privacy-first development.
> ✅ SCAI is your **AI coding assistant that respects your privacy**, enhances your productivity, and works **entirely offline**.
## 🗣️ Language Support (Important)
SCAI is currently **tested and validated only on the following languages**:
* **JavaScript (JS)**
* **TypeScript (TS)**
* **Java**
Other languages may work partially, but analysis quality, indexing accuracy, and agent behavior are **not guaranteed** outside these languages. Broader language support is planned, but for now SCAI should be considered **JS/TS/Java-first**.
## 💻 Getting Started
### 1️⃣ Install & Initialize
bash
npm install -g scai
scai init
scai index start
This initializes local models (recommended: `qwen3-coder:30b`) and starts indexing your code repository.
> ⏳ **Note:** Initial indexing and analysis can take **minutes to hours** depending on repository size and enabled analysis tools.
### 2️⃣ Check Available Commands
```bash
scai --help
```
## 🏠 REPL Mode (Local AI Queries)
Start an interactive REPL to ask natural-language questions about your code:
```bash
scai shell
```
Once in the REPL, you can:
### Ask questions about your codebase. Be specific for better results.
```text
scai> what does withContext function do in index.ts file?
scai> How many functions in config.js are missing tests?
scai> Write me comprehensive comments for componentMap.js and typescript.ts files
scai> Summarize utils/helpers.ts
scai> Where are all the database queries defined?
scai> List files involved in authentication
```
### Run CLI commands from inside the REPL
```text
scai> /git commit
scai> /index list
scai> /index set /path/to/repo
scai> /index switch
scai> /index delete
```
### Execute shell commands
```text
scai> !ls -la
scai> !git status
```
> ✅ REPL queries are free, offline, GDPR-friendly, and **no token cost**.
## 📦 Repository Indexing
Before SCAI can answer questions, your repository must be indexed.
### Common Index Commands
```bash
scai index set /path/to/repo
scai index start
scai index list
scai index switch
scai index delete
```
Only indexed repositories can be queried.
## 🧠 Background Indexing & Analysis (Daemon)
SCAI performs **deep repository indexing and static analysis** using background workers. This includes:
* File structure discovery
* Language-aware parsing (JS / TS / Java)
* Symbol and dependency mapping
* Heuristic analysis for tests, architecture, and patterns
⚠️ **Important:** On first install or on large repositories, this process can take **several hours**.
All background work is handled by the **SCAI daemon**, which can be fully controlled from the CLI.
### Daemon Commands
```bash
scai daemon start
scai daemon stop
scai daemon restart
scai daemon status
scai daemon unlock
scai daemon logs
```
You can safely stop the daemon at any time. Indexing and analysis will resume when restarted.
## ⚙️ Configuration
Set the local AI model (recommended):
```bash
scai config set-model qwen3-coder:30b
```
View current configuration:
```bash
scai config show --raw
```
## 🔧 Git Commit Assistant
Generate meaningful commit messages based on staged changes:
```bash
git add .
scai git commit
```
All analysis is performed locally — **no token usage, no cloud calls**.
## 🔑 GitHub Authentication
For GitHub-related features, SCAI requires a Personal Access Token.
```bash
scai auth set
scai auth check
scai auth reset
```
## 🧠 Example Queries
* `Summarize codeTransform.js`
* `Explain utils/helpers.ts architecture`
* `List all functions without tests in services/`
* `Show where database queries are defined`
* `Highlight potential memory leaks`
* `Describe how authentication works`
* `Summarize repo architecture`
## 🔐 Privacy & GDPR
* Fully local — no cloud calls
* No API keys
* **No token cost**
* GDPR-friendly, built in Denmark/EU 🇩🇰
## 🙌 Feedback & Support
Feedback, bugs, and ideas are very welcome:
* 🌍 Website: [https://scai.dk](https://scai.dk)
* 🧵 Threads: [@scai.dk](https://threads.net/@scai.dk)
<br>
<br>
<br>
## 🔐 License & Usage Terms
Copyright © SCAI
All rights reserved.
SCAI is **free to use for non-commercial purposes only**, subject to the terms below.
## ✅ Permitted Use
You may use SCAI **without charge** for the following purposes:
* Personal projects
* Educational use
* Research and experimentation
* Non-commercial open-source contributions
* Internal evaluation or proof-of-concept work
You may also **fork, modify, and redistribute** the source code, provided that such use remains **strictly non-commercial**.
## 🚫 Restricted Use
The following uses are **not permitted without a commercial license**:
* Commercial use of any kind
* Enterprise or organizational deployment
* Use as part of a paid product, service, or subscription
* Use in consultancy, client work, or billable services
* Bundling or integrating SCAI into commercial software or internal enterprise tooling
* Resale, sublicensing, or redistribution for commercial purposes
## 🏢 Commercial & Enterprise Licensing
**Commercial and enterprise use requires a paid license and explicit permission from the author.**
Organizations or individuals wishing to use SCAI in a commercial context must obtain a commercial license **prior to such use**.
Please contact the author to discuss commercial licensing terms.
## ⚖️ Disclaimer
This software is provided **"as is"**, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement.
In no event shall the author be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.
### 📄 Summary (Non-Binding)
* Free for personal and non-commercial use
* Commercial and enterprise use requires a paid license
* Commercial redistribution is prohibited