🛟

CLIツールを作ろう

公開日約1年前2025-10-25
MarkdownRaw Content

概要

Hono CLI の docs コマンドが面白かったので似たようなことをしたいと思った。

Hacker SheetのCLIツールを作るために調べたことを記録していく。

Commander.js

GitHub - tj/commander.js: node.js command-line interfaces made easy

Node.jsでCLIアプリケーションを作成するための人気のあるライブラリ。コマンドライン引数を解析し、オプションやサブコマンドを定義できる。

find-up

GitHub - sindresorhus/find-up: Find a file or directory by walking up parent directories

ファイルやディレクトリを親ディレクトリへ向かって上方向に探索し、最初に見つかったパスを返す小さなユーティリティ。

Inquirer.js

GitHub - SBoudrias/Inquirer.js: A collection of common interactive command line user interfaces.

対話式のプロンプトを簡単に作成できるライブラリ。

cosmiconfig

GitHub - cosmiconfig/cosmiconfig: Find and load configuration from a package.json property, rc file, TypeScript module, and more!

プロジェクト内の設定ファイルを柔軟に探索して読み込むためのライブラリ。

ブックマーク

commander.jsを利用したCLIコマンドの作成 Node.js製ライブラリのconfigはcosmiconfigで実装するのがよさそう - @kimulaco/blog GitHub - honojs/cli: Command-line tool for Hono, made for AI coding agents