#!/usr/bin/env bun /** * Generate API Client Skill * Generates typed API clients from OpenAPI/Swagger specifications */ import { parseArgs } from "util"; import { join } from "path"; import { generateApiClient } from "./generator"; import { LOGS_DIR, SESSION_ID, SESSION_TIMESTAMP, log } from "./logger"; async function main() { const { values, positionals } = parseArgs({ args: Bun.argv.slice(2), options: { language: { type: "string", short: "l", default: "typescript" }, client: { type: "string", default: "fetch" }, output: { type: "string", short: "o" }, auth: { type: "string", default: "bearer" }, style: { type: "string", default: "modular" }, async: { type: "boolean", default: true }, sync: { type: "boolean", default: false }, "base-url": { type: "string" }, name: { type: "string" }, "types-only": { type: "boolean", default: false }, help: { type: "boolean", short: "h" }, }, allowPositionals: true, }); if (values.help || positionals.length === 0) { console.log(` Generate API Client - Generate typed API clients from OpenAPI/Swagger specs Usage: bun run src/index.ts [options] Options: --language, -l Output language (typescript, javascript, python) [default: typescript] --client HTTP client (fetch, axios, ky, requests) [default: fetch] --output, -o Output directory path --auth Auth type (bearer, apikey, oauth2, basic, none) [default: bearer] --style