Skip to content

Commit 61f3b37

Browse files
committed
Sync open source content 🐝 (from 4509a1aeb0fb5dbeba382b036edb9f457516ada7)
1 parent 7de1b0f commit 61f3b37

File tree

6 files changed

+226
-1
lines changed

6 files changed

+226
-1
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# files
2+
`speakeasy diff files`
3+
4+
5+
Compare two local spec files
6+
7+
## Details
8+
9+
# Diff Files
10+
11+
Compare two OpenAPI spec files directly from disk and show SDK-level changes.
12+
13+
This is the simplest mode - just provide paths to your old and new spec files.
14+
15+
Example usage:
16+
```bash
17+
speakeasy diff files --old ./old-openapi.yaml --new ./new-openapi.yaml
18+
19+
# Use a specific language for SDK diff context
20+
speakeasy diff files --old v1.yaml --new v2.yaml --lang typescript
21+
22+
# Specify output directory for intermediate files
23+
speakeasy diff files --old old.json --new new.json --output-dir ./diff-output
24+
```
25+
26+
## Usage
27+
28+
```
29+
speakeasy diff files [flags]
30+
```
31+
32+
### Options
33+
34+
```
35+
--format-to-yaml Pre-format specs to YAML before diffing (helps with consistent output) (default true)
36+
-h, --help help for files
37+
-l, --lang string Target language for SDK diff context (default "go")
38+
--new string Path to the new OpenAPI spec file
39+
--old string Path to the old OpenAPI spec file
40+
-o, --output-dir string Directory for intermediate files (default "/tmp/speakeasy-diff")
41+
```
42+
43+
### Options inherited from parent commands
44+
45+
```
46+
--logLevel string the log level (available options: [info, warn, error]) (default "info")
47+
```
48+
49+
### Parent Command
50+
51+
* [speakeasy diff](/docs/speakeasy-reference/cli/diff) - Compare spec revisions and show SDK changes
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# from-pr
2+
`speakeasy diff from-pr`
3+
4+
5+
Compare specs from a GitHub PR
6+
7+
## Details
8+
9+
# Diff From PR
10+
11+
Compare spec revisions from a GitHub pull request created by Speakeasy.
12+
13+
This command automatically looks up the spec revisions used in a Speakeasy-generated PR
14+
and shows the SDK-level changes between the previous and new specs.
15+
16+
Example usage:
17+
```bash
18+
speakeasy diff from-pr https://github.com/org/sdk-repo/pull/123
19+
```
20+
21+
## Usage
22+
23+
```
24+
speakeasy diff from-pr [url] [flags]
25+
```
26+
27+
### Options
28+
29+
```
30+
--format-to-yaml Pre-format specs to YAML before diffing (helps with consistent output) (default true)
31+
-h, --help help for from-pr
32+
-o, --output-dir string Directory to download specs to (default "/tmp/speakeasy-diff")
33+
-v, --verbose Show detailed event information during lookup
34+
```
35+
36+
### Options inherited from parent commands
37+
38+
```
39+
--logLevel string the log level (available options: [info, warn, error]) (default "info")
40+
```
41+
42+
### Parent Command
43+
44+
* [speakeasy diff](/docs/speakeasy-reference/cli/diff) - Compare spec revisions and show SDK changes
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
asIndexPage: true
3+
---
4+
5+
# diff
6+
`speakeasy diff`
7+
8+
9+
Compare spec revisions and show SDK changes
10+
11+
## Details
12+
13+
# Diff
14+
15+
Compare OpenAPI spec revisions and show **SDK-level changes** - how the generated
16+
SDK methods, models, and types would differ between two spec versions.
17+
18+
This is different from `speakeasy openapi diff` which shows raw OpenAPI schema
19+
changes (paths, operations, properties). Use this command when you want to understand
20+
the impact on your generated SDK code.
21+
22+
This command supports three modes:
23+
24+
## Files Mode (Local)
25+
Compare two spec files directly from disk:
26+
```bash
27+
speakeasy diff files --old old-spec.yaml --new new-spec.yaml
28+
```
29+
30+
## From PR Mode
31+
Look up specs from a GitHub pull request created by Speakeasy:
32+
```bash
33+
speakeasy diff from-pr https://github.com/org/repo/pull/123
34+
```
35+
36+
## Registry Mode
37+
Compare specs by providing registry namespace and digest values:
38+
```bash
39+
speakeasy diff registry --namespace my-api --old sha256:abc... --new sha256:def...
40+
```
41+
42+
## Usage
43+
44+
```
45+
speakeasy diff [flags]
46+
```
47+
48+
### Options
49+
50+
```
51+
-h, --help help for diff
52+
```
53+
54+
### Options inherited from parent commands
55+
56+
```
57+
--logLevel string the log level (available options: [info, warn, error]) (default "info")
58+
```
59+
60+
### Parent Command
61+
62+
* [speakeasy](/docs/speakeasy-reference/cli/getting-started) - The Speakeasy CLI tool provides access to the Speakeasy.com platform
63+
### Sub Commands
64+
65+
* [speakeasy diff files](/docs/speakeasy-reference/cli/diff/files) - Compare two local spec files
66+
* [speakeasy diff from-pr](/docs/speakeasy-reference/cli/diff/from-pr) - Compare specs from a GitHub PR
67+
* [speakeasy diff registry](/docs/speakeasy-reference/cli/diff/registry) - Compare specs by registry namespace and digests
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# registry
2+
`speakeasy diff registry`
3+
4+
5+
Compare specs by registry namespace and digests
6+
7+
## Details
8+
9+
# Diff Registry
10+
11+
Compare two OpenAPI spec revisions from the Speakeasy registry and show SDK-level changes.
12+
13+
This command will:
14+
1. Download the old spec revision from the registry
15+
2. Download the new spec revision from the registry
16+
3. Compute and display SDK-level changes between them
17+
18+
Example usage:
19+
```bash
20+
speakeasy diff registry \
21+
--namespace my-api \
22+
--old sha256:abc123... \
23+
--new sha256:def456...
24+
25+
# Use a specific language for SDK diff context
26+
speakeasy diff registry --namespace myns --old sha256:abc... --new sha256:def... --lang typescript
27+
```
28+
29+
## Usage
30+
31+
```
32+
speakeasy diff registry [flags]
33+
```
34+
35+
### Options
36+
37+
```
38+
--format-to-yaml Pre-format specs to YAML before diffing (helps with consistent output) (default true)
39+
-h, --help help for registry
40+
-l, --lang string Target language for SDK diff context (default "go")
41+
--namespace string Source namespace
42+
--new string New revision digest (e.g., sha256:abc123...)
43+
--old string Old revision digest (e.g., sha256:abc123...)
44+
--org string Organization slug (defaults to current)
45+
-o, --output-dir string Directory to download specs to (default "/tmp/speakeasy-diff")
46+
--workspace string Workspace slug (defaults to current)
47+
```
48+
49+
### Options inherited from parent commands
50+
51+
```
52+
--logLevel string the log level (available options: [info, warn, error]) (default "info")
53+
```
54+
55+
### Parent Command
56+
57+
* [speakeasy diff](/docs/speakeasy-reference/cli/diff) - Compare spec revisions and show SDK changes

docs/speakeasy-reference/cli/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ speakeasy [flags]
5252
* [speakeasy bump](/docs/speakeasy-reference/cli/bump) - Bumps the version of a Speakeasy Generation Target
5353
* [speakeasy clean](/docs/speakeasy-reference/cli/clean) - Speakeasy clean can be used to clean up cache, stale temp folders, and old CLI binaries.
5454
* [speakeasy configure](/docs/speakeasy-reference/cli/configure) - Configure your Speakeasy SDK Setup.
55+
* [speakeasy diff](/docs/speakeasy-reference/cli/diff) - Compare spec revisions and show SDK changes
5556
* [speakeasy lint](/docs/speakeasy-reference/cli/lint) - Lint/Validate OpenAPI documents and Speakeasy configuration files
5657
* [speakeasy mcp](/docs/speakeasy-reference/cli/mcp) - Commands for MCP server management
5758
* [speakeasy merge](/docs/speakeasy-reference/cli/merge) - Merge multiple OpenAPI documents into a single document

docs/speakeasy-reference/cli/openapi/diff.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ Visualize the changes between two OpenAPI documents
66

77
## Details
88

9-
Visualize the changes between two OpenAPI documents
9+
Visualize the **raw OpenAPI schema changes** between two documents - paths added/removed,
10+
operations changed, properties modified, etc.
11+
12+
This is different from `speakeasy diff` which shows SDK-level changes (how generated
13+
SDK methods and types would differ). Use this command when you want to see the raw
14+
specification differences.
1015

1116
## Usage
1217

0 commit comments

Comments
 (0)