MCPcopy Create free account
hub / github.com/arctic-cli/interface / importClaudeFiles

Function importClaudeFiles

packages/arctic/src/cli/claude-import.ts:499–520  ·  view source on GitHub ↗
(files: string[], sourceDir: string, targetDir: string)

Source from the content-addressed store, hash-verified

497}
498
499async function importClaudeFiles(files: string[], sourceDir: string, targetDir: string) {
500 await fs.mkdir(targetDir, { recursive: true })
501 let importedCount = 0
502
503 for (const file of files) {
504 const rel = path.relative(sourceDir, file)
505 const dest = path.join(targetDir, rel)
506 await fs.mkdir(path.dirname(dest), { recursive: true })
507
508 const exists = await fs
509 .stat(dest)
510 .then(() => true)
511 .catch(() => false)
512 if (exists) continue
513
514 await fs.copyFile(file, dest)
515 importedCount += 1
516 }
517
518 log.info("claude commands import", { importedCount })
519 return importedCount
520}
521
522async function findProjectClaudeMcpFile(): Promise<string | undefined> {
523 const found = await Filesystem.findUp(CLAUDE_MCP_PROJECT_FILE, process.cwd())

Calls

no outgoing calls

Tested by

no test coverage detected