How to run codegen commands from yml file

# to download the schema
# npx apollo service:download --endpoint=http://localhost:8080/graphql graphql-schema.json

# to generate types based on the schema
# npx apollo codegen:generate --localSchemaFile=graphql-schema.json --target=typescript --tagName=gql

# this line is used to generate for local only fields
# npx apollo codegen:generate --localSchemaFile=graphql-schema.json,local-schema.graphql --target=typescript --tagName=gql

I would like to know if these long commands can be achieved through a .yml file. my goal here is not to put these long commands inside the package.json file. instead, I would like to call this .yml file from the package.json file scripts.