diff --git a/Cargo.lock b/Cargo.lock
index 51d0e89a..a0263565 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2174,6 +2174,7 @@ dependencies = [
"serde",
"shell-words",
"strum",
+ "tempfile",
"tera",
"thiserror",
"versions",
diff --git a/cli/assets/fig.ts b/cli/assets/fig.ts
index 433bb830..29499a60 100644
--- a/cli/assets/fig.ts
+++ b/cli/assets/fig.ts
@@ -456,6 +456,55 @@ const completionSpec: Fig.Spec = {
},
],
},
+ {
+ name: "sdk",
+ description: "Generate a type-safe SDK from a usage spec",
+ options: [
+ {
+ name: ["-f", "--file"],
+ description: "A usage spec taken in as a file",
+ isRepeatable: false,
+ args: {
+ name: "file",
+ template: "filepaths",
+ },
+ },
+ {
+ name: ["-l", "--language"],
+ description: "Target language for the SDK",
+ isRepeatable: false,
+ args: {
+ name: "language",
+ suggestions: ["typescript", "python"],
+ },
+ },
+ {
+ name: ["-o", "--output"],
+ description: "Output directory for generated SDK files",
+ isRepeatable: false,
+ args: {
+ name: "output",
+ },
+ },
+ {
+ name: ["-p", "--package-name"],
+ description:
+ "Override the package/module name (defaults to spec bin name)",
+ isRepeatable: false,
+ args: {
+ name: "package_name",
+ },
+ },
+ {
+ name: "--spec",
+ description: "Raw string spec input",
+ isRepeatable: false,
+ args: {
+ name: "spec",
+ },
+ },
+ ],
+ },
],
},
{
diff --git a/cli/assets/usage.1 b/cli/assets/usage.1
index 6320211c..0055e5f8 100644
--- a/cli/assets/usage.1
+++ b/cli/assets/usage.1
@@ -69,6 +69,9 @@ Generate markdown documentation from usage specs
\fIAliases: \fRmd
.RE
.TP
+\fBgenerate sdk\fR
+Generate a type\-safe SDK from a usage spec
+.TP
\fBlint\fR
Lint a usage spec file for common issues
.TP
@@ -310,6 +313,28 @@ Replace `
` tags with markdown code fences
.TP
\fB\-\-url\-prefix\fR \fI\fR
Prefix to add to all URLs
+.SH "USAGE GENERATE SDK"
+Generate a type\-safe SDK from a usage spec
+.PP
+\fBUsage:\fR usage generate sdk [OPTIONS]
+.PP
+\fBOptions:\fR
+.PP
+.TP
+\fB\-f, \-\-file\fR \fI\fR
+A usage spec taken in as a file
+.TP
+\fB\-l, \-\-language\fR \fI\fR
+Target language for the SDK
+.TP
+\fB\-o, \-\-output\fR \fI