cralph 1.0.0-alpha.5 → 1.0.0-alpha.6
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 +4 -0
- package/package.json +1 -1
- package/src/cli.ts +1 -1
- package/src/paths.ts +17 -2
package/README.md
CHANGED
|
@@ -107,6 +107,8 @@ Any relevant context
|
|
|
107
107
|
## First Run (Empty Directory)
|
|
108
108
|
|
|
109
109
|
```
|
|
110
|
+
? No directories found. Create starter structure in /path/to/dir? (Y/n)
|
|
111
|
+
|
|
110
112
|
ℹ Created .ralph/refs/ directory
|
|
111
113
|
ℹ Created .ralph/rule.md with starter template
|
|
112
114
|
ℹ Created .ralph/paths.json
|
|
@@ -118,6 +120,8 @@ Any relevant context
|
|
|
118
120
|
╰──────────────────────────────────────────────╯
|
|
119
121
|
```
|
|
120
122
|
|
|
123
|
+
Use `--yes` to skip confirmation (for CI/automation).
|
|
124
|
+
|
|
121
125
|
## Prompts
|
|
122
126
|
|
|
123
127
|
**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
|
}
|