Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Build ¶
Build assembles the command tree straight from the contracts:
leaflow <service> <tag> <operation-id> leaflow compute disk create-disk
Both name parts are literal values from the contract, lowercased and hyphenated. Nothing is inferred, so nothing can drift: an operationId is already treated as a stable identifier — the Go and TypeScript SDKs generate their method names from it — and a command name is now the same identifier rather than a second vocabulary that has to be kept in sync with it.
It also means one identifier serves the CLI, the SDKs and an MCP tool name, so a new backend operation becomes reachable everywhere at once, with no table to update.
Commands written in code are layered on top and may replace any of these; see package extension.
Types ¶
type Binding ¶
type Binding struct {
Operation *spec.Operation
Path []*openapi3.Parameter
Query []*openapi3.Parameter
Body *openapi3.Schema
Fields []*BodyField
// contains filtered or unexported fields
}
Binding describes an operation's arguments:
path parameters -> positional leaflow compute disk get <disk-id> query parameters -> flags --region-code cn-north-1 request body -> one flag per field, or --body
Path parameters are positional because they are always required and already ordered by the path itself; spelling them as flags only makes the same information longer.