@itsautomata/prism 0.1.1

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Automata
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,243 @@
1
+ # prism
2
+
3
+ **free, local-first AI coding assistant**
4
+
5
+ Prism is an open source coding assistant that runs locally on your machine through Ollama, or cloud through OpenRouter (300+ models).
6
+
7
+
8
+ > actively built and tested. expect breaking changes. decentralized intelligence is cool
9
+
10
+ ![prism](https://raw.githubusercontent.com/itsautomata/prism/main/assets/prism_3.png)
11
+
12
+ ## quick start
13
+
14
+ requires Node.js 20+.
15
+
16
+ ```bash
17
+ npm install -g @itsautomata/prism
18
+ prism
19
+ ```
20
+
21
+ to run local (free, via ollama, requires Ollama v0.20.2+ for proper tool calling):
22
+
23
+ ```bash
24
+ brew install ollama
25
+ ollama serve
26
+ ollama pull deepseek-r1:14b
27
+ ```
28
+
29
+ ## shell completion
30
+
31
+ prism auto-installs shell completion the first time you run it (zsh and bash supported). after the first launch, restart your shell or run `exec $SHELL` to reload in place.
32
+
33
+ then:
34
+
35
+ ```bash
36
+ prism --<TAB> # shows all flags
37
+ prism --or <TAB> # shows openrouter models
38
+ prism <TAB> # shows local ollama models
39
+ ```
40
+
41
+ opt out of auto-install: set `PRISM_NO_AUTO_COMPLETION=1` in your environment before the first run.
42
+
43
+ re-install manually (or for a different shell):
44
+
45
+ ```bash
46
+ prism --install-completion # auto-detects your shell
47
+ prism --install-completion zsh # explicit
48
+ prism --install-completion bash # explicit
49
+ ```
50
+
51
+ ## choose your model
52
+
53
+ ### local (free, ollama)
54
+
55
+ ```bash
56
+ prism # deepseek-r1:14b (default)
57
+ prism qwen3:14b
58
+ ```
59
+
60
+ ### cloud (openrouter, 300+ models)
61
+
62
+ add your API key to `~/.prism/config.toml` (created on first run), then:
63
+
64
+ ```bash
65
+ prism --or qwen/qwen3.6-plus # $0.325/M tokens
66
+ prism --or deepseek/deepseek-v3.2-speciale # $0.40/M tokens
67
+ prism --or google/gemini-2.0-flash-lite-001 # $0.075/M
68
+ prism --or anthropic/claude-haiku-4.5 # $1.00/M tokens
69
+ ```
70
+
71
+ the model must support tool calling on openrouter. see [openrouter.ai/docs](https://openrouter.ai/docs) for available models.
72
+
73
+
74
+ ## sessions
75
+
76
+ prism auto-saves your conversation after every turn. resume where you left off:
77
+
78
+ ```bash
79
+ prism --continue # resume last session in this directory
80
+ prism -c # same
81
+ prism --or qwen3:14b --continue # resume with a different model
82
+ prism --sessions # list recent sessions (numbered)
83
+ prism -r 1 # resume the most recent session
84
+ prism -r 3 # resume the 3rd most recent
85
+ prism --resume <full-id> # resume by full id (for scripting)
86
+ ```
87
+
88
+ sessions saved at `~/.prism/sessions/`.
89
+
90
+ ## tools
91
+
92
+ | tool | what it does |
93
+ |------|-------------|
94
+ | Bash | execute shell commands |
95
+ | Read | read files, PDFs, Word docs, notebooks |
96
+ | Edit | exact string replacement |
97
+ | Write | create or overwrite files |
98
+ | Glob | find files by pattern |
99
+ | Grep | search file contents |
100
+ | Agent | spawn subagents for parallel work |
101
+
102
+ ## permissions
103
+
104
+ write operations ask before executing. read operations auto-allow.
105
+
106
+ ```
107
+ ◆ Bash wants to: run: git push
108
+ ▸ [y] yes (once)
109
+ [a] yes (always this session)
110
+ [n] no
111
+ ```
112
+
113
+ ## teach it
114
+
115
+ prism learns per model. rules persist across sessions.
116
+
117
+ ```
118
+ /teach never run git push without asking first
119
+ /rules
120
+ /forget 2
121
+ ```
122
+
123
+ rules saved at `~/.prism/models/<model>.json`.
124
+
125
+ ## commands
126
+
127
+ ```
128
+ /model <name> switch model mid-conversation (keeps context)
129
+ /plan enter plan mode (model proposes before executing)
130
+ /exec-plan exit plan mode and execute the plan
131
+ /cancel-plan exit plan mode without executing
132
+ /remember <fact> add a timestamped fact to project memo
133
+ /teach <rule> teach the model a rule
134
+ /rules show learned rules
135
+ /forget <n> remove a rule
136
+ /max-tools <n> limit tools for this model
137
+ /clear clear conversation
138
+ /help show commands
139
+ /exit quit
140
+ ```
141
+
142
+ type `/` in the prompt to see the list with arrow-key navigation; press **tab** to complete the selected command.
143
+
144
+ ## plan mode
145
+
146
+ for ambiguous tasks where the wrong opening move costs time. type `/plan`, ask the model what you want done, read the plan it proposes, push back and revise as needed, then type `/exec-plan` when you're ready for it to execute. type `/cancel-plan` to abandon without executing.
147
+
148
+ ![prism plan mode](https://raw.githubusercontent.com/itsautomata/prism/main/assets/plan_mode.png)
149
+
150
+ ```
151
+ ❯ /plan
152
+ plan mode: on. the model will research and propose a plan.
153
+
154
+ ❯ refactor the auth flow to use JWT instead of sessions
155
+ ◆ here's my plan:
156
+ 1. read src/auth/* to map current session usage
157
+ 2. ...
158
+
159
+ ❯ /exec-plan
160
+ plan mode: off. executing.
161
+ ```
162
+
163
+ while in plan mode, the banner shows an amber `plan mode` indicator. the model is told to research with read-only tools and write a markdown plan, not to call Edit, Write, or destructive Bash. the plan stays in conversation context so the model can execute against it after `/exec-plan`.
164
+
165
+ iteration: typing feedback without `/exec-plan` keeps you in plan mode and lets the model revise.
166
+
167
+ ## memory
168
+
169
+ prism remembers per project across sessions in two layers:
170
+
171
+ - **lens.md** at your project root: rules you enforce. git-committed, ships with the repo so collaborators inherit them.
172
+ - **memo** at `~/.prism/projects/<id>/memo.md`: facts the model and you accumulate as you work. lives outside the repo. add an entry with `/remember <fact>`. each entry is timestamped with the date so the model can spot stale info.
173
+
174
+ example `lens.md`:
175
+
176
+ ```markdown
177
+ use pytest for testing.
178
+ never modify files in data/.
179
+ this project uses pydantic v2.
180
+ ```
181
+
182
+ opt out at startup: `prism --no-scan` (skip live project scan), `prism --no-memory` (skip lens.md + memo). both flags = bare prompt.
183
+
184
+ ## shell escape
185
+
186
+ prefix any input with `!` to run it as a shell command without leaving prism. output stays in your terminal (the model never sees it unless you describe it).
187
+
188
+ ![prism shell escape](https://raw.githubusercontent.com/itsautomata/prism/main/assets/shell.png)
189
+
190
+ the prompt switches to amber `$` when you type `!`, signaling shell mode. press **esc** to exit shell mode.
191
+
192
+ useful for: checking state mid-conversation (git status, file existence, processes) without burning model tokens or polluting context.
193
+
194
+
195
+ ## output tokens
196
+
197
+ default: 10,000 tokens per response. adjust if needed:
198
+
199
+ ```bash
200
+ prism --max-tokens 16000 # more for heavy analysis
201
+ prism --max-tokens 4000 # less for quick tasks
202
+ ```
203
+
204
+
205
+ ## develop locally
206
+
207
+ ```bash
208
+ git clone https://github.com/itsautomata/prism.git
209
+ cd prism
210
+ npm install
211
+ npm run dev # run from source via tsx
212
+ npm run build # produce dist/cli.js (required before global install from this dir)
213
+ npm install -g . # symlink your local build as the global `prism`
214
+ ```
215
+
216
+ `dist/` is git-ignored, so `npm run build` is required before any `npm install -g .` in a fresh clone.
217
+
218
+ ## tests (on going)
219
+
220
+ ```bash
221
+ npm test # run all tests
222
+ npm run test:watch # watch mode
223
+ ```
224
+
225
+ covering:
226
+
227
+ - CLI parsing
228
+ - sessions and `--resume`
229
+ - shell completion
230
+ - slash command autocomplete
231
+ - plan mode dispatch
232
+ - memo persistence (per-project memory)
233
+ - git context detection
234
+ - token counting
235
+ - tools and permissions
236
+ - `!cmd` shell escape
237
+
238
+
239
+ ## note
240
+
241
+ - prism is only as good as the model you point it at. orchestration can only use and optimize what a model already has: better recovery, cleaner context, sharper tool use. but it can't make a model smarter.
242
+ - if one model isn't working for a task, you can switch to a smarter model mid-conversation with `/model`.
243
+
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+
2
+ export { }