webxos commited on
Commit
3bdc334
·
verified ·
1 Parent(s): 0c5ed6e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +129 -0
README.md CHANGED
@@ -1,3 +1,132 @@
1
  ---
2
  license: mit
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
  ---
4
+ (Under Development)
5
+ ```
6
+ ███████╗████████╗ █████╗ ██████╗██╗ ██╗
7
+ ██╔════╝╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝
8
+ ███████╗ ██║ ███████║██║ █████╔╝
9
+ ╚════██║ ██║ ██╔══██║██║ ██╔═██╗
10
+ ███████║ ██║ ██║ ██║╚██████╗██║ ██╗
11
+ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
12
+ ```
13
+
14
+ **Embed‑Driven Repository Architect**
15
+ *Local, offline, zero‑API‑key code templating & versioning, powered by Ollama embeddings*
16
+ </div>
17
+
18
+ ---
19
+
20
+ STACK is a **single‑file Python CLI** that builds, templates, and version‑controls projects using **vector embeddings**.
21
+ It uses the **nomic‑embed‑text** model (running locally via [Ollama](https://ollama.com)) to semantically match natural language descriptions with pre‑built code templates.
22
+ Everything happens **offline**, **no API keys**, **no cloud** — your code never leaves your machine.
23
+
24
+ ### Features
25
+
26
+ - **Zero‑dependency bootstrapping** – auto‑creates a Python virtual environment on first run.
27
+ - **Semantic template injection** – describe what you want (`web server`, `login form`) and STACK injects the best matching files.
28
+ - **Extensible template system** – hot‑reloads templates from a folder, supports JSON imports.
29
+ - **Vector memory** – remembers your past actions and retrieves them for contextual suggestions.
30
+ - **Git‑first** – every injection happens in a feature branch, merged automatically.
31
+ - **Safe by design** – path traversal protection, atomic manifest writes, and graceful error handling.
32
+
33
+ ---
34
+
35
+ ## Requirements
36
+
37
+ - Python 3.10+
38
+ - Ollama installed and running (`ollama serve`).
39
+ - `git` available on your `PATH`.
40
+ - Ollama model nomic-embed-text pulled on to your system
41
+
42
+ STACK installs its own dependencies into an isolated virtual environment – you never need to run `pip install` yourself.
43
+
44
+ ---
45
+
46
+ ## Quick Start
47
+
48
+ ```bash
49
+ # Place the stack.py file in a folder on your system
50
+ cd ~/stack/ (The folder you have the file in)
51
+ python3 stack.py
52
+ ```
53
+
54
+ The first launch will:
55
+ 1. Create a virtual environment (`.stack_venv/`).
56
+ 2. Install `ollama` and other dependencies inside it.
57
+ 3. Pull the `nomic-embed-text` model if missing.
58
+ 4. Drop you into the interactive STACK shell.
59
+
60
+ ---
61
+
62
+ ## Commands
63
+
64
+ Inside the STACK shell (after the banner), type `/help` to see the full list:
65
+
66
+ | Command | What it does |
67
+ |--------|-------------|
68
+ | `/build <name>` | Create a new Git repository workspace |
69
+ | `/add <description>` | Find the best matching template and inject it into the workspace |
70
+ | `/import <file.json>` | Import external template bundles |
71
+ | `/list` | Show all available templates |
72
+ | `/status` | Display system status (workspace, Ollama, templates) |
73
+ | `/help` | Show this help |
74
+ | `/quit` | Exit STACK |
75
+
76
+ **Example workflow:**
77
+ ```
78
+ STACK > /build myproject
79
+ STACK > /add python web server with fastapi
80
+ STACK > /list
81
+ STACK > /status
82
+ STACK > /quit
83
+ ```
84
+
85
+ After `/add`, your workspace will contain the injected files, committed on a feature branch and merged to `main`.
86
+
87
+ ---
88
+
89
+ ## 📂 Template Management
90
+
91
+ Templates can be added in two ways:
92
+
93
+ ### 1. Folder hot‑reload
94
+ Place folders inside `stack_system/templates/`.
95
+ Each folder should contain:
96
+ - Code files (any structure)
97
+ - An optional `description.txt` (first line becomes the embedding description)
98
+
99
+ STACK will automatically detect changes every 2 seconds and regenerate the manifest.
100
+
101
+ ### 2. JSON import
102
+ Create a `.json` file like:
103
+ ```json
104
+ {
105
+ "template_name": {
106
+ "description": "Natural language description for embedding",
107
+ "files": {
108
+ "path/relative/to/workspace": "file content here"
109
+ }
110
+ }
111
+ }
112
+ ```
113
+ Then run `/import path/to/template.json` inside STACK.
114
+
115
+ ---
116
+
117
+ ## 📁 System Files
118
+
119
+ | Path | Purpose |
120
+ |------|--------|
121
+ | `./stack_system/` | Root directory for all STACK data |
122
+ | `./stack_system/current_workspace/` | Active Git workspace (changes after `/build`) |
123
+ | `./stack_system/templates/` | Hot‑reloadable template folder |
124
+ | `./stack_system/templates/manifest.json` | Auto‑generated template index (with embeddings) |
125
+ | `./stack_system/.stack_memory.json` | Vector memory store |
126
+ | `.stack_venv/` | Virtual environment (auto‑created) |
127
+
128
+ ---
129
+
130
+ ## License
131
+
132
+ MIT