@quickback-dev/cli 0.47.12 → 0.47.13
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/dist/docs/content.js +4 -4
- package/dist/docs/content.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/action-harvest.d.ts.map +1 -1
- package/dist/lib/action-harvest.js +110 -46
- package/dist/lib/action-harvest.js.map +1 -1
- package/dist/lib/action-harvest.test.js +97 -0
- package/dist/lib/action-harvest.test.js.map +1 -1
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +18 -1
- package/dist/lib/api-client.js.map +1 -1
- package/dist/skill/docs/changelog.md +51 -0
- package/dist/skill/docs/compiler/config/agents.md +1 -1
- package/dist/skill/docs/compiler/definitions/scopes.md +140 -2
- package/dist/skill/docs/stack/schedules/index.md +17 -0
- package/package.json +1 -1
- package/src/skill/docs/changelog.md +51 -0
- package/src/skill/docs/compiler/config/agents.md +1 -1
- package/src/skill/docs/compiler/definitions/scopes.md +140 -2
- package/src/skill/docs/stack/schedules/index.md +17 -0
- package/dist/codex/AGENTS.md +0 -290
- package/dist/commands/codex.d.ts +0 -16
- package/dist/commands/codex.d.ts.map +0 -1
- package/dist/commands/codex.js +0 -159
- package/dist/commands/codex.js.map +0 -1
- package/dist/commands/init.d.ts +0 -6
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -405
- package/dist/commands/init.js.map +0 -1
- package/dist/lib/sweep-stale.d.ts +0 -25
- package/dist/lib/sweep-stale.d.ts.map +0 -1
- package/dist/lib/sweep-stale.js +0 -179
- package/dist/lib/sweep-stale.js.map +0 -1
- package/dist/lib/sweep-stale.test.d.ts +0 -2
- package/dist/lib/sweep-stale.test.d.ts.map +0 -1
- package/dist/lib/sweep-stale.test.js +0 -130
- package/dist/lib/sweep-stale.test.js.map +0 -1
package/dist/codex/AGENTS.md
DELETED
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
# Quickback
|
|
2
|
-
|
|
3
|
-
Quickback is two things:
|
|
4
|
-
|
|
5
|
-
1. **Compiler** — Transforms declarative TypeScript definitions into secure, production-ready APIs
|
|
6
|
-
2. **Stack** — A Supabase alternative running entirely on Cloudflare (D1, R2, KV, Durable Objects, Queues, Workers AI)
|
|
7
|
-
|
|
8
|
-
The output is standard TypeScript (Hono, Drizzle, Better Auth) running on your own infrastructure.
|
|
9
|
-
|
|
10
|
-
## Project Structure
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
my-app/
|
|
14
|
-
├── quickback/
|
|
15
|
-
│ ├── quickback.config.ts
|
|
16
|
-
│ └── features/
|
|
17
|
-
│ └── {feature-name}/
|
|
18
|
-
│ ├── {table}.ts # Schema + security (defineTable)
|
|
19
|
-
│ ├── actions/ # One file per action — defineAction({...}) (optional)
|
|
20
|
-
│ │ ├── {action}.ts # Binds to primary table (or standalone if path: is set)
|
|
21
|
-
│ │ └── {table}/{action}.ts # Binds to sibling <table>.ts (multi-table features)
|
|
22
|
-
│ └── lib/ # Feature-local helpers, copied verbatim (optional)
|
|
23
|
-
└── ...
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## quickback.config.ts
|
|
27
|
-
|
|
28
|
-
```typescript
|
|
29
|
-
import { defineConfig, defineRuntime, defineDatabase, defineAuth } from '@quickback/compiler';
|
|
30
|
-
|
|
31
|
-
export default defineConfig({
|
|
32
|
-
name: "my-saas-app",
|
|
33
|
-
providers: {
|
|
34
|
-
runtime: defineRuntime("cloudflare"),
|
|
35
|
-
database: defineDatabase("cloudflare-d1"),
|
|
36
|
-
auth: defineAuth("better-auth"),
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Automatic Audit Fields
|
|
42
|
-
|
|
43
|
-
Quickback auto-injects: `createdAt`, `modifiedAt`, `deletedAt`, `createdBy`, `modifiedBy`, `deletedBy`. Do NOT define these in schemas.
|
|
44
|
-
|
|
45
|
-
## defineTable() — Schema + Security
|
|
46
|
-
|
|
47
|
-
Each feature file exports a Drizzle table and a `defineTable()` default export with security config:
|
|
48
|
-
|
|
49
|
-
```typescript
|
|
50
|
-
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
|
|
51
|
-
import { defineTable } from "@quickback/compiler";
|
|
52
|
-
|
|
53
|
-
export const todos = sqliteTable("todos", {
|
|
54
|
-
id: integer("id").primaryKey(),
|
|
55
|
-
title: text("title").notNull(),
|
|
56
|
-
description: text("description"),
|
|
57
|
-
completed: integer("completed", { mode: "boolean" }).default(false),
|
|
58
|
-
userId: text("user_id").notNull(),
|
|
59
|
-
organizationId: text("organization_id").notNull(),
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
export default defineTable(todos, {
|
|
63
|
-
firewall: [
|
|
64
|
-
{ field: "organizationId", equals: "ctx.activeOrgId" },
|
|
65
|
-
{ field: "userId", equals: "ctx.userId" },
|
|
66
|
-
{ field: "deletedAt", isNull: true },
|
|
67
|
-
],
|
|
68
|
-
read: { access: { roles: ["member", "admin"] } },
|
|
69
|
-
create: { access: { roles: ["member", "admin"] } },
|
|
70
|
-
update: { access: { roles: ["admin"] } },
|
|
71
|
-
delete: { access: { roles: ["admin"] }, mode: "soft" },
|
|
72
|
-
guards: {
|
|
73
|
-
createable: ["title", "description", "completed"],
|
|
74
|
-
updatable: ["title", "description", "completed"],
|
|
75
|
-
},
|
|
76
|
-
masking: {
|
|
77
|
-
userId: { type: "redact", show: { roles: ["admin"] } },
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Four Security Layers
|
|
83
|
-
|
|
84
|
-
Every request passes through: `Request → Firewall → Access → Guards → Database → Masking → Response`
|
|
85
|
-
|
|
86
|
-
### 1. Firewall — Data Isolation
|
|
87
|
-
|
|
88
|
-
Auto WHERE clauses for tenant isolation. Predicates are AND'd:
|
|
89
|
-
|
|
90
|
-
```typescript
|
|
91
|
-
firewall: [
|
|
92
|
-
{ field: 'organizationId', equals: 'ctx.activeOrgId' }, // WHERE organizationId = ctx.activeOrgId
|
|
93
|
-
{ field: 'ownerId', equals: 'ctx.userId' }, // AND ownerId = ctx.userId
|
|
94
|
-
{ field: 'teamId', equals: 'ctx.activeTeamId' }, // AND teamId = ctx.activeTeamId
|
|
95
|
-
{ field: 'deletedAt', isNull: true }, // AND deletedAt IS NULL
|
|
96
|
-
]
|
|
97
|
-
|
|
98
|
-
// Public/system resources opt out of tenant scoping (soft-delete still applied):
|
|
99
|
-
firewall: [{ exception: true }]
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Auto-derived when omitted: scans the schema for `organizationId` / `ownerId` / `teamId` and emits matching predicates. Two or more isolation columns → declare explicitly.
|
|
103
|
-
|
|
104
|
-
### 2. Access — Permission Checks
|
|
105
|
-
|
|
106
|
-
Role-based and record-based (deny by default). Reads (`GET /` and `GET /:id`) gate via `read.access`; mutations gate via `create.access`, `update.access`, `delete.access`, and `upsert.access`.
|
|
107
|
-
|
|
108
|
-
```typescript
|
|
109
|
-
read: { access: { roles: ['member'] } }, // gates GET / and GET /:id
|
|
110
|
-
create: { access: { roles: ['admin'] } },
|
|
111
|
-
update: {
|
|
112
|
-
access: {
|
|
113
|
-
or: [
|
|
114
|
-
{ roles: ['admin'] },
|
|
115
|
-
{ record: { createdBy: { equals: '$ctx.userId' } } },
|
|
116
|
-
],
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
delete: { access: { roles: ['admin'] } },
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
> **DSL v2:** `crud.list` and `crud.get` are rejected at compile time. Move them to `read.access`.
|
|
123
|
-
|
|
124
|
-
Operators: `equals`, `notEquals`, `in`, `notIn`, `greaterThan`, `lessThan`
|
|
125
|
-
Context: `$ctx.userId`, `$ctx.activeOrgId`, `$ctx.roles`
|
|
126
|
-
|
|
127
|
-
### 3. Guards — Field Protection
|
|
128
|
-
|
|
129
|
-
```typescript
|
|
130
|
-
guards: {
|
|
131
|
-
createable: ['name', 'description'],
|
|
132
|
-
updatable: ['description'],
|
|
133
|
-
immutable: ['invoiceNumber'],
|
|
134
|
-
protected: { status: ['approve'] }, // Only via named actions
|
|
135
|
-
}
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### 4. Masking — PII Redaction
|
|
139
|
-
|
|
140
|
-
```typescript
|
|
141
|
-
masking: {
|
|
142
|
-
ssn: { type: 'ssn', show: { roles: ['admin'] } },
|
|
143
|
-
email: { type: 'email', show: { roles: ['admin'], or: 'owner' } },
|
|
144
|
-
}
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Types: `email`, `phone`, `ssn`, `creditCard`, `name`, `redact`, `custom`
|
|
148
|
-
|
|
149
|
-
## Views — Column Projections
|
|
150
|
-
|
|
151
|
-
```typescript
|
|
152
|
-
views: {
|
|
153
|
-
summary: { fields: ['id', 'name'], access: { roles: ['member'] } },
|
|
154
|
-
full: { fields: ['id', 'name', 'phone', 'ssn'], access: { roles: ['admin'] } },
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
## Validation
|
|
159
|
-
|
|
160
|
-
```typescript
|
|
161
|
-
validation: {
|
|
162
|
-
name: { minLength: 1, maxLength: 100 },
|
|
163
|
-
capacity: { min: 1, max: 1000 },
|
|
164
|
-
roomType: { enum: ['meeting', 'conference'] },
|
|
165
|
-
email: { email: true },
|
|
166
|
-
}
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
## Actions — Custom Business Logic
|
|
170
|
-
|
|
171
|
-
One file per action under `actions/<name>.ts`. The filename is the action name AND URL segment. `actions/<name>.ts` binds to the feature's primary table; `actions/<table>/<name>.ts` binds to a sibling table. Setting `path:` makes the action standalone.
|
|
172
|
-
|
|
173
|
-
```typescript
|
|
174
|
-
// features/todos/actions/complete.ts
|
|
175
|
-
import { z } from "zod";
|
|
176
|
-
import { eq } from "drizzle-orm";
|
|
177
|
-
import { defineAction } from "../.quickback/define-action";
|
|
178
|
-
import { todos } from "../todos";
|
|
179
|
-
|
|
180
|
-
export default defineAction({
|
|
181
|
-
description: "Mark todo as complete",
|
|
182
|
-
input: z.object({ completedAt: z.string().datetime().optional() }),
|
|
183
|
-
access: { roles: ["member", "admin"], record: { completed: { equals: false } } },
|
|
184
|
-
async execute({ db, record, auditFields }) {
|
|
185
|
-
await db.update(todos)
|
|
186
|
-
.set({ completed: true, modifiedAt: auditFields!.modifiedAt })
|
|
187
|
-
.where(eq(todos.id, record.id));
|
|
188
|
-
return { success: true };
|
|
189
|
-
},
|
|
190
|
-
});
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
Record-based (no `path:`): `POST /api/v1/{resource}/:id/{action}`
|
|
194
|
-
Standalone (`path:` set): custom `path` and `method`
|
|
195
|
-
|
|
196
|
-
`execute:` must be an `async (ctx) => { … }` arrow function. Retired (rejected at load time): bundled `actions.ts`, `_feature.ts`, `handlers/` directory, `defineActions()`.
|
|
197
|
-
|
|
198
|
-
### Actions-Only Features (no tables)
|
|
199
|
-
|
|
200
|
-
A feature with no top-level `*.ts` files is "tableless" — every action must be standalone (have `path:`).
|
|
201
|
-
|
|
202
|
-
```typescript
|
|
203
|
-
// quickback/features/utilities/actions/health-check.ts
|
|
204
|
-
import { z } from "zod";
|
|
205
|
-
import { defineAction } from "../.quickback/define-action";
|
|
206
|
-
|
|
207
|
-
export default defineAction({
|
|
208
|
-
description: "Health check",
|
|
209
|
-
path: "/health",
|
|
210
|
-
method: "GET",
|
|
211
|
-
input: z.object({}),
|
|
212
|
-
access: { roles: ["member", "admin"] },
|
|
213
|
-
async execute() { return { ok: true }; },
|
|
214
|
-
});
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
### Public Actions
|
|
218
|
-
|
|
219
|
-
Use `roles: ["PUBLIC"]` for unauthenticated endpoints. Mandatory audit logged. The wildcard `"*"` is not supported.
|
|
220
|
-
|
|
221
|
-
```typescript
|
|
222
|
-
access: { roles: ["PUBLIC"] } // No auth, audit logged
|
|
223
|
-
access: { roles: ["member"] } // Requires auth + role
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
## Custom Dependencies
|
|
227
|
-
|
|
228
|
-
```typescript
|
|
229
|
-
export default defineConfig({
|
|
230
|
-
build: {
|
|
231
|
-
dependencies: {
|
|
232
|
-
"fast-xml-parser": "^4.5.0",
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
});
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
## CMS Layouts
|
|
239
|
-
|
|
240
|
-
```typescript
|
|
241
|
-
layouts: {
|
|
242
|
-
default: {
|
|
243
|
-
sections: [
|
|
244
|
-
{ label: "Details", columns: 2, fields: ["name", "email"] },
|
|
245
|
-
{ label: "Notes", collapsed: true, fields: ["notes"] },
|
|
246
|
-
],
|
|
247
|
-
},
|
|
248
|
-
}
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
## API Reference
|
|
252
|
-
|
|
253
|
-
| Method | Endpoint | Description |
|
|
254
|
-
|--------|----------|-------------|
|
|
255
|
-
| `GET` | `/api/v1/{resource}` | List |
|
|
256
|
-
| `GET` | `/api/v1/{resource}/:id` | Get |
|
|
257
|
-
| `POST` | `/api/v1/{resource}` | Create |
|
|
258
|
-
| `PATCH` | `/api/v1/{resource}/:id` | Update |
|
|
259
|
-
| `DELETE` | `/api/v1/{resource}/:id` | Delete |
|
|
260
|
-
|
|
261
|
-
Query params: `?limit=50&offset=0`, `?status=active`, `?sort=-createdAt`, `?fields=id,name`, `?search=text`
|
|
262
|
-
Filter operators: `.gt`, `.gte`, `.lt`, `.lte`, `.ne`, `.like`, `.in`
|
|
263
|
-
|
|
264
|
-
## Database Dialects
|
|
265
|
-
|
|
266
|
-
| Stack | Import | Table Function |
|
|
267
|
-
|-------|--------|----------------|
|
|
268
|
-
| Cloudflare D1 / SQLite | `drizzle-orm/sqlite-core` | `sqliteTable` |
|
|
269
|
-
| Supabase / PostgreSQL | `drizzle-orm/pg-core` | `pgTable` |
|
|
270
|
-
|
|
271
|
-
## Migrations are generated — never hand-merge them
|
|
272
|
-
|
|
273
|
-
The files under `quickback/drizzle/` (`*.sql`, `meta/_journal.json`, `meta/*_snapshot.json`) are **generated artifacts**, not source. Never hand-edit them, and never resolve a merge or rebase conflict inside them.
|
|
274
|
-
|
|
275
|
-
When integrating a branch: get the feature/schema `.ts` files in first, then run `quickback compile`. The compiler regenerates the migrations from the merged schema and journals them in the correct (append-only) order. Hand-merging migration SQL or snapshots produces schema drift and broken ordering that only surfaces at deploy time. If a migration file conflicts during a merge, take either side to unblock, then recompile and let the compiler restate the migrations.
|
|
276
|
-
|
|
277
|
-
## CLI Commands
|
|
278
|
-
|
|
279
|
-
```bash
|
|
280
|
-
quickback create <template> <name> # Create project
|
|
281
|
-
quickback compile # Compile definitions
|
|
282
|
-
quickback docs [topic] # Show documentation
|
|
283
|
-
quickback claude install # Install Claude Code skill
|
|
284
|
-
quickback cursor install # Install Cursor rules
|
|
285
|
-
quickback codex install # Install Codex AGENTS.md rules
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
## Full Documentation
|
|
289
|
-
|
|
290
|
-
https://docs.quickback.dev
|
package/dist/commands/codex.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex command - manage ChatGPT Codex AGENTS.md rules.
|
|
3
|
-
*
|
|
4
|
-
* Codex reads `AGENTS.md` from the project root (merging up the tree), so unlike
|
|
5
|
-
* Cursor's dedicated .mdc file the rules live in a file the user may also own.
|
|
6
|
-
* We therefore manage only a delimited block, leaving the rest of AGENTS.md
|
|
7
|
-
* untouched.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* quickback codex install # Add/update the Quickback block in ./AGENTS.md
|
|
11
|
-
* quickback codex update # Alias for install (refresh the block)
|
|
12
|
-
* quickback codex remove # Strip the Quickback block
|
|
13
|
-
* quickback codex status # Check installation status
|
|
14
|
-
*/
|
|
15
|
-
export declare function codex(args: string[]): Promise<void>;
|
|
16
|
-
//# sourceMappingURL=codex.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/commands/codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAwIH,wBAAsB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBzD"}
|
package/dist/commands/codex.js
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex command - manage ChatGPT Codex AGENTS.md rules.
|
|
3
|
-
*
|
|
4
|
-
* Codex reads `AGENTS.md` from the project root (merging up the tree), so unlike
|
|
5
|
-
* Cursor's dedicated .mdc file the rules live in a file the user may also own.
|
|
6
|
-
* We therefore manage only a delimited block, leaving the rest of AGENTS.md
|
|
7
|
-
* untouched.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* quickback codex install # Add/update the Quickback block in ./AGENTS.md
|
|
11
|
-
* quickback codex update # Alias for install (refresh the block)
|
|
12
|
-
* quickback codex remove # Strip the Quickback block
|
|
13
|
-
* quickback codex status # Check installation status
|
|
14
|
-
*/
|
|
15
|
-
import { readFileSync, writeFileSync, existsSync } from "fs";
|
|
16
|
-
import { join, dirname } from "path";
|
|
17
|
-
import { fileURLToPath } from "url";
|
|
18
|
-
import pc from "picocolors";
|
|
19
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
20
|
-
const __dirname = dirname(__filename);
|
|
21
|
-
const CODEX_BUNDLE = join(__dirname, "..", "codex");
|
|
22
|
-
const AGENTS_FILE = join(process.cwd(), "AGENTS.md");
|
|
23
|
-
const BEGIN = "<!-- BEGIN QUICKBACK RULES (managed by `quickback codex`) -->";
|
|
24
|
-
const END = "<!-- END QUICKBACK RULES -->";
|
|
25
|
-
function bundledRules() {
|
|
26
|
-
const file = join(CODEX_BUNDLE, "AGENTS.md");
|
|
27
|
-
if (!existsSync(file)) {
|
|
28
|
-
console.log(pc.red("\nCodex rules not found in CLI bundle."));
|
|
29
|
-
console.log(pc.dim("This may indicate an incomplete CLI installation."));
|
|
30
|
-
console.log(pc.dim("Try reinstalling: npm install -g @quickback-dev/cli\n"));
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
return readFileSync(file, "utf-8").trim();
|
|
34
|
-
}
|
|
35
|
-
function escapeRegExp(s) {
|
|
36
|
-
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
37
|
-
}
|
|
38
|
-
/** Returns the AGENTS.md content with the Quickback block removed (trimmed). */
|
|
39
|
-
function stripBlock(content) {
|
|
40
|
-
const re = new RegExp(`\\n*${escapeRegExp(BEGIN)}[\\s\\S]*?${escapeRegExp(END)}\\n*`, "g");
|
|
41
|
-
return content.replace(re, "\n").trim();
|
|
42
|
-
}
|
|
43
|
-
function hasBlock(content) {
|
|
44
|
-
return content.includes(BEGIN) && content.includes(END);
|
|
45
|
-
}
|
|
46
|
-
function installRules() {
|
|
47
|
-
const rules = bundledRules();
|
|
48
|
-
if (rules === null)
|
|
49
|
-
process.exit(1);
|
|
50
|
-
const block = `${BEGIN}\n${rules}\n${END}`;
|
|
51
|
-
let next;
|
|
52
|
-
if (existsSync(AGENTS_FILE)) {
|
|
53
|
-
const current = readFileSync(AGENTS_FILE, "utf-8");
|
|
54
|
-
if (hasBlock(current)) {
|
|
55
|
-
// Replace the existing managed block in place.
|
|
56
|
-
const re = new RegExp(`${escapeRegExp(BEGIN)}[\\s\\S]*?${escapeRegExp(END)}`);
|
|
57
|
-
next = current.replace(re, block).trimEnd() + "\n";
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
// Preserve the user's AGENTS.md; append our block.
|
|
61
|
-
next = current.trimEnd() + `\n\n${block}\n`;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
next = `${block}\n`;
|
|
66
|
-
}
|
|
67
|
-
writeFileSync(AGENTS_FILE, next);
|
|
68
|
-
console.log(pc.green(` ✓ Quickback rules block → ${AGENTS_FILE}`));
|
|
69
|
-
console.log("");
|
|
70
|
-
console.log(pc.green("✓ Quickback rules installed for Codex (AGENTS.md)"));
|
|
71
|
-
console.log(pc.dim("Consider committing AGENTS.md to your repository.\n"));
|
|
72
|
-
}
|
|
73
|
-
async function install() {
|
|
74
|
-
console.log("");
|
|
75
|
-
console.log(pc.bold("Installing Quickback rules for Codex"));
|
|
76
|
-
console.log("");
|
|
77
|
-
installRules();
|
|
78
|
-
}
|
|
79
|
-
async function remove() {
|
|
80
|
-
if (!existsSync(AGENTS_FILE) || !hasBlock(readFileSync(AGENTS_FILE, "utf-8"))) {
|
|
81
|
-
console.log(pc.yellow("\nNo Quickback block found in AGENTS.md.\n"));
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
console.log("");
|
|
85
|
-
console.log(pc.bold("Remove Quickback Codex rules"));
|
|
86
|
-
console.log("");
|
|
87
|
-
const stripped = stripBlock(readFileSync(AGENTS_FILE, "utf-8"));
|
|
88
|
-
if (stripped === "") {
|
|
89
|
-
// The file held only our block — remove it entirely.
|
|
90
|
-
const { rmSync } = await import("fs");
|
|
91
|
-
rmSync(AGENTS_FILE, { force: true });
|
|
92
|
-
console.log(pc.yellow(` ✓ Removed ${AGENTS_FILE}`));
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
writeFileSync(AGENTS_FILE, stripped + "\n");
|
|
96
|
-
console.log(pc.yellow(` ✓ Stripped Quickback block from ${AGENTS_FILE}`));
|
|
97
|
-
}
|
|
98
|
-
console.log("");
|
|
99
|
-
console.log(pc.green("✓ Quickback Codex rules removed.\n"));
|
|
100
|
-
}
|
|
101
|
-
async function status() {
|
|
102
|
-
console.log("");
|
|
103
|
-
console.log(pc.bold("Quickback Codex Rules (AGENTS.md)"));
|
|
104
|
-
console.log("");
|
|
105
|
-
const installed = existsSync(AGENTS_FILE) && hasBlock(readFileSync(AGENTS_FILE, "utf-8"));
|
|
106
|
-
if (installed) {
|
|
107
|
-
console.log(` ${pc.green("●")} Installed`);
|
|
108
|
-
console.log(pc.dim(` ${AGENTS_FILE}`));
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
console.log(` ${pc.dim("○")} Not installed`);
|
|
112
|
-
console.log(pc.dim("Run 'quickback codex install' to install the rules.\n"));
|
|
113
|
-
}
|
|
114
|
-
console.log("");
|
|
115
|
-
}
|
|
116
|
-
function printHelp() {
|
|
117
|
-
console.log(`
|
|
118
|
-
${pc.bold("Quickback Codex Rules (AGENTS.md)")}
|
|
119
|
-
|
|
120
|
-
${pc.bold("USAGE")}
|
|
121
|
-
quickback codex <command>
|
|
122
|
-
|
|
123
|
-
${pc.bold("COMMANDS")}
|
|
124
|
-
${pc.cyan("install")} Add/update the Quickback block in ./AGENTS.md
|
|
125
|
-
${pc.cyan("update")} Refresh the block to the latest version
|
|
126
|
-
${pc.cyan("remove")} Strip the Quickback block
|
|
127
|
-
${pc.cyan("status")} Check installation status
|
|
128
|
-
|
|
129
|
-
${pc.bold("EXAMPLES")}
|
|
130
|
-
${pc.gray("# Install rules")}
|
|
131
|
-
quickback codex install
|
|
132
|
-
`);
|
|
133
|
-
}
|
|
134
|
-
export async function codex(args) {
|
|
135
|
-
const subcommand = args[0];
|
|
136
|
-
switch (subcommand) {
|
|
137
|
-
case "install":
|
|
138
|
-
case "update":
|
|
139
|
-
await install();
|
|
140
|
-
break;
|
|
141
|
-
case "remove":
|
|
142
|
-
case "uninstall":
|
|
143
|
-
await remove();
|
|
144
|
-
break;
|
|
145
|
-
case "status":
|
|
146
|
-
await status();
|
|
147
|
-
break;
|
|
148
|
-
case "--help":
|
|
149
|
-
case "-h":
|
|
150
|
-
case undefined:
|
|
151
|
-
printHelp();
|
|
152
|
-
break;
|
|
153
|
-
default:
|
|
154
|
-
console.log(pc.red(`\nUnknown subcommand: ${subcommand}`));
|
|
155
|
-
printHelp();
|
|
156
|
-
process.exit(1);
|
|
157
|
-
}
|
|
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