agentleFS
stackqlstackql/stackql-skills/skills/auth-setup/SKILL.md

auth-setup

Skill0 starsChanged 8 months agoMITView on GitHub

Configure authentication for StackQL providers. Walks through credential setup for Google, AWS, Azure, GitHub, and other providers. Generates the --auth JSON string and optionally persists it.

  • Reads credentials

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 8 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow these steps in order.

    line 15
  2. Very specific:

    If not found, delegate to /stackql-skills:install-stackql and then continue.

    line 23
  3. Very specific:

    If the provider is not installed, delegate to /stackql-skills:pull-provider <provider> and then continue.

    line 31
  4. Distinctive:

    Ask the user for the path to their service account JSON key file.

    line 49
  5. Distinctive:

    Check if credentials are available:

    line 80
  6. Distinctive:

    Run a simple query to verify auth works:

    line 145
  7. Distinctive:

    If this fails with an auth error, help troubleshoot:

    line 151
  8. Distinctive:

    Check credential file paths exist

    line 152
  9. Distinctive:

    Verify env vars are set

    line 153
  10. Distinctive:

    Ask the user if they want to persist the auth configuration.

    line 158
  11. Very specific:

    Create or update a .stackqlrc file:

    line 172

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

You are helping the user configure authentication for a StackQL provider.

Provider: $0

Follow these steps in order.

Step 1 - Check StackQL is installed

command -v stackql

If not found, delegate to /stackql-skills:install-stackql and then continue.

Step 2 - Check if the provider is pulled

stackql exec "SHOW PROVIDERS;" --output json

If the provider is not installed, delegate to /stackql-skills:pull-provider <provider> and then continue.

Step 3 - Determine auth method for the provider

Google (google)

Google supports two auth types:

Option A - Service account key file (non-interactive):

{
  "google": {
    "type": "service_account",
    "credentialsfilepath": "/path/to/sa-key.json"
  }
}

Ask the user for the path to their service account JSON key file.

Option B - Interactive (via gcloud):

{
  "google": {
    "type": "interactive"
  }
}

Requires gcloud auth login to have been run. Check:

command -v gcloud && gcloud auth list --filter=status:ACTIVE --format="value(account)" 2>/dev/null

AWS (awscc or aws)

AWS uses environment variables or credentials file:

{
  "aws": {
    "type": "aws_signing_v4",
    "credentialsenvvar": "AWS_SECRET_ACCESS_KEY",
    "keyIDenvvar": "AWS_ACCESS_KEY_ID"
  }
}

Check if credentials are available:

echo "${AWS_ACCESS_KEY_ID:+set}" "${AWS_SECRET_ACCESS_KEY:+set}"
test -f "$HOME/.aws/credentials" && echo "aws credentials file exists"

Azure (azure)

Azure supports service principal or interactive auth:

Option A - Service principal (env vars):

{
  "azure": {
    "type": "azure_default"
  }
}

Requires: AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET

Check:

echo "${AZURE_TENANT_ID:+set}" "${AZURE_CLIENT_ID:+set}" "${AZURE_CLIENT_SECRET:+set}"

Option B - Interactive (via az cli):

Requires az login to have been run. Check:

command -v az && az account show --output json 2>/dev/null

GitHub (github)

{
  "github": {
    "type": "basic",
    "credentialsenvvar": "GITHUB_TOKEN"
  }
}

Check:

echo "${GITHUB_TOKEN:+set}"

Other providers

For providers not listed above, check the provider docs:

I don't have specific auth instructions for <provider>. Check the provider documentation at https://<provider>.stackql.io/ or use /stackql-skills:stackql-docs <provider> authentication to search for auth setup guidance.

Step 4 - Build the auth JSON

Based on the user's chosen auth method and credentials, construct the --auth JSON string.

Step 5 - Test the connection

Run a simple query to verify auth works:

stackql exec "SHOW SERVICES IN <provider>;" --auth='<AUTH_JSON>' --output json

If this fails with an auth error, help troubleshoot:

  • Check credential file paths exist
  • Verify env vars are set
  • Suggest re-authenticating (gcloud auth login, az login, etc.)

Step 6 - Persist (optional)

Ask the user if they want to persist the auth configuration. Options:

Option A - Environment variable: Suggest adding to shell profile:

export STACKQL_AUTH='<AUTH_JSON>'

Then StackQL can be invoked as:

stackql exec "<SQL>" --auth="${STACKQL_AUTH}"

Option B - .stackqlrc file: Create or update a .stackqlrc file:

# .stackqlrc - StackQL configuration
AUTH='<AUTH_JSON>'

Note: Warn the user not to commit credential files or auth JSON containing secrets to version control.

Step 7 - Report

Confirm auth is working and suggest next steps:

Authentication for <provider> is configured. You can now:

  • Explore resources: /stackql-skills:explore <provider>
  • Run queries: /stackql-skills:query "SELECT ... FROM <provider>.<service>.<resource> WHERE ..."

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.