Backlog のデータをエクスポートするためのコマンドラインツール
- backlog-exporter
- 概要
- インストール
- 使用方法
- 課題のエクスポート
- Wikiのエクスポート
- 課題とWikiの一括エクスポート
- データの更新
- npxを使った課題のエクスポート
- npxを使ったデータの更新
- 課題のエクスポート
- 基本的な使用方法
- 出力先を指定
- Wiki のエクスポート
- 基本的な使用方法
- 出力先を指定
- 課題と Wiki の一括エクスポート
- 基本的な使用方法
- 出力先を指定
- データの更新
- カレントディレクトリとそのサブディレクトリのデータを更新
- 指定したディレクトリとそのサブディレクトリのデータを更新
- 確認プロンプトをスキップして更新
- 課題のみを更新
- Wikiのみを更新
- APIキーを指定して更新
- コマンド
- 出力形式
- 課題のタイトル
- Wiki のタイトル
- その他の特徴
backlog-exporter は、Backlog のデータをローカルにエクスポートするためのコマンドラインツールです。 現在、以下の機能をサポートしています:
- 課題(Issue)のエクスポート:Backlog の課題を Markdown ファイルとして保存
- Wiki 記事のエクスポート:Backlog の Wiki 記事を Markdown ファイルとして保存
- 一括エクスポート:課題と Wiki を同時に取得する機能
- データの更新:既存のエクスポートデータを最新の状態に更新する機能
$ npm install -g backlog-exporter
$ backlog-exporter COMMAND
running command...
$ backlog-exporter (--version)
backlog-exporter/0.3.0 linux-x64 node-v20.18.3
$ backlog-exporter --help [COMMAND]
USAGE
$ backlog-exporter COMMAND
...
backlog-exporter を使用するには、Backlog のドメイン、プロジェクト ID(またはキー)、API キーが必要です。
API キーは以下の方法で指定できます:
- コマンドラインオプションとして指定
- 環境変数
BACKLOG_API_KEY
に設定 .env
ファイルにBACKLOG_API_KEY=あなたのAPIキー
として設定
# 課題のエクスポート
$ backlog-exporter issue --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./issues
# Wikiのエクスポート
$ backlog-exporter wiki --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./wiki
# 課題とWikiの一括エクスポート
$ backlog-exporter all --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./backlog-data
# データの更新
$ backlog-exporter update
npx を使用する場合は、コマンドの前にnpx
を付けるだけです:
# npxを使った課題のエクスポート
$ npx backlog-exporter issue --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./issues
# npxを使ったデータの更新
$ npx backlog-exporter update
issue
コマンドを使用すると、Backlog の課題を Markdown ファイルとしてエクスポートできます。
# 基本的な使用方法
$ backlog-exporter issue --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY
# 出力先を指定
$ backlog-exporter issue --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./issues
エクスポートされた課題は、指定したディレクトリ内に Markdown ファイルとして保存されます。ファイル名は課題のキーに基づいて自動的に生成されます。
wiki
コマンドを使用すると、Backlog の Wiki ページを Markdown ファイルとしてエクスポートできます。
# 基本的な使用方法
$ backlog-exporter wiki --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY
# 出力先を指定
$ backlog-exporter wiki --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./wiki
エクスポートされた Wiki は、指定したディレクトリ内に Markdown ファイルとして保存されます。Wiki の階層構造は保持され、ディレクトリ構造として再現されます。
all
コマンドを使用すると、課題と Wiki を一度に取得できます。
# 基本的な使用方法
$ backlog-exporter all --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY
# 出力先を指定
$ backlog-exporter all --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./backlog-data
一括エクスポートでは、課題はissues
ディレクトリに、Wiki はwiki
ディレクトリに保存されます。
update
コマンドを使用すると、既存のエクスポートデータを最新の状態に更新できます。このコマンドは、ディレクトリ内のbacklog-settings.json
ファイルを探索し、見つかったディレクトリでデータを更新します。
# カレントディレクトリとそのサブディレクトリのデータを更新
$ backlog-exporter update
# 指定したディレクトリとそのサブディレクトリのデータを更新
$ backlog-exporter update ./my-project
# 確認プロンプトをスキップして更新
$ backlog-exporter update --force
# 課題のみを更新
$ backlog-exporter update --issuesOnly
# Wikiのみを更新
$ backlog-exporter update --wikisOnly
# APIキーを指定して更新
$ backlog-exporter update --apiKey YOUR_API_KEY
更新コマンドは、各ディレクトリの設定ファイルに基づいて、課題や Wiki を自動的に更新します。設定ファイルが見つかったディレクトリでは、そのディレクトリ内のファイルが直接更新されます(サブフォルダは作成されません)。
backlog-exporter help [COMMAND]
backlog-exporter plugins
backlog-exporter plugins add PLUGIN
backlog-exporter plugins:inspect PLUGIN...
backlog-exporter plugins install PLUGIN
backlog-exporter plugins link PATH
backlog-exporter plugins remove [PLUGIN]
backlog-exporter plugins reset
backlog-exporter plugins uninstall [PLUGIN]
backlog-exporter plugins unlink [PLUGIN]
backlog-exporter plugins update
Display help for backlog-exporter.
USAGE
$ backlog-exporter help [COMMAND...] [-n]
ARGUMENTS
COMMAND... Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for backlog-exporter.
See code: @oclif/plugin-help
List installed plugins.
USAGE
$ backlog-exporter plugins [--json] [--core]
FLAGS
--core Show core plugins.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
List installed plugins.
EXAMPLES
$ backlog-exporter plugins
See code: @oclif/plugin-plugins
Installs a plugin into backlog-exporter.
USAGE
$ backlog-exporter plugins add PLUGIN... [--json] [-f] [-h] [-s | -v]
ARGUMENTS
PLUGIN... Plugin to install.
FLAGS
-f, --force Force npm to fetch remote resources even if a local copy exists on disk.
-h, --help Show CLI help.
-s, --silent Silences npm output.
-v, --verbose Show verbose npm output.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Installs a plugin into backlog-exporter.
Uses npm to install plugins.
Installation of a user-installed plugin will override a core plugin.
Use the BACKLOG_EXPORTER_NPM_LOG_LEVEL environment variable to set the npm loglevel.
Use the BACKLOG_EXPORTER_NPM_REGISTRY environment variable to set the npm registry.
ALIASES
$ backlog-exporter plugins add
EXAMPLES
Install a plugin from npm registry.
$ backlog-exporter plugins add myplugin
Install a plugin from a github url.
$ backlog-exporter plugins add https://github.com/someuser/someplugin
Install a plugin from a github slug.
$ backlog-exporter plugins add someuser/someplugin
Displays installation properties of a plugin.
USAGE
$ backlog-exporter plugins inspect PLUGIN...
ARGUMENTS
PLUGIN... [default: .] Plugin to inspect.
FLAGS
-h, --help Show CLI help.
-v, --verbose
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Displays installation properties of a plugin.
EXAMPLES
$ backlog-exporter plugins inspect myplugin
See code: @oclif/plugin-plugins
Installs a plugin into backlog-exporter.
USAGE
$ backlog-exporter plugins install PLUGIN... [--json] [-f] [-h] [-s | -v]
ARGUMENTS
PLUGIN... Plugin to install.
FLAGS
-f, --force Force npm to fetch remote resources even if a local copy exists on disk.
-h, --help Show CLI help.
-s, --silent Silences npm output.
-v, --verbose Show verbose npm output.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Installs a plugin into backlog-exporter.
Uses npm to install plugins.
Installation of a user-installed plugin will override a core plugin.
Use the BACKLOG_EXPORTER_NPM_LOG_LEVEL environment variable to set the npm loglevel.
Use the BACKLOG_EXPORTER_NPM_REGISTRY environment variable to set the npm registry.
ALIASES
$ backlog-exporter plugins add
EXAMPLES
Install a plugin from npm registry.
$ backlog-exporter plugins install myplugin
Install a plugin from a github url.
$ backlog-exporter plugins install https://github.com/someuser/someplugin
Install a plugin from a github slug.
$ backlog-exporter plugins install someuser/someplugin
See code: @oclif/plugin-plugins
Links a plugin into the CLI for development.
USAGE
$ backlog-exporter plugins link PATH [-h] [--install] [-v]
ARGUMENTS
PATH [default: .] path to plugin
FLAGS
-h, --help Show CLI help.
-v, --verbose
--[no-]install Install dependencies after linking the plugin.
DESCRIPTION
Links a plugin into the CLI for development.
Installation of a linked plugin will override a user-installed or core plugin.
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
command will override the user-installed or core plugin implementation. This is useful for development work.
EXAMPLES
$ backlog-exporter plugins link myplugin
See code: @oclif/plugin-plugins
Removes a plugin from the CLI.
USAGE
$ backlog-exporter plugins remove [PLUGIN...] [-h] [-v]
ARGUMENTS
PLUGIN... plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ backlog-exporter plugins unlink
$ backlog-exporter plugins remove
EXAMPLES
$ backlog-exporter plugins remove myplugin
Remove all user-installed and linked plugins.
USAGE
$ backlog-exporter plugins reset [--hard] [--reinstall]
FLAGS
--hard Delete node_modules and package manager related files in addition to uninstalling plugins.
--reinstall Reinstall all plugins after uninstalling.
See code: @oclif/plugin-plugins
Removes a plugin from the CLI.
USAGE
$ backlog-exporter plugins uninstall [PLUGIN...] [-h] [-v]
ARGUMENTS
PLUGIN... plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ backlog-exporter plugins unlink
$ backlog-exporter plugins remove
EXAMPLES
$ backlog-exporter plugins uninstall myplugin
See code: @oclif/plugin-plugins
Removes a plugin from the CLI.
USAGE
$ backlog-exporter plugins unlink [PLUGIN...] [-h] [-v]
ARGUMENTS
PLUGIN... plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ backlog-exporter plugins unlink
$ backlog-exporter plugins remove
EXAMPLES
$ backlog-exporter plugins unlink myplugin
Update installed plugins.
USAGE
$ backlog-exporter plugins update [-h] [-v]
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Update installed plugins.
See code: @oclif/plugin-plugins
課題は以下の形式で Markdown ファイルとして保存されます:
# 課題のタイトル
## 基本情報
- 課題キー: PROJ-123
- ステータス: 処理中
- 優先度: 高
- 担当者: 山田太郎
- 作成日時: 2023/01/01 10:00:00
- 更新日時: 2023/01/02 15:30:45
- [Backlog Issue Link](https://example.backlog.jp/view/PROJ-123)
## 詳細
ここに課題の詳細説明が入ります。
## コメント
### コメント 1
- **投稿者**: 佐藤次郎
- **日時**: 2023/01/01 11:15:30
コメントの内容がここに表示されます。
---
### コメント 2
- **投稿者**: 鈴木三郎
- **日時**: 2023/01/02 09:45:12
返信コメントの内容がここに表示されます。
Wiki は以下の形式で Markdown ファイルとして保存されます:
# Wiki のタイトル
[Backlog Wiki Link](https://example.backlog.jp/alias/wiki/12345)
ここに Wiki の本文内容が入ります。
Backlog の書式がそのまま保持されます。
- 環境変数サポート: 環境変数
BACKLOG_API_KEY
を使用して API キーを設定可能 - 自動ディレクトリ作成: 出力ディレクトリが存在しない場合は自動的に作成
- 並列処理: 並列処理による高速なダウンロード
- ファイル名サニタイズ: ファイル名の自動サニタイズ(不正な文字の除去)
- 階層構造の保持: Wiki の階層構造を保持したエクスポート