cralph 1.0.0-alpha.5 → 1.0.0-beta.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 +8 -6
- package/package.json +1 -1
- package/src/cli.ts +1 -1
- package/src/paths.ts +17 -2
package/README.md
CHANGED
|
@@ -26,13 +26,11 @@ cralph wraps this into a CLI with config, logging, and TODO tracking.
|
|
|
26
26
|
## Install
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
# Install Bun (if not already installed)
|
|
30
|
+
curl -fsSL https://bun.sh/install | bash
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
npm install -g cralph
|
|
32
|
+
# Install cralph
|
|
33
|
+
bun add -g cralph
|
|
36
34
|
```
|
|
37
35
|
|
|
38
36
|
## Quick Start
|
|
@@ -107,6 +105,8 @@ Any relevant context
|
|
|
107
105
|
## First Run (Empty Directory)
|
|
108
106
|
|
|
109
107
|
```
|
|
108
|
+
? No directories found. Create starter structure in /path/to/dir? (Y/n)
|
|
109
|
+
|
|
110
110
|
ℹ Created .ralph/refs/ directory
|
|
111
111
|
ℹ Created .ralph/rule.md with starter template
|
|
112
112
|
ℹ Created .ralph/paths.json
|
|
@@ -118,6 +118,8 @@ Any relevant context
|
|
|
118
118
|
╰──────────────────────────────────────────────╯
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
+
Use `--yes` to skip confirmation (for CI/automation).
|
|
122
|
+
|
|
121
123
|
## Prompts
|
|
122
124
|
|
|
123
125
|
**Config detected:**
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -136,7 +136,7 @@ const main = defineCommand({
|
|
|
136
136
|
// Interactive selection
|
|
137
137
|
const refs = args.refs
|
|
138
138
|
? args.refs.split(",").map((r) => resolve(cwd, r.trim()))
|
|
139
|
-
: await selectRefs(cwd, existingConfig?.refs);
|
|
139
|
+
: await selectRefs(cwd, existingConfig?.refs, args.yes);
|
|
140
140
|
|
|
141
141
|
const rule = args.rule
|
|
142
142
|
? resolve(cwd, args.rule)
|
package/src/paths.ts
CHANGED
|
@@ -137,13 +137,28 @@ export async function createStarterStructure(cwd: string): Promise<void> {
|
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
139
|
* Prompt user to select refs directories (simple multiselect)
|
|
140
|
+
* @param autoConfirm - If true, skip confirmation prompts
|
|
140
141
|
*/
|
|
141
|
-
export async function selectRefs(cwd: string, defaults?: string[]): Promise<string[]> {
|
|
142
|
+
export async function selectRefs(cwd: string, defaults?: string[], autoConfirm?: boolean): Promise<string[]> {
|
|
142
143
|
// Get all directories up to 3 levels deep
|
|
143
144
|
let allDirs = await listDirectoriesRecursive(cwd, 3);
|
|
144
145
|
|
|
145
146
|
if (allDirs.length === 0) {
|
|
146
|
-
//
|
|
147
|
+
// Ask before creating starter structure (skip if autoConfirm)
|
|
148
|
+
if (!autoConfirm) {
|
|
149
|
+
const confirm = await consola.prompt(
|
|
150
|
+
`No directories found. Create starter structure in ${cwd}?`,
|
|
151
|
+
{
|
|
152
|
+
type: "confirm",
|
|
153
|
+
initial: true,
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
if (confirm !== true) {
|
|
158
|
+
throw new Error("Setup cancelled");
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
147
162
|
await createStarterStructure(cwd);
|
|
148
163
|
process.exit(0);
|
|
149
164
|
}
|