@take-out/cli 0.0.50 → 0.0.52

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.
@@ -14,16 +14,12 @@ var UPSTREAM_REPO = "tamagui/takeout2",
14
14
  TAKEOUT_FILE = ".takeout";
15
15
  function getSyncPrompt() {
16
16
  try {
17
- for (var currentDir = dirname(fileURLToPath(import.meta.url)), packageRoot = currentDir; packageRoot !== parse(packageRoot).root;) {
18
- var pkgPath = join(packageRoot, "package.json");
19
- if (existsSync(pkgPath)) {
20
- var pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
21
- if (pkg.name === "@take-out/cli") break;
22
- }
23
- packageRoot = dirname(packageRoot);
17
+ for (var currentDir = dirname(fileURLToPath(import.meta.url)), monorepoRoot = currentDir; monorepoRoot !== parse(monorepoRoot).root;) {
18
+ var promptPath = join(monorepoRoot, "packages", "docs", "sync-prompt.md");
19
+ if (existsSync(promptPath)) return readFileSync(promptPath, "utf-8");
20
+ monorepoRoot = dirname(monorepoRoot);
24
21
  }
25
- var promptPath = join(packageRoot, "docs", "sync-prompt.md");
26
- return readFileSync(promptPath, "utf-8");
22
+ throw new Error("Could not find sync-prompt.md in packages/docs");
27
23
  } catch (error) {
28
24
  throw new Error(`Could not load sync prompt: ${_instanceof(error, Error) ? error.message : "Unknown error"}`);
29
25
  }
@@ -76,35 +72,54 @@ var syncCommand = defineCommand({
76
72
  name: "sync",
77
73
  description: "Sync your fork with the latest Takeout repository"
78
74
  },
79
- async run() {
80
- showStep("Takeout Repository Sync"), console.info(), showInfo("Takeout sync uses AI to intelligently merge upstream changes"), console.info(), console.info(pc.gray("How it works:")), console.info(pc.gray(" \u2022 Analyzes commits from upstream Takeout repository")), console.info(pc.gray(" \u2022 Determines which changes are relevant to your fork")), console.info(pc.gray(" \u2022 Applies changes while preserving your customizations")), console.info(pc.gray(" \u2022 Handles package ejection automatically")), console.info(pc.gray(" \u2022 Asks for your input when decisions are needed")), console.info();
75
+ args: {
76
+ auto: {
77
+ type: "boolean",
78
+ description: "Auto-run with claude-code without prompts (for non-TTY environments)",
79
+ default: !1
80
+ },
81
+ print: {
82
+ type: "boolean",
83
+ description: "Print the sync prompt and exit",
84
+ default: !1
85
+ }
86
+ },
87
+ async run(param) {
88
+ var {
89
+ args
90
+ } = param,
91
+ isAuto = args.auto,
92
+ isPrint = args.print;
93
+ showStep("Takeout Repository Sync"), console.info(), !isAuto && !isPrint && (showInfo("Takeout sync uses AI to intelligently merge upstream changes"), console.info(), console.info(pc.gray("How it works:")), console.info(pc.gray(" \u2022 Analyzes commits from upstream Takeout repository")), console.info(pc.gray(" \u2022 Determines which changes are relevant to your fork")), console.info(pc.gray(" \u2022 Applies changes while preserving your customizations")), console.info(pc.gray(" \u2022 Handles package ejection automatically")), console.info(pc.gray(" \u2022 Asks for your input when decisions are needed")), console.info());
81
94
  var hasClaudeCode = checkToolAvailable("claude"),
82
95
  hasCursor = checkToolAvailable("cursor-agent"),
83
96
  hasAider = checkToolAvailable("aider"),
84
- options = [];
85
- hasClaudeCode && options.push({
86
- value: "claude-code",
87
- label: "Claude Code (recommended)",
88
- hint: "Run sync automatically with Claude Code CLI"
89
- }), hasCursor && options.push({
90
- value: "cursor",
91
- label: "Cursor Agent",
92
- hint: "Run sync automatically with Cursor CLI"
93
- }), hasAider && options.push({
94
- value: "aider",
95
- label: "Aider",
96
- hint: "Run sync automatically with Aider CLI"
97
- }), options.push({
98
- value: "show-prompt",
99
- label: "Show prompt (copy & paste manually)",
100
- hint: "Display the full prompt to use with any LLM"
101
- });
102
- var choice = await promptSelect("How would you like to sync?", options);
103
- if (choice === "cancel") {
104
- console.info(), showInfo("Sync cancelled");
105
- return;
97
+ choice;
98
+ if (isAuto) hasClaudeCode || (showError("--auto requires claude CLI to be installed"), process.exit(1)), choice = "claude-code";else if (isPrint) choice = "show-prompt";else {
99
+ var options = [];
100
+ if (hasClaudeCode && options.push({
101
+ value: "claude-code",
102
+ label: "Claude Code (recommended)",
103
+ hint: "Run sync automatically with Claude Code CLI"
104
+ }), hasCursor && options.push({
105
+ value: "cursor",
106
+ label: "Cursor Agent",
107
+ hint: "Run sync automatically with Cursor CLI"
108
+ }), hasAider && options.push({
109
+ value: "aider",
110
+ label: "Aider",
111
+ hint: "Run sync automatically with Aider CLI"
112
+ }), options.push({
113
+ value: "show-prompt",
114
+ label: "Show prompt (copy & paste manually)",
115
+ hint: "Display the full prompt to use with any LLM"
116
+ }), choice = await promptSelect("How would you like to sync?", options), choice === "cancel") {
117
+ console.info(), showInfo("Sync cancelled");
118
+ return;
119
+ }
120
+ console.info();
106
121
  }
107
- if (console.info(), console.info(pc.dim("Fetching upstream repository...")), !ensureUpstreamRemote()) {
122
+ if (console.info(pc.dim("Fetching upstream repository...")), !ensureUpstreamRemote()) {
108
123
  showError("Failed to fetch upstream repository");
109
124
  return;
110
125
  }
@@ -118,11 +133,13 @@ var syncCommand = defineCommand({
118
133
  var prompt = getSyncPrompt();
119
134
  if (choice === "show-prompt") console.info(pc.dim("=".repeat(80))), console.info(prompt), console.info(pc.dim("=".repeat(80))), console.info(), showInfo("Copy the prompt above and paste it into your preferred LLM"), console.info(), console.info(pc.gray("Recommended LLMs:")), console.info(pc.gray(" \u2022 Claude Code (best for complex instructions)")), console.info(pc.gray(" \u2022 ChatGPT")), console.info(pc.gray(" \u2022 Cursor")), console.info(pc.gray(" \u2022 Aider")), console.info();else if (choice === "claude-code") {
120
135
  var _claude_stdin, _claude_stdin1;
121
- showInfo("Starting Claude Code with sync prompt..."), console.info(), console.info(pc.dim("Note: Claude Code will run in headless mode and make changes automatically.")), console.info(pc.dim("You will be asked to confirm important decisions.")), console.info();
122
- var shouldContinue = await confirmContinue("Continue with Claude Code?", !0);
123
- if (!shouldContinue) {
124
- showInfo("Sync cancelled");
125
- return;
136
+ if (showInfo("Starting Claude Code with sync prompt..."), console.info(), !isAuto) {
137
+ console.info(pc.dim("Note: Claude Code will run in headless mode and make changes automatically.")), console.info(pc.dim("You will be asked to confirm important decisions.")), console.info();
138
+ var shouldContinue = await confirmContinue("Continue with Claude Code?", !0);
139
+ if (!shouldContinue) {
140
+ showInfo("Sync cancelled");
141
+ return;
142
+ }
126
143
  }
127
144
  var tempDir = mkdtempSync(join(tmpdir(), "takeout-sync-")),
128
145
  promptFile = join(tempDir, "prompt.md");
@@ -1 +1 @@
1
- {"version":3,"names":["execSync","spawn","spawnSync","existsSync","mkdtempSync","readFileSync","writeFileSync","tmpdir","dirname","join","parse","fileURLToPath","defineCommand","pc","confirmContinue","promptSelect","showError","showInfo","showStep","showSuccess","_instanceof","left","right","Symbol","hasInstance","UPSTREAM_REPO","UPSTREAM_REMOTE","TAKEOUT_FILE","getSyncPrompt","currentDir","import","meta","url","packageRoot","root","pkgPath","pkg","JSON","name","promptPath","error","Error","message","checkToolAvailable","command","checkCmd","process","platform","result","status","ensureUpstreamRemote","remotes","encoding","includes","stdio","getUpstreamHeadSha","sha","trim","writeTakeoutConfig","configPath","cwd","date","Date","toISOString","split","content","syncCommand","description","run","console","info","gray","hasClaudeCode","hasCursor","hasAider","options","push","value","label","hint","choice","dim","upstreamSha","slice","prompt","repeat","_claude_stdin","_claude_stdin1","shouldContinue","tempDir","promptFile","claude","stdin","write","end","on","code","_cursor_stdin","_cursor_stdin1","shouldContinue1","cursor"],"sources":["../../../src/commands/sync.ts"],"sourcesContent":[null],"mappings":"AAIA,SAASA,QAAA,EAAUC,KAAA,EAAOC,SAAA,QAAiB;AAC3C,SAASC,UAAA,EAAYC,WAAA,EAAaC,YAAA,EAAcC,aAAA,QAAqB;AACrE,SAASC,MAAA,QAAc;AACvB,SAASC,OAAA,EAASC,IAAA,EAAMC,KAAA,QAAa;AACrC,SAASC,aAAA,QAAqB;AAE9B,SAASC,aAAA,QAAqB;AAC9B,OAAOC,EAAA,MAAQ;AAEf,SAAAC,eAAA,EAAAC,YAAA,EAAAC,SAAA,EAAAC,QAAA,EAAAC,QAAA,EAAAC,WAAA;AAAA,SACEC,YAAAC,IAAA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AAA/D,WAAA,kCAAAkD,OAAA,CAAAC,IAAA,CAAAzD,EAAA,CAAAoE,GAAA,wBAAAC,WAAA,CAAAC,KAAA,cAAAnE,SAAA,iCAAAgF,IAAA;QACH;MAKE,OAJA,IAAAhB,MAAS;QAKP,IAAAiB,aAAS,EAAAC,cAAgB;QACzBjF,QAAA,+CAAAoD,OAAA,CAAAC,IAAA;QACF,IAAA6B,eAAA,SAAArF,eAAA;QAGA,KAAAqF,eAAgB;UAEhBlF,QAAA,iBAA0B;UAIxB;QACF;QAGE,IAAAmF,MAAQ,GAAAnG,KACJ,eACF,GAMH,MACH,IACF;UACEqD,KAAA,EAAU,CACZ,QACF,WACD","ignoreList":[]}
1
+ {"version":3,"names":["execSync","spawn","spawnSync","existsSync","mkdtempSync","readFileSync","writeFileSync","tmpdir","dirname","join","parse","fileURLToPath","defineCommand","pc","confirmContinue","promptSelect","showError","showInfo","showStep","showSuccess","_instanceof","left","right","Symbol","hasInstance","UPSTREAM_REPO","UPSTREAM_REMOTE","TAKEOUT_FILE","getSyncPrompt","currentDir","import","meta","url","monorepoRoot","root","promptPath","Error","error","message","checkToolAvailable","command","checkCmd","process","platform","result","status","ensureUpstreamRemote","remotes","encoding","includes","stdio","getUpstreamHeadSha","sha","trim","writeTakeoutConfig","configPath","cwd","date","Date","toISOString","split","content","syncCommand","name","description","args","auto","type","default","print","run","param","isAuto","isPrint","console","info","gray","hasClaudeCode","hasCursor","hasAider","choice","exit","options","push","value","label","hint","dim","upstreamSha","slice","prompt","repeat","_claude_stdin","_claude_stdin1","shouldContinue","tempDir","promptFile","claude","stdin","write","end","on","code","_cursor_stdin","_cursor_stdin1","shouldContinue1","cursor"],"sources":["../../../src/commands/sync.ts"],"sourcesContent":[null],"mappings":"AAIA,SAASA,QAAA,EAAUC,KAAA,EAAOC,SAAA,QAAiB;AAC3C,SAASC,UAAA,EAAYC,WAAA,EAAaC,YAAA,EAAcC,aAAA,QAAqB;AACrE,SAASC,MAAA,QAAc;AACvB,S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CAAS;UAAAyF,UAAA,GAAAvF,IAAA,CAAAsF,OAAA;QACtCzF,aAAC,CAAA0F,UAAA,EAAAN,MAAA;QAED,IAAAO,MAAO,GAAAhG,KAAO,SAAY,EAC1B,CAGE,MAQD,IACH;UAKEiD,KAJA,GAKE,QACA,WACF;QAGkD,EAChD;QACF,CAAC0C,aAAA,GAAAK,MAAA,CAAAC,KAAA,cAAAN,aAAA,eAAAA,aAAA,CAAAO,KAAA,CAAAT,MAAA,IAAAG,cAAA,GAAAI,MAAA,CAAAC,KAAA,cAAAL,cAAA,eAAAA,cAAA,CAAAO,GAAA,IAAAH,MAAA,CAAAI,EAAA,oBAAAC,IAAA;UAED5B,OAAO,CAAAC,IAAO,IAAA2B,IAAM,KAAM,KAC1BhD,kBAEA,CAAAkC,WAAU,GAAArE,WAAU,+BAAS,GAAAuD,OAAA,CAAAC,IAAA,CAAA9D,EAAA,CAAA0E,GAAA,wBAAAC,WAAA,CAAAC,KAAA,cAAAzE,SAAA,iCAAAsF,IAAA;QAC3B;MAMmD,OAEpD,IAAAtB,MAAA;QACH,IAAAuB,aAAW,EAAAC,cAAoB;QAK7BvF,QAJA,4CACA,GAAAyD,OAAQ,CAAAC,IAAK,CAGT,CADmB;QAErB,IAAA8B,eAAS,SAAgB3F,eAAA;QACzB,KAAA2F,eAAA;UACFxF,QAAA;UAGA;QAEA;QAG4E,IAC1EyF,MAAO,GAAAzG,KAAA,kBACR,IAEQ,EACP,IAQD;UACHiD,KAAA,GACF,MAAS,EACP,SAAU,EACZ;QAEH","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@take-out/cli",
3
- "version": "0.0.50",
3
+ "version": "0.0.52",
4
4
  "description": "CLI tools for Takeout starter kit - interactive onboarding and project setup",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "scripts": {
42
42
  "build": "tamagui-build",
43
- "watch": "tamagui-build --watch",
43
+ "watch": "SKIP_INITIAL_BUILD=1 tamagui-build --watch",
44
44
  "typecheck": "tko run typecheck",
45
45
  "lint": "oxlint src",
46
46
  "lint:fix": "oxfmt src && oxlint --fix --fix-suggestions src",
@@ -50,8 +50,8 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@clack/prompts": "^0.8.2",
53
- "@take-out/docs": "0.0.50",
54
- "@take-out/scripts": "0.0.50",
53
+ "@take-out/docs": "0.0.52",
54
+ "@take-out/scripts": "0.0.52",
55
55
  "citty": "^0.1.6",
56
56
  "picocolors": "^1.1.1"
57
57
  },
@@ -64,7 +64,7 @@
64
64
  }
65
65
  },
66
66
  "devDependencies": {
67
- "@tamagui/build": "^2.0.0-1768983999155",
67
+ "@tamagui/build": "^2.0.0-1769320275396",
68
68
  "@types/node": "24.0.3",
69
69
  "bun-types": "latest",
70
70
  "oxfmt": "^0.16.0",
@@ -453,22 +453,25 @@ const skillsCommand = defineCommand({
453
453
  let unchanged = 0
454
454
 
455
455
  for (const doc of docs) {
456
- const baseName = toSkillName(doc.name)
457
- const skillName = `${SKILL_PREFIX}${baseName}`
458
- const skillDir = join(skillsDir, skillName)
459
- const skillFile = join(skillDir, 'SKILL.md')
460
-
461
456
  // read doc content
462
457
  const content = readFileSync(doc.path, 'utf-8')
463
458
  const hasFrontmatter = hasSkillFrontmatter(content)
464
459
 
465
- // ensure skill directory exists
466
- if (!existsSync(skillDir)) {
467
- mkdirSync(skillDir, { recursive: true })
468
- }
469
-
470
460
  if (hasFrontmatter) {
471
- // doc has frontmatter - symlink it directly
461
+ // extract skill name from frontmatter
462
+ const nameMatch = content.match(/^---\s*\nname:\s*([^\n]+)/m)
463
+ if (!nameMatch) continue
464
+
465
+ const skillName = nameMatch[1].trim()
466
+ const skillDir = join(skillsDir, skillName)
467
+ const skillFile = join(skillDir, 'SKILL.md')
468
+
469
+ // ensure skill directory exists
470
+ if (!existsSync(skillDir)) {
471
+ mkdirSync(skillDir, { recursive: true })
472
+ }
473
+
474
+ // symlink it directly
472
475
  const relativePath = relative(skillDir, doc.path)
473
476
 
474
477
  // check if symlink already exists and points to same target
@@ -499,6 +502,16 @@ const skillsCommand = defineCommand({
499
502
  )
500
503
  } else {
501
504
  // doc lacks frontmatter - generate skill file with frontmatter
505
+ const baseName = toSkillName(doc.name)
506
+ const skillName = `${SKILL_PREFIX}${baseName}`
507
+ const skillDir = join(skillsDir, skillName)
508
+ const skillFile = join(skillDir, 'SKILL.md')
509
+
510
+ // ensure skill directory exists
511
+ if (!existsSync(skillDir)) {
512
+ mkdirSync(skillDir, { recursive: true })
513
+ }
514
+
502
515
  const { title, description } = extractDocMeta(content)
503
516
  const skillDescription = description
504
517
  ? `${title}. ${description}`.slice(0, 1024)
@@ -577,10 +577,10 @@ export function createShorthandCommand(name: string) {
577
577
  args: {
578
578
  name: scriptName,
579
579
  _: rawArgs.slice(1),
580
- } as any,
580
+ },
581
581
  rawArgs: scriptArgs,
582
582
  cmd: scriptCommand,
583
- } as any)
583
+ })
584
584
  }
585
585
  },
586
586
  })
@@ -26,24 +26,20 @@ const TAKEOUT_FILE = '.takeout'
26
26
 
27
27
  function getSyncPrompt(): string {
28
28
  try {
29
- // find package root by looking for package.json
29
+ // find monorepo root by looking for packages/docs
30
30
  const currentDir = dirname(fileURLToPath(import.meta.url))
31
- let packageRoot = currentDir
32
-
33
- // go up directories until we find package.json with name @take-out/cli
34
- while (packageRoot !== parse(packageRoot).root) {
35
- const pkgPath = join(packageRoot, 'package.json')
36
- if (existsSync(pkgPath)) {
37
- const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'))
38
- if (pkg.name === '@take-out/cli') {
39
- break
40
- }
31
+ let monorepoRoot = currentDir
32
+
33
+ // go up directories until we find packages/docs/sync-prompt.md
34
+ while (monorepoRoot !== parse(monorepoRoot).root) {
35
+ const promptPath = join(monorepoRoot, 'packages', 'docs', 'sync-prompt.md')
36
+ if (existsSync(promptPath)) {
37
+ return readFileSync(promptPath, 'utf-8')
41
38
  }
42
- packageRoot = dirname(packageRoot)
39
+ monorepoRoot = dirname(monorepoRoot)
43
40
  }
44
41
 
45
- const promptPath = join(packageRoot, 'docs', 'sync-prompt.md')
46
- return readFileSync(promptPath, 'utf-8')
42
+ throw new Error('Could not find sync-prompt.md in packages/docs')
47
43
  } catch (error) {
48
44
  throw new Error(
49
45
  `Could not load sync prompt: ${error instanceof Error ? error.message : 'Unknown error'}`
@@ -103,71 +99,99 @@ export const syncCommand = defineCommand({
103
99
  name: 'sync',
104
100
  description: 'Sync your fork with the latest Takeout repository',
105
101
  },
106
- async run() {
102
+ args: {
103
+ auto: {
104
+ type: 'boolean',
105
+ description: 'Auto-run with claude-code without prompts (for non-TTY environments)',
106
+ default: false,
107
+ },
108
+ print: {
109
+ type: 'boolean',
110
+ description: 'Print the sync prompt and exit',
111
+ default: false,
112
+ },
113
+ },
114
+ async run({ args }) {
115
+ const isAuto = args.auto
116
+ const isPrint = args.print
107
117
  showStep('Takeout Repository Sync')
108
118
  console.info()
109
119
 
110
- showInfo('Takeout sync uses AI to intelligently merge upstream changes')
111
- console.info()
112
- console.info(pc.gray('How it works:'))
113
- console.info(pc.gray(' Analyzes commits from upstream Takeout repository'))
114
- console.info(pc.gray(' • Determines which changes are relevant to your fork'))
115
- console.info(pc.gray(' • Applies changes while preserving your customizations'))
116
- console.info(pc.gray(' • Handles package ejection automatically'))
117
- console.info(pc.gray(' • Asks for your input when decisions are needed'))
118
- console.info()
120
+ if (!isAuto && !isPrint) {
121
+ showInfo('Takeout sync uses AI to intelligently merge upstream changes')
122
+ console.info()
123
+ console.info(pc.gray('How it works:'))
124
+ console.info(pc.gray(' • Analyzes commits from upstream Takeout repository'))
125
+ console.info(pc.gray(' • Determines which changes are relevant to your fork'))
126
+ console.info(pc.gray(' • Applies changes while preserving your customizations'))
127
+ console.info(pc.gray(' • Handles package ejection automatically'))
128
+ console.info(pc.gray(' • Asks for your input when decisions are needed'))
129
+ console.info()
130
+ }
119
131
 
120
132
  // check what tools are available
121
133
  const hasClaudeCode = checkToolAvailable('claude')
122
134
  const hasCursor = checkToolAvailable('cursor-agent')
123
135
  const hasAider = checkToolAvailable('aider')
124
136
 
125
- const options: Array<{
126
- value: string
127
- label: string
128
- hint: string
129
- }> = []
137
+ // handle --auto mode
138
+ let choice: string
139
+ if (isAuto) {
140
+ if (!hasClaudeCode) {
141
+ showError('--auto requires claude CLI to be installed')
142
+ process.exit(1)
143
+ }
144
+ choice = 'claude-code'
145
+ } else if (isPrint) {
146
+ choice = 'show-prompt'
147
+ } else {
148
+ const options: Array<{
149
+ value: string
150
+ label: string
151
+ hint: string
152
+ }> = []
153
+
154
+ if (hasClaudeCode) {
155
+ options.push({
156
+ value: 'claude-code',
157
+ label: 'Claude Code (recommended)',
158
+ hint: 'Run sync automatically with Claude Code CLI',
159
+ })
160
+ }
130
161
 
131
- if (hasClaudeCode) {
132
- options.push({
133
- value: 'claude-code',
134
- label: 'Claude Code (recommended)',
135
- hint: 'Run sync automatically with Claude Code CLI',
136
- })
137
- }
162
+ if (hasCursor) {
163
+ options.push({
164
+ value: 'cursor',
165
+ label: 'Cursor Agent',
166
+ hint: 'Run sync automatically with Cursor CLI',
167
+ })
168
+ }
138
169
 
139
- if (hasCursor) {
140
- options.push({
141
- value: 'cursor',
142
- label: 'Cursor Agent',
143
- hint: 'Run sync automatically with Cursor CLI',
144
- })
145
- }
170
+ if (hasAider) {
171
+ options.push({
172
+ value: 'aider',
173
+ label: 'Aider',
174
+ hint: 'Run sync automatically with Aider CLI',
175
+ })
176
+ }
146
177
 
147
- if (hasAider) {
148
178
  options.push({
149
- value: 'aider',
150
- label: 'Aider',
151
- hint: 'Run sync automatically with Aider CLI',
179
+ value: 'show-prompt',
180
+ label: 'Show prompt (copy & paste manually)',
181
+ hint: 'Display the full prompt to use with any LLM',
152
182
  })
153
- }
154
183
 
155
- options.push({
156
- value: 'show-prompt',
157
- label: 'Show prompt (copy & paste manually)',
158
- hint: 'Display the full prompt to use with any LLM',
159
- })
184
+ choice = await promptSelect<string>('How would you like to sync?', options)
160
185
 
161
- const choice = await promptSelect<string>('How would you like to sync?', options)
186
+ if (choice === 'cancel') {
187
+ console.info()
188
+ showInfo('Sync cancelled')
189
+ return
190
+ }
162
191
 
163
- if (choice === 'cancel') {
164
192
  console.info()
165
- showInfo('Sync cancelled')
166
- return
167
193
  }
168
194
 
169
- console.info()
170
-
171
195
  // fetch upstream to get the target SHA before syncing
172
196
  console.info(pc.dim('Fetching upstream repository...'))
173
197
  if (!ensureUpstreamRemote()) {
@@ -202,18 +226,21 @@ export const syncCommand = defineCommand({
202
226
  } else if (choice === 'claude-code') {
203
227
  showInfo('Starting Claude Code with sync prompt...')
204
228
  console.info()
205
- console.info(
206
- pc.dim(
207
- 'Note: Claude Code will run in headless mode and make changes automatically.'
229
+
230
+ if (!isAuto) {
231
+ console.info(
232
+ pc.dim(
233
+ 'Note: Claude Code will run in headless mode and make changes automatically.'
234
+ )
208
235
  )
209
- )
210
- console.info(pc.dim('You will be asked to confirm important decisions.'))
211
- console.info()
236
+ console.info(pc.dim('You will be asked to confirm important decisions.'))
237
+ console.info()
212
238
 
213
- const shouldContinue = await confirmContinue('Continue with Claude Code?', true)
214
- if (!shouldContinue) {
215
- showInfo('Sync cancelled')
216
- return
239
+ const shouldContinue = await confirmContinue('Continue with Claude Code?', true)
240
+ if (!shouldContinue) {
241
+ showInfo('Sync cancelled')
242
+ return
243
+ }
217
244
  }
218
245
 
219
246
  // write prompt to temp file to avoid shell escaping issues
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAAA;;GAEG;AA0iBH,eAAO,MAAM,WAAW,qDAYtB,CAAA"}
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAujBH,eAAO,MAAM,WAAW,qDAYtB,CAAA"}
@@ -1,5 +1,16 @@
1
1
  /**
2
2
  * Sync command - sync fork with upstream Takeout repository
3
3
  */
4
- export declare const syncCommand: import("citty").CommandDef<import("citty").ArgsDef>;
4
+ export declare const syncCommand: import("citty").CommandDef<{
5
+ auto: {
6
+ type: "boolean";
7
+ description: string;
8
+ default: false;
9
+ };
10
+ print: {
11
+ type: "boolean";
12
+ description: string;
13
+ default: false;
14
+ };
15
+ }>;
5
16
  //# sourceMappingURL=sync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkGH,eAAO,MAAM,WAAW,qDA4MtB,CAAA"}
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAAA;;GAEG;AA8FH,eAAO,MAAM,WAAW;;;;;;;;;;;EA2OtB,CAAA"}