MCPcopy Create free account
hub / github.com/R44VC0RP/opencode.cafe / main

Function main

scripts/import-awesome-list.ts:198–236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

196}
197
198async function main() {
199 const args = process.argv.slice(2)
200 const dryRun = !args.includes("--import")
201
202 try {
203 const readme = await fetchReadme()
204 const extensions = parseReadme(readme)
205
206 // Filter out official repositories (we don't want to import those)
207 const filtered = extensions.filter(ext => {
208 // Skip official SST repos
209 if (ext.repoOwner === "sst") return false
210 // Skip non-GitHub links (gists, discussions, etc.)
211 if (!ext.url.includes("github.com") || ext.url.includes("gist.github") || ext.url.includes("discussions")) return false
212 return true
213 })
214
215 console.log(`\nParsed ${extensions.length} total entries`)
216 console.log(`Filtered to ${filtered.length} importable extensions`)
217
218 await importToConvex(filtered, dryRun)
219
220 if (dryRun) {
221 console.log("\n" + "=".repeat(60))
222 console.log("To actually import, run: bun run scripts/import-awesome-list.ts --import")
223 console.log("=".repeat(60))
224 }
225
226 // Output JSON for manual import or further processing
227 const outputPath = "./scripts/awesome-opencode-parsed.json"
228 const fs = await import("fs/promises")
229 await fs.writeFile(outputPath, JSON.stringify(filtered, null, 2))
230 console.log(`\nParsed data saved to ${outputPath}`)
231
232 } catch (error) {
233 console.error("Error:", error)
234 process.exit(1)
235 }
236}
237
238main()

Callers 1

Calls 3

fetchReadmeFunction · 0.85
parseReadmeFunction · 0.85
importToConvexFunction · 0.85

Tested by

no test coverage detected