scai
Version:
> **AI-powered CLI for local code analysis, commit message suggestions, and natural-language queries.** 100% local, private, GDPR-friendly, made in Denmark/EU with ❤️.
193 lines (124 loc) • 3.7 kB
Markdown
# ⚙️ SCAI — Source Code AI 🌿
> **AI-powered CLI for local code analysis, commit message suggestions, and natural-language queries.** 100% local, private, GDPR-friendly, made in Denmark/EU with ❤️.
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.**
> ⚠️ **Alpha Version Notice:** If you have previously installed Scai, please run `scai db reset && scai index start` before using this version.
## 💻 Getting Started
### 1️⃣ Install & Initialize
```bash
npm install -g scai
scai init
scai index start
```
This will initialize local models (recommended: `qwen3-coder:30b`) and start indexing your code repository.
### 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 freely about your codebase:
```text
scai> How many functions in spatialmap.js are missing tests?
scai> Summarize utils/helpers.ts
scai> Where are all the database queries defined?
scai> List files involved in authentication
```
* Run slash commands inside the REPL for standard CLI operations:
```text
scai> /git commit
scai> /index list
scai> /index set /path/to/repo
scai> /index switch
scai> /index delete
```
* Execute shell commands directly:
```text
scai> !ls -la
scai> !git status
```
> ✅ Asking questions in the REPL is free, GDPR-friendly, and entirely local.
## 📦 Indexing Commands
Before asking questions, you should index your code repository:
* **Set index directory**
```bash
scai index set /path/to/repo
```
* **Start indexing**
```bash
scai index start
```
* **List all indexed repositories**
```bash
scai index list
```
* **Switch active repository**
```bash
scai index switch
```
* **Delete a repository from index**
```bash
scai index delete
```
> Only indexed repositories can be queried by scai.
## ⚙️ Configuration
Set the AI model for local usage (recommended: `qwen3-coder:30b`):
```bash
scai config set-model qwen3-coder:30b
```
Check current configuration:
```bash
scai config show --raw
```
## 🔧 Git Commit Assistant
Use AI to suggest meaningful commit messages based on your staged changes:
```bash
git add .
scai git commit
```
This generates a commit message reflecting your changes and context, entirely locally.
## 🔑 GitHub Authentication
To work with GitHub for repositories, scai needs a Personal Access Token:
* **Set your token:**
```bash
scai auth set
```
* **Check your token:**
```bash
scai auth check
```
* **Reset your token:**
```bash
scai auth reset
```
## 🧠 Example Queries in REPL
* `Summarize spatialmap.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`
* `Which files handle error handling in contextReview.ts`
* `Summarize repo architecture`
## 🔐 Privacy & GDPR
* Fully local — no API keys, no cloud
* GDPR-friendly, made in Denmark/EU with love ❤️
* Free to ask questions about your code
## 🙌 Feedback & Support
Reach out with feedback or questions:
* Threads: [@scai.dk](https://threads.net/@scai.dk)
* Bugs, feature requests, or ideas welcome!
Enjoy your AI-powered coding companion, fully local, private, and developer-friendly!