@itsautomata/prism 0.1.1 → 0.2.0
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/README.md +71 -24
- package/dist/cli.js +1210 -300
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# prism
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**model agnostic, local-first AI coding assistant**
|
|
4
4
|
|
|
5
5
|
Prism is an open source coding assistant that runs locally on your machine through Ollama, or cloud through OpenRouter (300+ models).
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
> actively built and tested. expect breaking changes. decentralized intelligence is cool
|
|
8
|
+
> actively built and tested. expect breaking changes. decentralized intelligence is cool.
|
|
9
9
|
|
|
10
10
|

|
|
11
11
|
|
|
@@ -50,14 +50,14 @@ prism --install-completion bash # explicit
|
|
|
50
50
|
|
|
51
51
|
## choose your model
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
**local (free, ollama)**
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
56
|
prism # deepseek-r1:14b (default)
|
|
57
57
|
prism qwen3:14b
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
**cloud (openrouter, 300+ models)**
|
|
61
61
|
|
|
62
62
|
add your API key to `~/.prism/config.toml` (created on first run), then:
|
|
63
63
|
|
|
@@ -97,11 +97,14 @@ sessions saved at `~/.prism/sessions/`.
|
|
|
97
97
|
| Write | create or overwrite files |
|
|
98
98
|
| Glob | find files by pattern |
|
|
99
99
|
| Grep | search file contents |
|
|
100
|
-
| Agent | spawn subagents for parallel
|
|
100
|
+
| Agent | spawn read-only subagents for parallel research |
|
|
101
|
+
| useSkill | invoke a named workflow from skills/<name>.md |
|
|
102
|
+
| WebFetch | fetch and convert web pages to markdown |
|
|
103
|
+
| WebSearch | query a search backend, return ranked results |
|
|
101
104
|
|
|
102
105
|
## permissions
|
|
103
106
|
|
|
104
|
-
write operations ask before executing. read operations auto-allow.
|
|
107
|
+
write operations ask before executing. read operations auto-allow. by default, subagents are read-only. user-defined agents can declare `permissions: inherit` to write through the parent's permission prompt.
|
|
105
108
|
|
|
106
109
|
```
|
|
107
110
|
◆ Bash wants to: run: git push
|
|
@@ -110,6 +113,50 @@ write operations ask before executing. read operations auto-allow.
|
|
|
110
113
|
[n] no
|
|
111
114
|
```
|
|
112
115
|
|
|
116
|
+
## agents
|
|
117
|
+
|
|
118
|
+
prism ships with a built-in read-only research subagent. define your own at `./agents/<name>.md` (project) or `~/.prism/agents/<name>.md` (user), with YAML frontmatter:
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
---
|
|
122
|
+
description: refactorer focused on extracting React hooks
|
|
123
|
+
tools: ['Read', 'Edit', 'Grep']
|
|
124
|
+
permissions: inherit
|
|
125
|
+
max_turns: 8
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
you are a refactoring specialist. read the file first, propose the
|
|
129
|
+
extraction, then apply it. do not touch tests.
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`permissions: deny-writes` (default) blocks writes. `permissions: inherit` lets the subagent write through the parent's permission prompt. list with `/agent`, invoke directly with `/agent <name> <task>`, or have the model call `Agent` with `agent: "<name>"`. deny-writes agents spawned in the same turn run in parallel.
|
|
133
|
+
|
|
134
|
+
## skills
|
|
135
|
+
|
|
136
|
+
reusable workflows the model follows on demand. drop a markdown file at `./skills/<name>.md` or `~/.prism/skills/<name>.md`:
|
|
137
|
+
|
|
138
|
+
```markdown
|
|
139
|
+
---
|
|
140
|
+
mode: invoke
|
|
141
|
+
require-permission: true
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
scan the staged diff for security issues. report findings as a table
|
|
145
|
+
with file:line and severity.
|
|
146
|
+
|
|
147
|
+
## quick
|
|
148
|
+
do a fast pass only.
|
|
149
|
+
|
|
150
|
+
## thorough
|
|
151
|
+
trace data flow from input boundaries.
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
- `mode: invoke` (default): one-shot. trigger with `/run <name> [section] [task]` or let the model call `useSkill`.
|
|
155
|
+
- `mode: passive`: ambient. toggle with `/skill <name>`, the body lands in the system prompt every turn until toggled off.
|
|
156
|
+
- `require-permission: true`: prompts before the model can invoke it.
|
|
157
|
+
|
|
158
|
+
`##` headings become section targets, so `/run review thorough` run just that block. `/skill` lists all skills (passive in cyan, invoke in green).
|
|
159
|
+
|
|
113
160
|
## teach it
|
|
114
161
|
|
|
115
162
|
prism learns per model. rules persist across sessions.
|
|
@@ -129,6 +176,9 @@ rules saved at `~/.prism/models/<model>.json`.
|
|
|
129
176
|
/plan enter plan mode (model proposes before executing)
|
|
130
177
|
/exec-plan exit plan mode and execute the plan
|
|
131
178
|
/cancel-plan exit plan mode without executing
|
|
179
|
+
/agent [name] list agents, show one, or invoke a named subagent
|
|
180
|
+
/skill [name] list skills or toggle a passive skill on/off
|
|
181
|
+
/run <name> invoke a skill one-shot (optional section, task)
|
|
132
182
|
/remember <fact> add a timestamped fact to project memo
|
|
133
183
|
/teach <rule> teach the model a rule
|
|
134
184
|
/rules show learned rules
|
|
@@ -147,18 +197,6 @@ for ambiguous tasks where the wrong opening move costs time. type `/plan`, ask t
|
|
|
147
197
|
|
|
148
198
|

|
|
149
199
|
|
|
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
200
|
|
|
163
201
|
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
202
|
|
|
@@ -168,7 +206,7 @@ iteration: typing feedback without `/exec-plan` keeps you in plan mode and lets
|
|
|
168
206
|
|
|
169
207
|
prism remembers per project across sessions in two layers:
|
|
170
208
|
|
|
171
|
-
- **lens
|
|
209
|
+
- **lens** at `./lens.md` or any `.prism/*.md` file (multiple files supported): rules you enforce, extra context...
|
|
172
210
|
- **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
211
|
|
|
174
212
|
example `lens.md`:
|
|
@@ -209,11 +247,14 @@ git clone https://github.com/itsautomata/prism.git
|
|
|
209
247
|
cd prism
|
|
210
248
|
npm install
|
|
211
249
|
npm run dev # run from source via tsx
|
|
212
|
-
npm run build # produce dist/cli.js (required before global install from
|
|
250
|
+
npm run build # produce dist/cli.js (required before global install from the local dir)
|
|
213
251
|
npm install -g . # symlink your local build as the global `prism`
|
|
214
252
|
```
|
|
215
253
|
|
|
216
|
-
|
|
254
|
+
you can run prism on itself to make itself better, and shape it to your workflow
|
|
255
|
+
|
|
256
|
+

|
|
257
|
+
|
|
217
258
|
|
|
218
259
|
## tests (on going)
|
|
219
260
|
|
|
@@ -227,12 +268,18 @@ covering:
|
|
|
227
268
|
- CLI parsing
|
|
228
269
|
- sessions and `--resume`
|
|
229
270
|
- shell completion
|
|
230
|
-
- slash command autocomplete
|
|
271
|
+
- slash command autocomplete and prompt input
|
|
231
272
|
- plan mode dispatch
|
|
232
273
|
- memo persistence (per-project memory)
|
|
233
274
|
- git context detection
|
|
234
|
-
- token counting
|
|
235
|
-
-
|
|
275
|
+
- context compaction (token counting + summary fallback)
|
|
276
|
+
- subagent registry, runner, and parallel-safety
|
|
277
|
+
- skill loader (frontmatter, sections, name sanitization)
|
|
278
|
+
- lens loader (`.prism` directory)
|
|
279
|
+
- command-injection guards (grep, glob)
|
|
280
|
+
- permission prompt mount and key handling
|
|
281
|
+
- tools, permissions, subagent permission contract
|
|
282
|
+
- web fetching
|
|
236
283
|
- `!cmd` shell escape
|
|
237
284
|
|
|
238
285
|
|