bigquery-auth
SolidGCPプロジェクト単位でBigQuery認証を設定するスキル。 gcloud設定プロファイルで複数プロジェクトを安全に分離管理。 「BigQueryに繋ぎたい」「BQ認証」「gcloud認証」「データ分析の認証設定」等のリクエストで発動。
API & Backend 347 stars
12 forks Updated 1 weeks ago
Install
Quality Score: 81/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
## トリガーワード
「BigQuery認証」「BQ繋ぎたい」「データ分析の認証」「gcloud認証」
# BigQuery Authentication (Project-based)
GCPプロジェクト単位でgcloud設定プロファイルを作成し、BigQuery認証を行うスキルです。
## Workflow
1. ユーザーが「BigQuery使いたい」「{プロジェクト}のデータを見たい」等と言う
2. **GCPプロジェクトIDを確認**(必須)
3. 既存の設定プロファイルを確認
4. 必要に応じて新規プロファイルを作成
5. ブラウザ認証をガイド
6. 接続テストを実行
## 認証手順
### Step 1: 設定プロファイル確認
```bash
gcloud config configurations list
```
既存プロファイルを表示し、目的のプロジェクト用があるか確認。
### Step 2: プロファイル作成(新規の場合)
```bash
# プロファイル作成
gcloud config configurations create {PROFILE_NAME}
# プロジェクト設定
gcloud config set project {PROJECT_ID}
```
### Step 3: gcloud認証
```bash
# メイン認証(ブラウザが開く)
gcloud auth login
# Python SDK用認証(ブラウザが開く)
gcloud auth application-default login --quiet
```
**注意**: 両方のコマンドでブラウザ認証が必要です。
### Step 4: 認証確認
```bash
# 現在のプロファイル確認
gcloud config configurations list
# プロジェクト確認
gcloud config get-value project
# ADCトークン確認
gcloud auth application-default print-access-token
```
### Step 5: BigQuery接続テスト
```python
import os
# 環境変数競合を回避
if "GOOGLE_APPLICATION_CREDENTIALS" in os.environ:
del os.environ["GOOGLE_APPLICATION_CREDENTIALS"]
from google.cloud import bigquery
client = bigquery.Client(project="{PROJECT_ID}")
datasets = list(client.list_datasets())
print(f"接続成功!{len(datasets)}個のデータセット")
```
## プロファイル切り替え
```bash
# プロファイル一覧
gcloud config configurations list
# 切り替え
gcloud config configurations activate {PROFILE_NAME}
```
## 登録済みプロファイル(テンプレート)
### ADC認証(gcloud login)
| プロファイル | プロジェクトID | アカウント | 用途 |
|-------------|-------------...
Details
- Author
- minicoohei
- Repository
- minicoohei/ai-agent-camp
- Created
- 5 months ago
- Last Updated
- 1 weeks ago
- Language
- Python
- License
- None
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
DevOps & Infrastructure Listed
gcp-auth
Google Cloud Platform (GCP) の Application Default Credentials 認証を実行するスキル。 「GCP認証して」「Google Cloud認証」「gcloud login」等のリクエストで発動。 BigQuery や Cloud Storage 等の GCP サービス利用前の認証手順をガイド。
347 Updated 1 weeks ago
minicoohei AI & Automation Listed
setup
Walk the user through installing and authenticating the Google Cloud SDK / bq CLI so an agent can query BigQuery safely under bq-guard. Use when the user asks to set up BigQuery access, install gcloud/bq, or troubleshoot why bq-guard isn't intercepting bq calls.
0 Updated 1 months ago
cooper-tretter AI & Automation Listed
gcloud
Google Cloud CLI 操作
1 Updated yesterday
ryukyagamilight