claude-skills/

Anthropic公式スキル・プラグインの日本語ディレクトリ

last sync 22h ago
スキルOfficialdevelopment

🔐output-credentials-init

プラグイン
outputai

説明

Output.ai プロジェクトの暗号化された認証情報を初期化します。 次のような場合に使用: - 認証情報を初めてセットアップするとき - 環境固有の認証情報を追加するとき - ワークフローごとの認証情報を追加するとき

原文を表示

Initialize encrypted credentials for an Output.ai project. Use when setting up credentials for the first time, adding environment-specific credentials, or adding per-workflow credentials.

ユースケース

  • 認証情報を初めてセットアップするとき
  • 環境固有の認証情報を追加するとき
  • ワークフローごとの認証情報を追加するとき

本文(日本語訳)

クレデンシャルの初期化

次のような場合に使用

  • プロジェクトに対してクレデンシャルを初めてセットアップする場合
  • 本番環境・ステージング環境に固有のクレデンシャルを追加する場合
  • グローバル設定を上書きする、ワークフロー単位のクレデンシャルを追加する場合
  • キーファイルを紛失した後にクレデンシャルを再初期化する場合

概要

npx output credentials init コマンドを実行すると、以下の2つのファイルが生成されます。

  • キーファイル.key) — 復号化に使用するシークレット。絶対にコミットしないでください。
  • 暗号化された YAML ファイル.yml.enc) — クレデンシャルのストア。コミットしても安全です。

コマンド

# グローバルクレデンシャル(最も一般的)
npx output credentials init

# 環境固有
npx output credentials init -e production
npx output credentials init -e staging

# ワークフロー単位のクレデンシャル(該当ワークフローに対してグローバル設定を上書き)
npx output credentials init -w my_workflow

# 既存ファイルを強制的に上書き
npx output credentials init --force

作成されるファイル

グローバル(デフォルト)

config/
├── credentials.key        ← .gitignore に追加すること
└── credentials.yml.enc    ← コミットしても安全

環境固有

config/credentials/
├── production.key         ← .gitignore に追加すること
└── production.yml.enc     ← コミットしても安全

ワークフロー単位

src/workflows/{name}/
├── credentials.key        ← .gitignore に追加すること
└── credentials.yml.enc    ← コミットしても安全

デフォルトテンプレート

初期化後、暗号化された YAML には以下のテンプレートが含まれます。

anthropic:
  api_key: ""
openai:
  api_key: ""
_env:
  ANTHROPIC_API_KEY: anthropic.api_key
  OPENAI_API_KEY: openai.api_key

_env セクションは、ワーカー起動時にクレデンシャルを環境変数へ自動的に紐付けます。 詳細は output-credentials-env-vars を参照してください。

初期化後: シークレットの追加

npx output credentials edit          # 復号化された YAML を $EDITOR で開く

空の値を入力し、保存してエディタを閉じてください。ファイルは自動的に再暗号化されます。

.gitignore の設定

echo "*.key" >> .gitignore
echo "config/credentials.key" >> .gitignore

または、.gitignore に以下を追記してください。

# クレデンシャルの復号化キー — 絶対にコミットしないこと
*.key
config/credentials.key
config/credentials/*.key
src/workflows/*/credentials.key

CI/CD: キーの配布

CI/CD パイプラインでは、ファイルをコミットする代わりに、キーを環境変数として渡してください。

# CI/CD 環境で設定する
OUTPUT_CREDENTIALS_KEY=<key-value>

# 環境固有
OUTPUT_CREDENTIALS_KEY_PRODUCTION=<key-value>

# ワークフロー単位
OUTPUT_CREDENTIALS_KEY_MY_WORKFLOW=<key-value>

キーの値は .key ファイルの内容です。

確認チェックリスト

  • [ ] config/credentials.key が作成されている(または環境固有のバリアント)
  • [ ] config/credentials.yml.enc が作成されている
  • [ ] .key ファイルが .gitignore に追加されている
  • [ ] npx output credentials edit を実行してシークレットの値を入力済みである
  • [ ] npx output credentials show で復号化が正常に動作することを確認済みである

関連スキル

  • output-credentials-edit — クレデンシャルの値の入力と管理
  • output-credentials-env-vars — クレデンシャルを環境変数へ紐付ける
  • output-dev-credentials — クレデンシャルシステム全体のリファレンス
原文(English)を表示

Initializing Credentials

When to Use This Skill

  • First time setting up credentials for a project
  • Adding production/staging environment-specific credentials
  • Adding per-workflow credentials that override global ones
  • Re-initializing credentials after losing a key file

Overview

The npx output credentials init command generates two files:

  • A key file (.key) — the decryption secret. Never commit this.
  • An encrypted YAML file (.yml.enc) — the credentials store. Safe to commit.

Commands

# Global credentials (most common)
npx output credentials init

# Environment-specific
npx output credentials init -e production
npx output credentials init -e staging

# Per-workflow credentials (overrides globals for that workflow)
npx output credentials init -w my_workflow

# Force overwrite existing files
npx output credentials init --force

What Gets Created

Global (default)

config/
├── credentials.key        ← Add to .gitignore
└── credentials.yml.enc    ← Safe to commit

Environment-specific

config/credentials/
├── production.key         ← Add to .gitignore
└── production.yml.enc     ← Safe to commit

Per-workflow

src/workflows/{name}/
├── credentials.key        ← Add to .gitignore
└── credentials.yml.enc    ← Safe to commit

Default Template

After init, the encrypted YAML contains this template:

anthropic:
  api_key: ""
openai:
  api_key: ""
_env:
  ANTHROPIC_API_KEY: anthropic.api_key
  OPENAI_API_KEY: openai.api_key

The _env section wires credentials to environment variables automatically at worker startup. See output-credentials-env-vars for details.

After Init: Add Your Secrets

npx output credentials edit          # Opens $EDITOR with decrypted YAML

Fill in the empty values, save, and close. The file is re-encrypted automatically.

Gitignore Setup

echo "*.key" >> .gitignore
echo "config/credentials.key" >> .gitignore

Or add to your .gitignore:

# Credentials decryption keys — never commit
*.key
config/credentials.key
config/credentials/*.key
src/workflows/*/credentials.key

CI/CD: Key Distribution

In CI/CD pipelines, pass the key as an environment variable instead of committing the file:

# Set in your CI/CD environment
OUTPUT_CREDENTIALS_KEY=<key-value>

# Environment-specific
OUTPUT_CREDENTIALS_KEY_PRODUCTION=<key-value>

# Per-workflow
OUTPUT_CREDENTIALS_KEY_MY_WORKFLOW=<key-value>

The key value is the contents of the .key file.

Verification Checklist

  • [ ] config/credentials.key created (or env-specific variant)
  • [ ] config/credentials.yml.enc created
  • [ ] .key files added to .gitignore
  • [ ] npx output credentials edit run to fill in secret values
  • [ ] npx output credentials show verifies decryption works

Related Skills

  • output-credentials-edit — Fill in and manage credential values
  • output-credentials-env-vars — Wire credentials to environment variables
  • output-dev-credentials — Full credentials system reference

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。