Skip to main content

Tag Factory CLI

Tag Factoryのコマンドラインインターフェースツール

インストール

開発モードでインストール:

# プロジェクトディレクトリ内で
pip install -e cli/

使い方

基本的なコマンド

バージョン確認:

tag-factory --version

ヘルプの表示:

tag-factory --help

ワークスペース関連コマンド

ワークスペース一覧の表示:

tag-factory workspaces list

特定のワークスペースの詳細表示:

tag-factory workspaces get WORKSPACE_ID

現在のワークスペースを設定:

tag-factory use WORKSPACE_ID

タグ関連コマンド

ワークスペース内のタグ一覧表示:

# 現在のワークスペースのタグ一覧(useコマンドで設定したワークスペース)
tag-factory tags list

# 特定のワークスペースのタグ一覧
tag-factory tags list --workspace WORKSPACE_ID

ハッシュタグ関連コマンド

ワークスペース内のハッシュタグ一覧表示:

# 現在のワークスペースのハッシュタグ一覧
tag-factory hashtags list

# 特定のワークスペースのハッシュタグ一覧
tag-factory hashtags list --workspace WORKSPACE_ID

データセット関連コマンド

ワークスペース内のデータセット一覧表示:

# 現在のワークスペースのデータセット一覧
tag-factory datasets list

# 特定のワークスペースのデータセット一覧
tag-factory datasets list --workspace WORKSPACE_ID

データセットのエクスポート:

# データセットをエクスポート
tag-factory datasets export DATASET_ID

# 出力先ディレクトリとタグファイルの拡張子を指定してエクスポート
tag-factory datasets export DATASET_ID --dest_dir /path/to/directory --tag_extension txt

エクスポートコマンドは、データセット内のすべての画像とそれに関連するタグをエクスポートします。 各画像に対して、以下の2つのファイルが作成されます:

  • 画像ファイル:{filename}.{extension}
  • タグファイル:{filename}.{tag_extension}(タグはカンマ区切りで1行に記述されます)

オプション:

  • --dest_dir:エクスポート先ディレクトリ(デフォルト:カレントディレクトリ)
  • --tag_extension:タグファイルの拡張子(デフォルト:txt)

設定

環境変数

環境変数を使用して設定します:

  • TAG_FACTORY_API_KEY: API認証キー(必須)
  • TAG_FACTORY_API_URL: API URL(オプション、デフォルトは http://localhost:3000/api/cli)

例:

# APIキーの設定
export TAG_FACTORY_API_KEY="your-api-key"

# カスタムAPIエンドポイントの設定(オプション)
export TAG_FACTORY_API_URL="https://your-api-url.com/api/cli"

設定ファイル

CLIツールは ~/.tag-factory/config.json に設定情報を保存します。 特に「現在のワークスペース」の情報はこのファイルに保存され、各コマンドで --workspace オプションを省略した場合に使用されます。

開発

開発環境のセットアップ:

# 依存関係のインストール
pip install -e cli/

PyPIへのパブリッシュ

このCLIツールは、「tag-factory」という名前でPyPIに公開することができます。 パブリッシュするには、同梱の publish.sh スクリプトを使用してください:

cd cli
./publish.sh

このスクリプトは以下の処理を行います:

  1. パッケージをビルド
  2. オプションでTest PyPIにアップロード(テスト用)
  3. 本番PyPIにアップロード

PyPIにパブリッシュするには、以下のいずれかの方法で認証情報を提供する必要があります:

  • 環境変数 PYPI_API_TOKEN の設定(推奨)
  • パブリッシュ時に対話的にAPIトークンを入力
  • ~/.pypirc ファイルの設定(APIトークンを使用)

PyPI APIトークンの取得方法

PyPIは現在ユーザー名/パスワード認証をサポートしていないため、APIトークンが必要です:

  1. PyPI にログイン
  2. アカウントメニュー -> アカウント設定 -> APIトークン
  3. 「APIトークンを追加」をクリック
  4. スコープを「プロジェクト: tag-factory」に設定し、トークンを作成
  5. 生成されたトークンを安全に保存(表示は1回のみ)

APIトークンを環境変数として設定:

export PYPI_API_TOKEN="pypi-AgEI..."

インストール

パブリッシュ後は、以下のコマンドでインストールできます:

pip install tag-factory

ライセンス

このCLIツールはTag Factoryの一部であり、商用ソフトウェアです。すべての権利が保有者に帰属し、無許可での使用、複製、配布は禁止されています。

Metadata

Release files for tag-factory 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tag-factory 0.1.1
File Size Uploaded Provenance
tag_factory-0.1.1.tar.gz 8.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tag-factory 0.1.1
File Interpreter ABI Platform
tag_factory-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.1 kB

Release files / tag_factory-0.1.1.tar.gz

Download URL tag_factory-0.1.1.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6302a6edc5f4f026e092c593f9a4a109f237a7ee958023acce2b06a524f1fa36
BLAKE2b-256 checksum
How to use checksums
1fd1729c6b5d019a42aee810509c2287e688a72d400dc564b60503d927295b01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.7

Release files / tag_factory-0.1.1-py3-none-any.whl

Download URL tag_factory-0.1.1-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ffeed0b657dce4eb655d2c33ac3ad1cc73ae96e0a34d5c024d9c3e1e64ded5c
BLAKE2b-256 checksum
How to use checksums
187a9795cc9189a51bed49f08283902bb6a360261e41616dcae8ddb904abaae9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.7

Security for tag-factory 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page