scai
Version:
> **A local-first AI CLI for understanding, querying, and iterating on large codebases.** > **100% local • No token costs • No cloud • No prompt injection • Private by design**
379 lines (243 loc) • 7.79 kB
Markdown
# ⚙️ SCAI — Source Code AI 🌿
> **A local-first AI CLI for understanding, querying, and iterating on large codebases.**
> **100% local • No token costs • No cloud • No prompt injection • Private by design**
🔗 **Website:** [https://scai.dk](https://scai.dk)
🇪🇺 Built in Denmark / EU
## What is SCAI?
**SCAI** is an AI-powered command-line tool that helps developers explore and reason about source code using **local large language models only**.
Inspired by tools such as *Claude Code* and *Gemini CLI*, SCAI is designed to feel like a natural extension of the terminal. It enables natural-language interaction with your codebase while deliberately avoiding cloud dependencies and network-connected agents.
SCAI runs entirely on your local system:
* **No token costs** — no usage-based pricing
* **No internet access for agents**
* **No prompt injection from web content**
* No external AI APIs
* No telemetry or tracking
* No API keys
Your code never leaves your machine. All analysis and reasoning happens locally.
> **Local model tradeoff**
> SCAI uses local LLMs. Output quality depends on your hardware and selected model. Cloud-hosted systems may perform better on general reasoning tasks, but SCAI prioritizes privacy, predictability, and control.
## ⚠️ Alpha Status
SCAI is currently in **alpha**.
If you have previously installed SCAI, reset the local database before upgrading:
```bash
scai db reset
scai index start
```
Breaking changes and evolving behavior should be expected.
## Why SCAI?
### 🔐 Local-Only by Design
SCAI agents operate **entirely offline**.
They do not:
* Browse the web
* Fetch URLs
* Ingest external documents
* Execute remote prompts
**Security implications:**
* No prompt injection via web content
* No data exfiltration
* No hidden network calls
* Fully auditable execution
This makes SCAI suitable for **private repositories, regulated environments, and GDPR-compliant workflows**.
### 🧠 Codebase-Aware Analysis
SCAI builds and maintains a structured internal representation of your repository using:
* Language-aware parsing
* Symbol and dependency indexing
* Static and heuristic analysis
* Cross-file context tracking
This enables repository-level questions that go beyond single-file inspection.
### ✂️ Assisted Code Iteration (Early)
SCAI can assist with **lightweight, example-driven code iteration**, primarily focused on understanding and improving existing code rather than large-scale automated refactoring.
Current strengths include:
* Explaining what functions, files, or modules do
* Identifying patterns and responsibilities across files
* Generating or improving comments and documentation
* Highlighting structural or readability issues
* Suggesting small, localized improvements
Changes are **guided by indexed context and user prompts**, and are intended to support human review and decision-making.
Large-scale or fully automated repository-wide refactoring should currently be considered **experimental**.
### 🛠 Built for Developer Workflows
SCAI is a **terminal-native tool** designed to integrate cleanly into daily development:
* Natural-language queries over your codebase
* Code understanding and exploration
* Assisted iteration and suggestions
* Commit message generation
* Background indexing and analysis
* Interactive REPL
No browser UI. No cloud login. No vendor lock-in.
### 🇪🇺 Privacy & Compliance First
* Fully local execution
* No telemetry
* No cloud services
* Developed in Denmark / EU
* GDPR-friendly by default
## Language Support
SCAI is currently **tested and supported** for:
* **JavaScript**
* **TypeScript**
* **Java**
Other languages may work partially, but indexing quality, analysis accuracy, and agent behavior are **not guaranteed**.
SCAI should currently be considered **JS / TS / Java-first**.
## Getting Started
### Install & Initialize
```bash
npm install -g scai
scai init
scai index start
```
This:
* Initializes local configuration
* Starts the background daemon
* Begins indexing the current repository
> **Note**
> Initial indexing can take **minutes to hours**, depending on repository size and enabled analysis.
### Starting SCAI
Running the `scai` command with no arguments starts the interactive shell:
```bash
scai
```
You can also start it explicitly:
```bash
scai shell
```
### View Available Commands
```bash
scai --help
```
## Interactive REPL
The REPL is the primary interface for working with SCAI.
### 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 inside the REPL
```text
/index list
/index switch
/git commit
```
### Execute shell commands
```text
!git status
!ls -la
```
All interactions remain **offline and free**, with **no token usage**.
## Repository Indexing
Repositories must be indexed before querying:
```bash
scai index set /path/to/repo
scai index start
scai index list
scai index switch
scai index delete
```
Only indexed repositories are accessible to agents.
## Background Analysis (Daemon)
SCAI performs deep analysis in the background, including:
* File discovery
* AST parsing
* Dependency graph construction
* Symbol resolution
* Heuristic structure analysis
Daemon control:
```bash
scai daemon start
scai daemon stop
scai daemon restart
scai daemon status
scai daemon logs
```
Indexing progress resumes automatically after restart.
## Configuration
Set a local model (recommended):
```bash
scai config set-model qwen3-coder:30b
```
View configuration:
```bash
scai config show --raw
```
## Git Commit Assistant
Generate commit messages from staged changes:
```bash
git add .
scai git commit
```
All diff inspection and reasoning is performed locally.
## GitHub Authentication
Required only for GitHub-related features:
```bash
scai auth set
scai auth check
scai auth reset
```
## Privacy & Security Summary
* 100% local execution
* No internet access for agents
* No prompt injection from web content
* No API keys
* No token costs
* GDPR-friendly by default
## Feedback & Community
* 🌍 [https://scai.dk](https://scai.dk)
* 🧵 [https://threads.net/@scai.dk](https://threads.net/@scai.dk)
# License & Usage Terms
© SCAI — All rights reserved.
SCAI is **free for non-commercial use only**.
## Permitted Use
You may use SCAI free of charge for:
* Personal projects
* Educational use
* Research and experimentation
* Non-commercial open-source work
* Internal evaluation or proof-of-concepts
You may fork and modify the source code **for non-commercial purposes only**.
## Restricted Use
The following require a **commercial license**:
* Any commercial or enterprise use
* Consultancy or client work
* Paid products or services
* Internal enterprise tooling
* Commercial redistribution or resale
## Commercial Licensing
Commercial and enterprise use requires a **paid license** and explicit permission from the author.
Please contact the author to discuss licensing terms.
## Disclaimer
This software is provided **“as is”**, without warranty of any kind.
The author is not liable for any damages arising from its use.
### Non-Binding Summary
* Free for personal and non-commercial use
* Fully local, offline AI
* No token costs
* No prompt injection surface
* Commercial use requires a license