moonbitstack/moonctl/api does not have a README file
pub suberror SpecError {
Syntax(line~ : Int, msg~ : String)
Missing(file~ : String, path~ : String)
}pub(all) struct Field {
name : String
type_ : String
tag : String
}pub(all) struct Route {
verb : String
path : String
handler : String
summary : String
req : String
resp : String
group : Group?
}fn index_of(s : String, ch : UInt16, from : Int) -> Intsyntax = "v1"
info (
title: "greet"
version: "v2"
)
type LoginReq {
name: string
}
@server (
group: user
prefix: /api/v1
middleware: Log
)
service greet {
@doc "health check"
@handler ping
get /ping
@handler login
post /login (LoginReq) returns (LoginResp)
get /legacy legacy_handler "the inline form"
}fn resolve_import(from : String, path : String) -> Stringfn to_i64(s : String) -> Int64?Install
Download zipmoonctl (mctl) — a spec-driven code generator for MoonBit (← goctl): parse a .api service spec and emit compilable moonapi scaffolding (routes + handler stubs).