Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Inspector のコンポーネントのヘッダーにボタンを追加するエディタ拡張

License

Notifications You must be signed in to change notification settings

lovedraftcode/ComponentHeaderGUI

Repository files navigation

ComponentHeaderGUI

Backlog のデータをエクスポートするためのコマンドラインツール

oclif Version Downloads/week

概要

techblog_cms は、Backlog のデータをローカルにエクスポートするためのコマンドラインツールです。 現在、以下の機能をサポートしています:

  • 課題(Issue)のエクスポート:Backlog の課題を Markdown ファイルとして保存(カスタム属性対応)
  • Wiki 記事のエクスポート:Backlog の Wiki 記事を Markdown ファイルとして保存
  • ドキュメントのエクスポート:Backlog のドキュメントを Markdown ファイルとして保存
  • 一括エクスポート:課題・Wiki・ドキュメントを同時に取得する機能
  • データの更新:既存のエクスポートデータを最新の状態に更新する機能

インストール

$ npm install -g techblog_cms
$ techblog_cms COMMAND
running command...
$ techblog_cms (--version)
techblog_cms/0.7.1 linux-x64 node-v20.19.3
$ techblog_cms --help [COMMAND]
USAGE
 $ techblog_cms COMMAND
...

使用方法

techblog_cms を使用するには、Backlog のドメイン、プロジェクト ID(またはキー)、API キーが必要です。

API キーは以下の方法で指定できます:

  1. コマンドラインオプションとして指定
  2. 環境変数 BACKLOG_API_KEY に設定
  3. .env ファイルに BACKLOG_API_KEY=あなたのAPIキー として設定

基本的な使用例

# 課題のエクスポート
$ techblog_cms issue --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./issues
# Wikiのエクスポート
$ techblog_cms wiki --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./wiki
# ドキュメントのエクスポート
$ techblog_cms document --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./documents
# 課題・Wiki・ドキュメントの一括エクスポート
$ techblog_cms all --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./backlog-data
# 特定のデータタイプのみをエクスポート(onlyフラグ)
$ techblog_cms all --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --only issues,wiki
# 特定のデータタイプを除外してエクスポート(excludeフラグ)
$ techblog_cms all --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --exclude documents
# データの更新
$ techblog_cms update

npx を使用する場合は、コマンドの前にnpxを付けるだけです:

# npxを使った課題のエクスポート
$ npx techblog_cms issue --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./issues
# npxを使ったデータの更新
$ npx techblog_cms update

課題のエクスポート

issueコマンドを使用すると、Backlog の課題を Markdown ファイルとしてエクスポートできます。

# 基本的な使用方法
$ techblog_cms issue --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY
# 出力先を指定
$ techblog_cms issue --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./issues
# Markdownファイル名を課題キーにする
$ techblog_cms issue --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --issueKeyFileName
# 課題キーでフォルダを作成する
$ techblog_cms issue --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --issueKeyFolder
# 課題キーでフォルダを作成し、Markdownファイル名も課題キーにする
$ techblog_cms issue --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --issueKeyFileName --issueKeyFolder

エクスポートされた課題は、指定したディレクトリ内に Markdown ファイルとして保存されます。ファイル名は課題のキーに基づいて自動的に生成されます。

カスタム属性の対応

課題のエクスポートでは、Backlogのカスタム属性も含めて出力されます:

対応している値の型

  • プリミティブ値: 文字列、数値などの単純な値
  • 配列値: 複数選択のカスタム属性(カンマ区切りで表示)
  • オブジェクト値: 単一選択のカスタム属性(name または value プロパティを使用)

表示形式

カスタム属性はMarkdownテーブル形式で表示され、改行やパイプ文字も適切に処理されます:

## カスタム属性
| 属性名 ||
| ------------------ | ------------------------------ |
| 工数(エンジニア) | 3 |
| 担当チーム | フロントエンド, バックエンド |
| 詳細 | 実装内容<br>- 機能A<br>- 機能B |

Wiki のエクスポート

wikiコマンドを使用すると、Backlog の Wiki ページを Markdown ファイルとしてエクスポートできます。

# 基本的な使用方法
$ techblog_cms wiki --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY
# 出力先を指定
$ techblog_cms wiki --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./wiki

エクスポートされた Wiki は、指定したディレクトリ内に Markdown ファイルとして保存されます。Wiki の階層構造は保持され、ディレクトリ構造として再現されます。

ドキュメント のエクスポート

documentコマンドを使用すると、Backlog のドキュメントページを Markdown ファイルとしてエクスポートできます。

# 基本的な使用方法
$ techblog_cms document --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY
# 出力先を指定
$ techblog_cms document --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./documents
# キーワード検索
$ techblog_cms document --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --keyword 仕様書

ドキュメントの出力方法

ドキュメントは ツリー構造を保持 してエクスポートされます:

ディレクトリ構造の保持

  • Backlogのドキュメントツリーの階層構造がそのままローカルディレクトリ構造として再現されます
  • フォルダはディレクトリとして作成され、ドキュメントはMarkdownファイルとして保存されます

出力例

documents/
├── プロジェクト概要/
│ ├── 要件定義書.md
│ └── 仕様書.md
├── 設計書/
│ ├── システム設計/
│ │ ├── アーキテクチャ設計.md
│ │ └── データベース設計.md
│ └── UI設計/
│ ├── 画面設計書.md
│ └── ワイヤーフレーム.md
└── 運用手順書.md

特徴

  • 階層構造の完全再現: Backlogのフォルダ階層がそのまま保持されます
  • 重複処理の防止: 同じドキュメントが複数回処理されることを防ぎます
  • ファイル名の自動サニタイズ: 不正な文字を自動的に除去して安全なファイル名を生成します
  • メタデータの保持: 作成者、更新者、タグ、添付ファイル情報なども含めて保存されます

エクスポートされたドキュメントは、指定したディレクトリ内にツリー構造を保持したMarkdownファイルとして保存されます。

課題・Wiki・ドキュメント の一括エクスポート

allコマンドを使用すると、課題・Wiki・ドキュメントを一度に取得できます。

# 基本的な使用方法
$ techblog_cms all --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY
# 出力先を指定
$ techblog_cms all --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./backlog-data
# 特定のデータタイプのみをエクスポート(onlyフラグ)
$ techblog_cms all --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --only issues,wiki
# 特定のデータタイプを除外してエクスポート(excludeフラグ)
$ techblog_cms all --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --exclude documents

一括エクスポートでは、課題はissuesディレクトリに、Wiki はwikiディレクトリに、ドキュメントはdocumentsディレクトリに保存されます。

エクスポート対象の制御

allコマンドでは、以下のフラグを使用してエクスポート対象を制御できます:

--only フラグ

特定のデータタイプのみをエクスポートします。カンマ区切りで複数指定可能です。

# 課題とWikiのみをエクスポート
$ techblog_cms all --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --only issues,wiki
# ドキュメントのみをエクスポート
$ techblog_cms all --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --only documents

--exclude フラグ

特定のデータタイプを除外してエクスポートします。カンマ区切りで複数指定可能です。

# ドキュメント以外(課題とWiki)をエクスポート
$ techblog_cms all --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --exclude documents
# 課題以外(WikiとDocuments)をエクスポート
$ techblog_cms all --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --exclude issues

注意: --only--excludeフラグは同時に使用できません。どちらか一方を使用してください。

データの更新

updateコマンドを使用すると、既存のエクスポートデータを最新の状態に更新できます。このコマンドは、ディレクトリ内のbacklog-settings.jsonファイルを探索し、見つかったディレクトリでデータを更新します。

# カレントディレクトリとそのサブディレクトリのデータを更新
$ techblog_cms update
# 指定したディレクトリとそのサブディレクトリのデータを更新
$ techblog_cms update ./my-project
# 確認プロンプトをスキップして更新
$ techblog_cms update --force
# 課題のみを更新
$ techblog_cms update --issuesOnly
# Wikiのみを更新
$ techblog_cms update --wikisOnly
# ドキュメントのみを更新
$ techblog_cms update --documentsOnly
# APIキーを指定して更新
$ techblog_cms update --apiKey YOUR_API_KEY

更新コマンドは、各ディレクトリの設定ファイルに基づいて、課題・Wiki・ドキュメントを自動的に更新します。設定ファイルが見つかったディレクトリでは、そのディレクトリ内のファイルが直接更新されます(サブフォルダは作成されません)。

コマンド

techblog_cms help [COMMAND]

Display help for techblog_cms.

USAGE
 $ techblog_cms 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 techblog_cms.

See code: @oclif/plugin-help

techblog_cms plugins

List installed plugins.

USAGE
 $ techblog_cms plugins [--json] [--core]
FLAGS
 --core Show core plugins.
GLOBAL FLAGS
 --json Format output as json.
DESCRIPTION
 List installed plugins.
EXAMPLES
 $ techblog_cms plugins

See code: @oclif/plugin-plugins

techblog_cms plugins add PLUGIN

Installs a plugin into techblog_cms.

USAGE
 $ techblog_cms 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 techblog_cms.
 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
 $ techblog_cms plugins add
EXAMPLES
 Install a plugin from npm registry.
 $ techblog_cms plugins add myplugin
 Install a plugin from a github url.
 $ techblog_cms plugins add https://github.com/someuser/someplugin
 Install a plugin from a github slug.
 $ techblog_cms plugins add someuser/someplugin

techblog_cms plugins:inspect PLUGIN...

Displays installation properties of a plugin.

USAGE
 $ techblog_cms 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
 $ techblog_cms plugins inspect myplugin

See code: @oclif/plugin-plugins

techblog_cms plugins install PLUGIN

Installs a plugin into techblog_cms.

USAGE
 $ techblog_cms 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 techblog_cms.
 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
 $ techblog_cms plugins add
EXAMPLES
 Install a plugin from npm registry.
 $ techblog_cms plugins install myplugin
 Install a plugin from a github url.
 $ techblog_cms plugins install https://github.com/someuser/someplugin
 Install a plugin from a github slug.
 $ techblog_cms plugins install someuser/someplugin

See code: @oclif/plugin-plugins

techblog_cms plugins link PATH

Links a plugin into the CLI for development.

USAGE
 $ techblog_cms 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
 $ techblog_cms plugins link myplugin

See code: @oclif/plugin-plugins

techblog_cms plugins remove [PLUGIN]

Removes a plugin from the CLI.

USAGE
 $ techblog_cms 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
 $ techblog_cms plugins unlink
 $ techblog_cms plugins remove
EXAMPLES
 $ techblog_cms plugins remove myplugin

techblog_cms plugins reset

Remove all user-installed and linked plugins.

USAGE
 $ techblog_cms 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

techblog_cms plugins uninstall [PLUGIN]

Removes a plugin from the CLI.

USAGE
 $ techblog_cms 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
 $ techblog_cms plugins unlink
 $ techblog_cms plugins remove
EXAMPLES
 $ techblog_cms plugins uninstall myplugin

See code: @oclif/plugin-plugins

techblog_cms plugins unlink [PLUGIN]

Removes a plugin from the CLI.

USAGE
 $ techblog_cms 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
 $ techblog_cms plugins unlink
 $ techblog_cms plugins remove
EXAMPLES
 $ techblog_cms plugins unlink myplugin

techblog_cms plugins update

Update installed plugins.

USAGE
 $ techblog_cms 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)
## カスタム属性
| 属性名 ||
| ------------------ | ------------------------------ |
| 工数(エンジニア) | 3 |
| 工数(PPO) | なし |
| 担当チーム | フロントエンド, バックエンド |
| 詳細 | 実装内容<br>- 機能A<br>- 機能B |
## 詳細
ここに課題の詳細説明が入ります。
## コメント
### コメント 1
- **投稿者**: 佐藤次郎
- **日時**: 2023年01月01日 11:15:30
コメントの内容がここに表示されます。
---
### コメント 2
- **投稿者**: 鈴木三郎
- **日時**: 2023年01月02日 09:45:12
返信コメントの内容がここに表示されます。

Wiki の出力形式

Wiki は以下の形式で Markdown ファイルとして保存されます:

# Wiki のタイトル
[Backlog Wiki Link](https://example.backlog.jp/alias/wiki/12345)
ここに Wiki の本文内容が入ります。
Backlog の書式がそのまま保持されます。

ドキュメント の出力形式

ドキュメントは以下の形式で Markdown ファイルとして保存されます:

# ドキュメントのタイトル
[Backlog Document Link](https://example.backlog.jp/document/DOC-ID)
**ステータス**: 1 🎉
**作成者**: 山田太郎
**作成日時**: 2023年01月01日 10:00:00
**更新者**: 佐藤次郎
**更新日時**: 2023年01月02日 15:30:45
## 内容
ここにドキュメントの本文内容が入ります。
Backlog の書式がそのまま保持されます。
## 添付ファイル
- **資料.pdf** (1024.5 KB) - 作成者: 山田太郎, 作成日時: 2023年01月01日 10:00:00
- **画像.png** (256.3 KB) - 作成者: 佐藤次郎, 作成日時: 2023年01月01日 10:30:00
## タグ
- 仕様書
- 設計書

その他の特徴

  • 環境変数サポート: 環境変数 BACKLOG_API_KEY を使用して API キーを設定可能
  • 自動ディレクトリ作成: 出力ディレクトリが存在しない場合は自動的に作成
  • 並列処理: 並列処理による高速なダウンロード
  • ファイル名サニタイズ: ファイル名の自動サニタイズ(不正な文字の除去)
  • 階層構造の保持: Wiki の階層構造を保持したエクスポート
  • キーワード検索: ドキュメントの検索キーワード対応
  • 差分更新: 前回の更新以降に変更されたデータのみを更新
  • カスタム属性対応: 課題のカスタム属性をテーブル形式で表示(配列・オブジェクト・プリミティブ値に対応)

開発への貢献

techblog_cmsはオープンソースプロジェクトです。バグ報告、機能提案、プルリクエストなど、あらゆる形での貢献を歓迎しています。

詳しくは CONTRIBUTING.md をご覧ください。

ライセンス

このプロジェクトはMIT Licenseの下で公開されています。

About

Inspector のコンポーネントのヘッダーにボタンを追加するエディタ拡張

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

Languages

AltStyle によって変換されたページ (->オリジナル) /