From 6c691417359bc7b02c06efeab50b347016b0730e Mon Sep 17 00:00:00 2001 From: Boris Cherny Date: Sun, 5 May 2024 13:38:52 +0900 Subject: [PATCH] Improve CLI docs --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 184f85d6..36847dfa 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,20 @@ json-schema-to-typescript is easy to use via the CLI, or programmatically. ### CLI -A CLI utility is provided with this package. +First make the CLI available using one of the following options: + +```sh +# install locally, then use `npx json2ts` +npm install json-schema-to-typescript + +# or install globally, then use `json2ts` +npm install json-schema-to-typescript --global + +# or install to npm cache, then use `npx --package=json-schema-to-typescript json2ts` +# (you don't need to run an install command first) +``` + +Then, use the CLI to convert JSON files to TypeScript typings: ```sh cat foo.json | json2ts > foo.d.ts