🔐output-credentials-edit
- プラグイン
- outputai
- ソース
- GitHub で見る ↗
説明
Output.aiプロジェクト内の暗号化されたクレデンシャルを表示・編集します。 次のような場合に使用: シークレットの追加、APIキーの更新、クレデンシャル値の確認、または特定のクレデンシャルの取得を行うとき。
原文を表示
View and edit encrypted credentials in an Output.ai project. Use when adding secrets, updating API keys, verifying credential values, or retrieving a specific credential.
ユースケース
- ✓シークレットを追加するとき
- ✓APIキーを更新するとき
- ✓クレデンシャル値を確認するとき
- ✓特定のクレデンシャルを取得するとき
本文(日本語訳)
クレデンシャルの表示と編集
このスキルの使用場面
次のような場合に使用:
- APIキーやシークレットの追加・更新
- 現在保存されているクレデンシャルの確認
- 特定のクレデンシャル値の取得
- コード内で参照する前のクレデンシャル構造の確認
コマンド
Edit($EDITOR を開く)
# グローバルクレデンシャルを編集
npx output credentials edit
# 環境別に編集
npx output credentials edit -e production
npx output credentials edit -e staging
# ワークフロー別に編集
npx output credentials edit -w my_workflow
ファイルは一時ファイルに復号化され、$EDITOR で開かれます。
保存後に再暗号化され、エディタを閉じた後は一時ファイルがセキュアに消去(ヌルバイトで上書き)されます。
Show(標準出力へ表示)
# グローバルクレデンシャルを表示(平文 — 取り扱い注意)
npx output credentials show
# 環境別に表示
npx output credentials show -e production
# ワークフロー別に表示
npx output credentials show -w my_workflow
Get(単一の値を取得)
# ドット記法のパスで単一のクレデンシャルを取得
npx output credentials get anthropic.api_key
npx output credentials get aws.region
npx output credentials get stripe.secret_key -w payment_processing
生の文字列値(ネストされたオブジェクトの場合はJSON)を返します。
YAMLフォーマット
クレデンシャルは構造化されたYAMLとして保存され、ドット記法でアクセスできます:
anthropic:
api_key: sk-ant-...
openai:
api_key: sk-...
aws:
region: us-east-1
access_key_id: AKIA...
secret_access_key: ...
stripe:
secret_key: sk_live_...
webhook_secret: whsec_...
_env:
ANTHROPIC_API_KEY: anthropic.api_key
OPENAI_API_KEY: openai.api_key
_env セクションは、クレデンシャルのパスを環境変数にマッピングします。
詳細は output-credentials-env-vars を参照してください。
コード内でのクレデンシャルへのアクセス
import { credentials } from '@outputai/credentials';
// 安全な読み取り — 見つからない場合は undefined を返す
const region = credentials.get('aws.region');
// デフォルト値付きの読み取り
const region = credentials.get('aws.region', 'us-east-1');
// 厳格な読み取り — 見つからない場合は MissingCredentialError をスロー
const apiKey = credentials.require('anthropic.api_key');
クレデンシャルのマージ
ワークフロー別クレデンシャルは、実行時にグローバルクレデンシャルへディープマージされます。 ワークフロー側の値が優先されます:
# グローバル: anthropic.api_key = "sk-ant-global"
# ワークフロー: anthropic.api_key = "sk-ant-workflow"
# 実行時の結果: credentials.get('anthropic.api_key') → "sk-ant-workflow"
トラブルシューティング
| エラー | 原因 | 対処法 |
|---|---|---|
MissingKeyError |
キーファイルが見つからず、環境変数も未設定 | output credentials init を実行するか、OUTPUT_CREDENTIALS_KEY を設定する |
MissingCredentialError |
クレデンシャル内にパスが見つからない | npx output credentials edit を実行して値を追加する |
aes/gcm: invalid ghash tag |
キーが暗号化ファイルと一致しない | キーと .yml.enc が同期していない — 再初期化するか正しいキーを使用する |
確認チェックリスト
- [ ]
npx output credentials showで期待する値が表示される - [ ]
npx output credentials get anthropic.api_keyで正しいキーが返される - [ ] 必須シークレットに空文字列の値が残っていない
- [ ] ワークフロー別クレデンシャルがグローバルと正しくマージされている
関連スキル
output-credentials-init— クレデンシャルファイルを初めて作成するoutput-credentials-env-vars— クレデンシャルを環境変数へ自動的にマッピングするoutput-dev-credentials— クレデンシャルシステム全体のリファレンス
原文(English)を表示
Viewing and Editing Credentials
When to Use This Skill
- Adding or updating API keys and secrets
- Verifying what credentials are currently stored
- Retrieving a specific credential value
- Checking credential structure before referencing in code
Commands
Edit (Opens $EDITOR)
# Edit global credentials
npx output credentials edit
# Edit environment-specific
npx output credentials edit -e production
npx output credentials edit -e staging
# Edit per-workflow credentials
npx output credentials edit -w my_workflow
The file is decrypted to a temp file, opened in $EDITOR, then re-encrypted on save. The temp file is securely wiped (overwritten with null bytes) after closing.
Show (Print to stdout)
# Show global credentials (plaintext — use carefully)
npx output credentials show
# Show environment-specific
npx output credentials show -e production
# Show per-workflow
npx output credentials show -w my_workflow
Get (Single value)
# Get a single credential by dot-notation path
npx output credentials get anthropic.api_key
npx output credentials get aws.region
npx output credentials get stripe.secret_key -w payment_processing
Returns the raw string value (or JSON for nested objects).
YAML Format
Credentials are stored as structured YAML with dot-notation access:
anthropic:
api_key: sk-ant-...
openai:
api_key: sk-...
aws:
region: us-east-1
access_key_id: AKIA...
secret_access_key: ...
stripe:
secret_key: sk_live_...
webhook_secret: whsec_...
_env:
ANTHROPIC_API_KEY: anthropic.api_key
OPENAI_API_KEY: openai.api_key
The _env section maps credential paths to environment variables. See output-credentials-env-vars.
Accessing Credentials in Code
import { credentials } from '@outputai/credentials';
// Safe read — returns undefined if not found
const region = credentials.get('aws.region');
// Read with default
const region = credentials.get('aws.region', 'us-east-1');
// Strict read — throws MissingCredentialError if not found
const apiKey = credentials.require('anthropic.api_key');
Credential Merging
Per-workflow credentials deep-merge over global credentials at runtime. Workflow values take precedence:
# Global: anthropic.api_key = "sk-ant-global"
# Workflow: anthropic.api_key = "sk-ant-workflow"
# Runtime result: credentials.get('anthropic.api_key') → "sk-ant-workflow"
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
MissingKeyError |
Key file not found and env var not set | Run output credentials init or set OUTPUT_CREDENTIALS_KEY |
MissingCredentialError |
Path not found in credentials | Run npx output credentials edit and add the value |
aes/gcm: invalid ghash tag |
Key doesn't match encrypted file | Key and .yml.enc are out of sync — re-init or use correct key |
Verification Checklist
- [ ]
npx output credentials showprints expected values - [ ]
npx output credentials get anthropic.api_keyreturns the correct key - [ ] No empty string values remain for required secrets
- [ ] Per-workflow credentials merge correctly with global
Related Skills
output-credentials-init— Create credentials files for the first timeoutput-credentials-env-vars— Automatically wire credentials to env varsoutput-dev-credentials— Full credentials system reference
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。