Very simple CLI tool that wraps the excellent json-schema-ref-parser library.
npm install -g json-dereference-cli
json-dereference -s my-schema.json -o compiled-schema.yaml
Note: The input file can either be json, or yaml / yml.
Note: The output file types are either json or yaml / yml. This is determined from the file extension for the output file path passed in.
This CLI tool will also attempt to resolve S3 references using the aws-sdk. Take a look here to see the custom resolver code.