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.
次のような場合に使用:
$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 で開かれます。
保存後に再暗号化され、エディタを閉じた後は一時ファイルがセキュアに消去(ヌルバイトで上書き)されます。
# グローバルクレデンシャルを表示(平文 — 取り扱い注意)
npx output credentials show
# 環境別に表示
npx output credentials show -e production
# ワークフロー別に表示
npx output credentials show -w my_workflow
# ドット記法のパスで単一のクレデンシャルを取得
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として保存され、ドット記法でアクセスできます:
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 — クレデンシャルシステム全体のリファレンス$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 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 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).
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.
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');
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"
| 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 |
npx output credentials show prints expected valuesnpx output credentials get anthropic.api_key returns the correct keyoutput-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 による自動翻訳です。