A script that takes a GitHub repository URL, calls the Runcept readme-generator agent, and writes a README.md to disk in seconds.
# Start the job
curl -sS -X POST https://www.runcept.com/api/v1/run \
-H "Authorization: Bearer runcept_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"agent": "readme-generator", "input": {"repo_url": "https://github.com/owner/repo"}}'
# Returns: {"job_id": "job_abc123", "status": "queued"}
# Poll for result
curl -sS https://www.runcept.com/api/v1/jobs/job_abc123 \
-H "Authorization: Bearer runcept_sk_YOUR_KEY"
import fs from 'fs'
async function generateReadme(repoUrl) {
const run = await fetch('https://www.runcept.com/api/v1/run', {
method: 'POST',
headers: {
Authorization: Bearer ${process.env.RUNCEPT_API_KEY},
'Content-Type': 'application/json',
},
body: JSON.stringify({ agent: 'readme-generator', input: { repo_url: repoUrl } }),
}).then(r => r.json())
// Poll every 3 seconds
while (true) {
await new Promise(r => setTimeout(r, 3000))
const job = await fetch(https://www.runcept.com/api/v1/jobs/${run.job_id}, {
headers: { Authorization: Bearer ${process.env.RUNCEPT_API_KEY} },
}).then(r => r.json())
if (job.status === 'complete') {
fs.writeFileSync('README.md', job.output.readme)
console.log('README.md written')
break
}
if (job.status === 'failed') throw new Error('Agent failed')
}
}
generateReadme('https://github.com/owner/repo')
To generate READMEs for multiple repos:
const repos = ['https://github.com/org/repo1', 'https://github.com/org/repo2']
for (const repo of repos) await generateReadme(repo)
Use this agent on Runcept
View readme-generator agent →