@ulpi/cli 0.1.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.
Files changed (92) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +200 -0
  3. package/dist/auth-PN7TMQHV-2W4ICG64.js +15 -0
  4. package/dist/chunk-247GVVKK.js +2259 -0
  5. package/dist/chunk-2CLNOKPA.js +793 -0
  6. package/dist/chunk-2HEE5OKX.js +79 -0
  7. package/dist/chunk-2MZER6ND.js +415 -0
  8. package/dist/chunk-3SBPZRB5.js +772 -0
  9. package/dist/chunk-4VNS5WPM.js +42 -0
  10. package/dist/chunk-6JCMYYBT.js +1546 -0
  11. package/dist/chunk-6OCEY7JY.js +422 -0
  12. package/dist/chunk-74WVVWJ4.js +375 -0
  13. package/dist/chunk-7AL4DOEJ.js +131 -0
  14. package/dist/chunk-7LXY5UVC.js +330 -0
  15. package/dist/chunk-DBMUNBNB.js +3048 -0
  16. package/dist/chunk-JWUUVXIV.js +13694 -0
  17. package/dist/chunk-KIKPIH6N.js +4048 -0
  18. package/dist/chunk-KLEASXUR.js +70 -0
  19. package/dist/chunk-MIAQVCFW.js +39 -0
  20. package/dist/chunk-NNUWU6CV.js +1610 -0
  21. package/dist/chunk-PKD4ASEM.js +115 -0
  22. package/dist/chunk-Q4HIY43N.js +4230 -0
  23. package/dist/chunk-QJ5GSMEC.js +146 -0
  24. package/dist/chunk-SIAQVRKG.js +2163 -0
  25. package/dist/chunk-SPOI23SB.js +197 -0
  26. package/dist/chunk-YM2HV4IA.js +505 -0
  27. package/dist/codemap-RRJIDBQ5.js +636 -0
  28. package/dist/config-EGAXXCGL.js +127 -0
  29. package/dist/dist-6G7JC2RA.js +90 -0
  30. package/dist/dist-7LHZ65GC.js +418 -0
  31. package/dist/dist-LZKZFPVX.js +140 -0
  32. package/dist/dist-R5F4MX3I.js +107 -0
  33. package/dist/dist-R5ZJ4LX5.js +56 -0
  34. package/dist/dist-RJGCUS3L.js +87 -0
  35. package/dist/dist-RKOGLK7R.js +151 -0
  36. package/dist/dist-W7K4WPAF.js +597 -0
  37. package/dist/export-import-4A5MWLIA.js +53 -0
  38. package/dist/history-ATTUKOHO.js +934 -0
  39. package/dist/index.js +2120 -0
  40. package/dist/init-AY5C2ZAS.js +393 -0
  41. package/dist/launchd-LF2QMSKZ.js +148 -0
  42. package/dist/log-TVTUXAYD.js +75 -0
  43. package/dist/mcp-installer-NQCGKQ23.js +124 -0
  44. package/dist/memory-J3G24QHS.js +406 -0
  45. package/dist/ollama-3XCUZMZT-FYKHW4TZ.js +7 -0
  46. package/dist/openai-E7G2YAHU-UYY4ZWON.js +8 -0
  47. package/dist/projects-ATHDD3D6.js +271 -0
  48. package/dist/review-ADUPV3PN.js +152 -0
  49. package/dist/rules-E427DKYJ.js +134 -0
  50. package/dist/server-MOYPE4SM-N7SE2AN7.js +18 -0
  51. package/dist/server-X5P6WH2M-7K2RY34N.js +11 -0
  52. package/dist/skills/ulpi-generate-guardian/SKILL.md +511 -0
  53. package/dist/skills/ulpi-generate-guardian/references/framework-rules.md +692 -0
  54. package/dist/skills/ulpi-generate-guardian/references/language-rules.md +596 -0
  55. package/dist/skills-CX73O3IV.js +76 -0
  56. package/dist/status-4DFHDJMN.js +66 -0
  57. package/dist/templates/biome.yml +24 -0
  58. package/dist/templates/conventional-commits.yml +18 -0
  59. package/dist/templates/django.yml +30 -0
  60. package/dist/templates/docker.yml +30 -0
  61. package/dist/templates/eslint.yml +13 -0
  62. package/dist/templates/express.yml +20 -0
  63. package/dist/templates/fastapi.yml +23 -0
  64. package/dist/templates/git-flow.yml +26 -0
  65. package/dist/templates/github-flow.yml +27 -0
  66. package/dist/templates/go.yml +33 -0
  67. package/dist/templates/jest.yml +24 -0
  68. package/dist/templates/laravel.yml +30 -0
  69. package/dist/templates/monorepo.yml +26 -0
  70. package/dist/templates/nestjs.yml +21 -0
  71. package/dist/templates/nextjs.yml +31 -0
  72. package/dist/templates/nodejs.yml +33 -0
  73. package/dist/templates/npm.yml +15 -0
  74. package/dist/templates/php.yml +25 -0
  75. package/dist/templates/pnpm.yml +15 -0
  76. package/dist/templates/prettier.yml +23 -0
  77. package/dist/templates/prisma.yml +21 -0
  78. package/dist/templates/python.yml +33 -0
  79. package/dist/templates/quality-of-life.yml +111 -0
  80. package/dist/templates/ruby.yml +25 -0
  81. package/dist/templates/rust.yml +34 -0
  82. package/dist/templates/typescript.yml +14 -0
  83. package/dist/templates/vitest.yml +24 -0
  84. package/dist/templates/yarn.yml +15 -0
  85. package/dist/templates-U7T6MARD.js +156 -0
  86. package/dist/ui-L7UAWXDY.js +167 -0
  87. package/dist/ui.html +698 -0
  88. package/dist/ulpi-RMMCUAGP-JCJ273T6.js +161 -0
  89. package/dist/uninstall-6SW35IK4.js +25 -0
  90. package/dist/update-M2B4RLGH.js +61 -0
  91. package/dist/version-checker-ANCS3IHR.js +10 -0
  92. package/package.json +92 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 ULPI
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,200 @@
1
+ # ULPI
2
+
3
+ **Take control of your AI coding agent.**
4
+
5
+ ULPI sits between you and Claude Code, automatically approving safe operations, blocking dangerous ones, and enforcing your project's rules — so you spend less time clicking "Allow" and more time building.
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@ulpi/cli.svg)](https://www.npmjs.com/package/@ulpi/cli)
8
+ [![license](https://img.shields.io/npm/l/@ulpi/cli.svg)](https://opensource.org/licenses/MIT)
9
+ [![node](https://img.shields.io/node/v/@ulpi/cli.svg)](https://nodejs.org)
10
+
11
+ ---
12
+
13
+ ## Why ULPI?
14
+
15
+ Without ULPI, every Claude Code session is a stream of permission prompts. You click "Allow" for `npm test`. Allow for `git status`. Allow for reading a file. Over and over.
16
+
17
+ With ULPI:
18
+
19
+ - `npm test` runs automatically — you defined it as safe
20
+ - `rm -rf /` gets blocked — before Claude can execute it
21
+ - Editing a file requires reading it first — because you set that rule
22
+ - Your session history is preserved — decisions, patterns, and context carry over
23
+
24
+ You write the rules once. ULPI enforces them every session.
25
+
26
+ ---
27
+
28
+ ## Install
29
+
30
+ ```bash
31
+ npm install -g @ulpi/cli
32
+ ```
33
+
34
+ Requires **Node.js 20** or later.
35
+
36
+ ## Get Started
37
+
38
+ ```bash
39
+ cd your-project
40
+ ulpi init
41
+ ```
42
+
43
+ That's it. ULPI detects your stack — language, framework, package manager, test runner, linter — and generates a tailored rules configuration. Hooks are installed into Claude Code automatically.
44
+
45
+ Next time you start a Claude Code session, ULPI is active.
46
+
47
+ ### Try it without installing
48
+
49
+ ```bash
50
+ cd your-project
51
+ npx @ulpi/cli init
52
+ ```
53
+
54
+ ---
55
+
56
+ ## What You Get
57
+
58
+ ### Automatic Permissions
59
+
60
+ Stop clicking "Allow" for every safe command. Define what's safe once, and ULPI handles the rest.
61
+
62
+ ```yaml
63
+ permissions:
64
+ auto-approve-tests:
65
+ trigger: PermissionRequest
66
+ matcher: Bash
67
+ command_pattern: "npm test|pnpm test|yarn test"
68
+ decision: allow
69
+ ```
70
+
71
+ ### Guardrails
72
+
73
+ Block destructive operations before they execute. ULPI ships with built-in protection against `rm -rf`, `git push --force`, `DROP TABLE`, and more — plus you can add your own.
74
+
75
+ ### Preconditions
76
+
77
+ Enforce good practices automatically. Require files to be read before editing. Require tests to pass before committing. Require linting before pushing.
78
+
79
+ ```yaml
80
+ preconditions:
81
+ read-before-edit:
82
+ trigger: PreToolUse
83
+ matcher: "Write|Edit"
84
+ message: "Read the file before editing it."
85
+ requires_read: true
86
+ ```
87
+
88
+ ### Session Tracking
89
+
90
+ ULPI knows what happened in your session — which files were read, which were written, which commands ran. Rules can use this context to make smarter decisions.
91
+
92
+ ### Web Dashboard
93
+
94
+ A full web UI for managing rules, viewing live sessions, reviewing AI-generated plans, and browsing session history.
95
+
96
+ ```bash
97
+ ulpi ui
98
+ ```
99
+
100
+ <!-- TODO: Add screenshot -->
101
+
102
+ ### Plan & Code Review
103
+
104
+ Review AI-generated plans and code changes in a dedicated UI before they execute. Annotate, approve, or reject with feedback that gets sent back to the agent.
105
+
106
+ ### Semantic Code Search
107
+
108
+ ULPI indexes your codebase and exposes it as MCP tools that Claude Code can use for smarter, context-aware search — beyond simple grep.
109
+
110
+ ### Agent Memory
111
+
112
+ Captures decisions, patterns, and lessons learned across sessions. Your AI agent builds institutional knowledge over time instead of starting fresh every conversation.
113
+
114
+ ---
115
+
116
+ ## Configuration
117
+
118
+ Rules live in `.ulpi/guards.yml` at your project root:
119
+
120
+ ```yaml
121
+ project:
122
+ name: my-app
123
+ runtime: node
124
+ package_manager: pnpm
125
+ test_command: pnpm test
126
+
127
+ preconditions:
128
+ read-before-edit:
129
+ trigger: PreToolUse
130
+ matcher: "Write|Edit"
131
+ message: "Read the file before editing it."
132
+ requires_read: true
133
+
134
+ permissions:
135
+ auto-approve-tests:
136
+ trigger: PermissionRequest
137
+ matcher: Bash
138
+ command_pattern: "pnpm test"
139
+ decision: allow
140
+
141
+ auto-approve-git-read:
142
+ trigger: PermissionRequest
143
+ matcher: Bash
144
+ command_pattern: "git (status|log|diff|branch)"
145
+ decision: allow
146
+ ```
147
+
148
+ ULPI ships with **28 built-in templates** for popular stacks — Node.js, Python, Go, Rust, Next.js, Laravel, Django, FastAPI, and more.
149
+
150
+ ```bash
151
+ ulpi templates list
152
+ ```
153
+
154
+ ---
155
+
156
+ ## Commands
157
+
158
+ | Command | Description |
159
+ |---------|-------------|
160
+ | `ulpi init` | Detect your stack and install hooks |
161
+ | `ulpi rules` | Manage rules (list, add, enable, disable, validate) |
162
+ | `ulpi templates` | Browse and apply rule templates |
163
+ | `ulpi skills` | Manage injectable skills |
164
+ | `ulpi status` | Show current session state |
165
+ | `ulpi log` | View activity log |
166
+ | `ulpi ui` | Launch web dashboard |
167
+ | `ulpi projects` | Manage multiple projects |
168
+ | `ulpi history` | Browse session history |
169
+ | `ulpi review` | Plan and code review management |
170
+ | `ulpi codemap` | Semantic code search and indexing |
171
+ | `ulpi memory` | Agent memory management |
172
+ | `ulpi config` | View and update settings |
173
+ | `ulpi update` | Check for and install updates |
174
+ | `ulpi export` | Export your rules configuration |
175
+ | `ulpi import` | Import a rules configuration |
176
+ | `ulpi uninstall` | Remove ULPI hooks from project |
177
+
178
+ ---
179
+
180
+ ## How It Works
181
+
182
+ ULPI uses [Claude Code hooks](https://docs.anthropic.com/en/docs/claude-code/hooks) — lifecycle events that fire before and after every tool execution:
183
+
184
+ 1. **Before a tool runs**, ULPI checks your rules. Should this file edit be allowed? Has the file been read first? Is this command safe?
185
+ 2. **When a permission is requested**, ULPI decides automatically based on your rules — allow, deny, or ask the user.
186
+ 3. **After a tool runs**, ULPI updates session state and runs any postconditions you've defined.
187
+ 4. **At session boundaries**, ULPI captures history, classifies memories, and indexes code changes.
188
+
189
+ If ULPI ever encounters an error, it fails open — Claude Code continues normally. Your agent is never blocked by a bug in ULPI.
190
+
191
+ ---
192
+
193
+ ## Requirements
194
+
195
+ - **Node.js** >= 20
196
+ - **Claude Code** with [hooks support](https://docs.anthropic.com/en/docs/claude-code/hooks)
197
+
198
+ ## License
199
+
200
+ MIT
@@ -0,0 +1,15 @@
1
+ import {
2
+ generateApiSecret,
3
+ getApiSecret,
4
+ setApiSecret,
5
+ validateAuth,
6
+ validateLoopback
7
+ } from "./chunk-MIAQVCFW.js";
8
+ import "./chunk-4VNS5WPM.js";
9
+ export {
10
+ generateApiSecret,
11
+ getApiSecret,
12
+ setApiSecret,
13
+ validateAuth,
14
+ validateLoopback
15
+ };