(args: string[], usage: string)
| 14 | } |
| 15 | |
| 16 | export function requireAgentSlug(args: string[], usage: string): string { |
| 17 | const slug = args[0] |
| 18 | if (!slug || slug.startsWith("-")) { |
| 19 | p.log.error(`Agent slug is required. Usage: npx @21st-sdk/cli ${usage}`) |
| 20 | process.exit(1) |
| 21 | } |
| 22 | const err = validateSlug(slug) |
| 23 | if (err) { |
| 24 | p.log.error(err) |
| 25 | process.exit(1) |
| 26 | } |
| 27 | return slug |
| 28 | } |
| 29 | |
| 30 | export function buildApiUrl( |
| 31 | path: string, |
no test coverage detected