diff --git a/packages/dantalion-cli/README.md b/packages/dantalion-cli/README.md index 435d29d..9ad7c55 100644 --- a/packages/dantalion-cli/README.md +++ b/packages/dantalion-cli/README.md @@ -27,6 +27,10 @@ npm install -g @kurone-kito/dantalion-cli ### Get the personality +#### If you want the **human-readable** result (Markdown) + +NOTE: It omits some minor information. + ```sh dantalion personality 1993-10-09 ``` @@ -34,6 +38,35 @@ dantalion personality 1993-10-09
Result +```md +# Dantalion: 誕生日が Sat Oct 09 1993 の人の性格と、取扱方法 + +## 性格の大分類 + +人の性格は大きく 3 つ、アート脳タイプ・理系脳タイプ・文系脳タイプに分類できます。 + +### 理系脳タイプ + + * 己の富のためを根底のエゴとし、効率性を追求するタイプです。 + * スペック至上主義の傾向があり、ブランドものを軽視する傾向が強いです。ただし、ブランドも一種のスペックと考え、重視する人も稀にいます。 + * 理系脳タイプは、長話をあまり聞けません。「つまりこういうことだよね?」と、脳内で要点だけかいつまんで理解しようとします。 + +: +: +``` + +
+ + +#### If you want the **JSON formatted** result + +```sh +dantalion personality --raw 1993-10-09 +``` + + +
Result + ```json { "cycle": 10, @@ -50,6 +83,10 @@ dantalion personality 1993-10-09 ### Get detailed information on personality +#### If you want the **human-readable** result (Markdown) + +NOTE: It omits some minor information. + ```sh dantalion details 555 ``` @@ -57,6 +94,35 @@ dantalion details 555
Result +```md +# Dantalion: 性格タイプ 555 の詳細、および取扱方法 + +## 性格の大分類 + +人の性格は大きく 3 つ、アート脳タイプ・理系脳タイプ・文系脳タイプに分類できます。 + +### 理系脳タイプ + + * 己の富のためを根底のエゴとし、効率性を追求するタイプです。 + * スペック至上主義の傾向があり、ブランドものを軽視する傾向が強いです。ただし、ブランドも一種のスペックと考え、重視する人も稀にいます。 + * 理系脳タイプは、長話をあまり聞けません。「つまりこういうことだよね?」と、脳内で要点だけかいつまんで理解しようとします。 + + : + : +``` + +
+ + +#### If you want the **JSON formatted** result + +```sh +dantalion details --raw 555 +``` + + +
Result + ```json { "affinity": { @@ -102,6 +168,35 @@ dantalion details 555
+### Get the types list of personality + +```sh +dantalion details +``` + + +
Result + +```md +# Dantalion: 有効な性格タイプ一覧 + + * 000 + * 001 + * 012 + * 024 + * 025 + * 100 + * 108 + * 125 + * 555 + * 789 + * 888 + * 919 +``` + +
+ + ## See also - [See the wiki for more details.](https://github.com/kurone-kito/dantalion/wiki) diff --git a/packages/dantalion-cli/src/index.ts b/packages/dantalion-cli/src/index.ts index b52b70e..d33ebee 100644 --- a/packages/dantalion-cli/src/index.ts +++ b/packages/dantalion-cli/src/index.ts @@ -5,13 +5,20 @@ import { version } from '../package.json'; import detail from './detail'; import personality from './personality'; import showJson from './render/showJson'; +import showMd from './render/showMd'; -[detail, personality].forEach(({ getObject, alias, command, description }) => - commander - .command(command) - .alias(alias) - .description(description) - .action(async (...args) => showJson(await getObject(...args))) +[detail, personality].forEach( + ({ getDescriptionAsync, getObject, alias, command, description }) => + commander + .command(command) + .alias(alias) + .option('-r, --raw', 'Returns the raw JSON') + .description(description) + .action(async (arg, { raw }) => + !raw + ? showMd(await getDescriptionAsync(arg)) + : showJson(await getObject(arg)) + ) ); commander.version(version);