MCPcopy Index your code
hub / github.com/simstudioai/sim / main

Function main

apps/sim/scripts/build-pi-e2b-template.ts:31–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 .npmInstall(['@earendil-works/pi-coding-agent'], { g: true })
30
31async function main() {
32 if (!process.env.E2B_API_KEY) {
33 console.error('E2B_API_KEY is required')
34 process.exit(1)
35 }
36
37 const args = process.argv.slice(2)
38 const nameIdx = args.indexOf('--name')
39 const templateName = nameIdx !== -1 ? args[nameIdx + 1] : DEFAULT_TEMPLATE_NAME
40 const skipCache = args.includes('--no-cache')
41
42 console.log(`Building Pi E2B template: ${templateName}`)
43 console.log(skipCache ? 'Cache: disabled\n' : 'Cache: enabled\n')
44
45 const result = await Template.build(piTemplate, templateName, {
46 onBuildLogs: defaultBuildLogger(),
47 ...(skipCache ? { skipCache: true } : {}),
48 })
49
50 console.log(`\nDone. Template ID: ${result.templateId}`)
51 console.log(`Set in .env: E2B_PI_TEMPLATE_ID=${templateName}`)
52}
53
54main().catch((error) => {
55 console.error('Build failed:', error)

Callers 1

Calls 3

errorMethod · 0.80
logMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected