diff --git a/tools/gitea.ts b/tools/gitea.ts index f97473e..e744894 100644 --- a/tools/gitea.ts +++ b/tools/gitea.ts @@ -149,11 +149,40 @@ async function main() { break; } + case 'projects': { + const sub = args[0] || 'list'; + if (sub === 'list') { + const projects = await api(`/repos/${OWNER}/${REPO}/projects`); + if (projects.length === 0) { + console.log('No projects found.'); + } else { + console.log(`Found ${projects.length} projects:`); + for (const p of projects) { + console.log(` #${p.id} ${p.title}`); + } + } + } else if (sub === 'create') { + const title = args[1]; + const description = args.slice(2).join(' ') || ''; + if (!title) { + console.error('Usage: bun tools/gitea.ts projects create