kintone APIの一覧をコマンド一発で見やすく取得

## はじめに
kintoneには「REST API一覧を確認するREST API」が用意されていて、
ログインなしで叩くことができます。
https://developer.cybozu.io/hc/ja/articles/201941934

> * HTTP メソッド
>   * GET
> * URI
>   * https://(サブドメイン名).cybozu.com/k/v1/apis.json

でもこれ、レスポンスが冗長で、
もっとシンプルに「1行に1APIを表示」してくれると使いやすいんですよ。

そういう時は、シェル芸ワンライナーでいきましょう。

## 基本
UNIXコマンドラインから、こう叩くと、

```shell
curl https://サブドメイン.cybozu.com/k/v1/apis.json|jq '.apis|keys' 
```

2020/02/27時点で、結果こうなります。
いい感じですね！

```json
[
  "app/acl/get",
  "app/acl/put",
  "app/customize/get",
  "app/form/fields/get",
  "app/form/layout/get",
  "app/get",
  "app/notifications/general/get",
  "app/notifications/perRecord/get",
  "app/notifications/reminder/get",
  "app/reports/get",
  "app/settings/get",
  "app/status/get",
  "app/views/get",
  "apps/get",
  "bulkRequest/post",
  "field/acl/get",
  "field/acl/put",
  "file/get",
  "file/post",
  "form/get",
  "guests/delete",
  "guests/post",
  "preview/app/acl/get",
  "preview/app/acl/put",
  "preview/app/customize/get",
  "preview/app/customize/put",
  "preview/app/deploy/get",
  "preview/app/deploy/post",
  "preview/app/form/fields/delete",
  "preview/app/form/fields/get",
  "preview/app/form/fields/post",
  "preview/app/form/fields/put",
  "preview/app/form/layout/get",
  "preview/app/form/layout/put",
  "preview/app/notifications/general/get",
  "preview/app/notifications/general/put",
  "preview/app/notifications/perRecord/get",
  "preview/app/notifications/perRecord/put",
  "preview/app/notifications/reminder/get",
  "preview/app/notifications/reminder/put",
  "preview/app/post",
  "preview/app/reports/get",
  "preview/app/reports/put",
  "preview/app/settings/get",
  "preview/app/settings/put",
  "preview/app/status/get",
  "preview/app/status/put",
  "preview/app/views/get",
  "preview/app/views/put",
  "preview/field/acl/get",
  "preview/field/acl/put",
  "preview/form/get",
  "preview/record/acl/get",
  "preview/record/acl/put",
  "record/acl/get",
  "record/acl/put",
  "record/assignees/put",
  "record/comment/delete",
  "record/comment/post",
  "record/comments/get",
  "record/get",
  "record/post",
  "record/put",
  "record/status/put",
  "records/acl/evaluate/get",
  "records/cursor/delete",
  "records/cursor/get",
  "records/cursor/post",
  "records/delete",
  "records/get",
  "records/post",
  "records/put",
  "records/status/put",
  "space/body/put",
  "space/delete",
  "space/get",
  "space/guests/put",
  "space/members/get",
  "space/members/put",
  "space/thread/comment/post",
  "space/thread/put",
  "template/space/post"
]
```

## ファイルに保存

普通にリダイレクトすればOK

```shell
curl https://サブドメイン.cybozu.com/k/v1/apis.json|jq '.apis|keys' > apis.json
```


## 条件で絞り込み

たとえば「`record/`または`records/`を含む」ものだけ抽出したければ、こう。

```shell
curl https://サブドメイン.cybozu.com/k/v1/apis.json|jq '.apis|keys|map(select(.|test("record/|records/")))'
```

結果

```json
[
  "preview/record/acl/get",
  "preview/record/acl/put",
  "record/acl/get",
  "record/acl/put",
  "record/assignees/put",
  "record/comment/delete",
  "record/comment/post",
  "record/comments/get",
  "record/get",
  "record/post",
  "record/put",
  "record/status/put",
  "records/acl/evaluate/get",
  "records/cursor/delete",
  "records/cursor/get",
  "records/cursor/post",
  "records/delete",
  "records/get",
  "records/post",
  "records/put",
  "records/status/put"
]
```
jq便利ですねー。


## 参考サイト
[jqを使って少し複雑な条件式でフィルタリングする方法をまとめてみた
](https://qiita.com/ttiger55/items/150e9a18313a55841a32)