Signal Foundry
ドキュメント
サポート 戻る
ドキュメントユースケースAPI リファレンスリリースノート

概要

Agent が迷わず使える順に整理しています。

はじめに
Claude Code / Codex で始めるドキュメントマップsf CLI をインストールデータ・API・CLIの現況クイックスタートCLI 接続設定会社IDの見方初日の進め方Data Provenance
認証請求認証設定利用プランCLI
CLI 概要CLI 認証基本コマンド会社検索観測データ検索会社・観測・開示開示の表示・比較リスト・調査・クレジットヘルプとエラーコマンドとフラグCLI 更新
APIキーのライフサイクル利用量の計測提供中の機能
会社検索とプロフィール観測データ検索チームワークスペース会社の観測データ開示と比較APIキー管理UIリストワークスペース外部調査とクレジットSkills / CLI / API
Credit Schedule利用状況の見方APIキー認証アカウントスコープは通常不要レート制限とエラートラブルシュート
会社が見つからないとき認証・接続・制限エラー低ヒット検索の見直し方プレビューURLの注意credit と maxCredits の失敗estimate と materialize の失敗
CLI

Help と Error Handling

`--help`、構造化 error、exit code、復旧コマンドの読み方をまとめます。

このページの内容7項目
Help の読み方Error envelopeExit codeよくある復旧Idempotencyやってはいけないこと次に読むページ

Claude Code / Codex で sf を使うときは、失敗を prose で推測せず、CLI が返す構造化 error を次の行動に使います。

Help の読み方

sf --help
sf list --help
sf list materialize --help
sf source resolve --help
sf observations search --help

help では次を確認します。

  • Usage: 必須 argument と option
  • Examples: --json 付きの実行例
  • Next: 次に打つ command 候補

agent は、help を読んだあとも保存や credit 消費を伴う実行には --execute --max-credits <n> を付けます。

Error envelope

usage error の例です。

{
  "ok": false,
  "error": {
    "code": "usage_error",
    "exit_code": 2,
    "hint": "先に `sf companies search <query> --json` で company_id を解決してください。",
    "message": "companyId is required",
    "retryable": false,
    "suggested_next_commands": [
      "sf companies search <query> --json",
      "sf company profile jpx_7203 --json"
    ],
    "type": "usage_error"
  }
}

network error の例です。

{
  "ok": false,
  "error": {
    "code": "network_error",
    "exit_code": 3,
    "hint": "接続先を確認してください。",
    "message": "接続できませんでした。",
    "retryable": true,
    "suggested_next_commands": [
      "sf auth show --json",
      "sf auth setup --base-url https://signal-foundry.app"
    ],
    "type": "network_error"
  }
}

まず見る key:

  • ok
  • error.code
  • error.exit_code
  • error.hint
  • error.retryable
  • error.suggested_next_commands[]

error.suggested_next_commands[0] は次の候補です。ただし、候補が materialize / enrich / source resolve / source select のような credit 消費 command なら、対象と --max-credits を確認してから実行します。

Exit code

Exit codeMeaning最初に見るもの
2usage errorsf <surface> --help
3network errorsf auth show --json
4auth errorAPI key と base URL
5not foundID 解決 command
6rate limitRetry-After と待機
7remote/server errorerror.hint と再試行可否

よくある復旧

Error次に打つ commandNotes
usage_errorsf <surface> --help必須 option を確認
auth_errorsf auth show --jsoneffectiveBaseUrl と key preview を確認
company_not_foundsf companies search <query> --jsonfree text を profile / filings に渡さない
estimate_not_foundsf list estimate "<query>" --jsonestimate を作り直す
max_credits_requiredsf list materialize --from-estimate <estimateId> --execute --max-credits <n> --json上限なし実行をしない
max_credits_exceededsf credits balance --json上限を上げるか query を絞る
credit_balance_insufficientsf credits balance --jsongrant の残高を確認
preview_export_not_allowedsf list materialize --from-estimate <estimateId> --execute --max-credits <n> --jsonsaved List にしてから export
multiple_candidatessf source review <sourceId> --status multiple_candidates --jsonagent が自動確定しない

Idempotency

保存や課金を伴う HTTP write は idempotency key を使います。CLI で同じ操作を再実行する場合も、error が retryable: true か、API 側の suggested_next_commands が再試行を指示しているかを見ます。

再試行の例:

sf list materialize --from-estimate <estimateId> --execute --max-credits 100 --idempotency-key <same-key> --json

同じ row/company を source select する場合は、二重消費を避けるために同じ意図の再試行として扱います。

やってはいけないこと

  • unsupported / needs_human を 0 件成功にする
  • list candidates の preview を export しようとする
  • --execute だけで credit 消費 command を走らせる
  • multiple_candidates を agent が確定する
  • API key や顧客秘密情報を feedback に入れる

次に読むページ

  • 最小実行順: Essential Commands
  • List 系の失敗: credit と maxCredits の失敗
  • estimate / materialize の失敗: estimate と materialize の失敗

このページの内容

Help の読み方Error envelopeExit codeよくある復旧Idempotencyやってはいけないこと次に読むページ