Skip to content

Open-source SEO, GEO, and marketing skills for AI agents.

fix(seo): resolve gcloud ADC config dir per platform (#120)

Deepanshu Pal68566c06e461
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
index ce037e8d..ec93a27e 100644
--- a/.claude-plugin/marketplace.json
+++ b/.claude-plugin/marketplace.json
@@ -5,14 +5,14 @@
},
"metadata": {
"description": "The official ads, analytics, SEO, and GEO plugin from NotFair.",
- "version": "0.27.9"
+ "version": "0.27.10"
},
"plugins": [
{
"name": "notfair",
"source": "./",
"description": "Operate Google, Meta, X, LinkedIn, Reddit, and TikTok Ads; WordPress and GoHighLevel; analyze Search Console and GA4; and run open-source SEO, GEO, and content workflows.",
- "version": "0.27.9",
+ "version": "0.27.10",
"author": {
"name": "NotFair",
"url": "https://notfair.co"
diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json
index a3844878..4791a444 100644
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "notfair",
- "version": "0.27.9",
+ "version": "0.27.10",
"description": "The official ads, analytics, SEO, and GEO plugin from NotFair. Operate Google, Meta, X, LinkedIn, Reddit, and TikTok Ads; WordPress and GoHighLevel; analyze Google Search Console and GA4; and run open-source search and content workflows from any compatible agent.",
"author": {
"name": "NotFair",
diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json
index dae7cfc3..3c70b304 100644
--- a/.codex-plugin/plugin.json
+++ b/.codex-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "notfair",
- "version": "0.27.9",
+ "version": "0.27.10",
"description": "The official ads, analytics, SEO, and GEO plugin from NotFair.",
"author": {
"name": "NotFair",
diff --git a/.cursor-plugin/plugin.json b/.cursor-plugin/plugin.json
index 9e90a3cb..a37619df 100644
--- a/.cursor-plugin/plugin.json
+++ b/.cursor-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "notfair",
"displayName": "NotFair",
- "version": "0.27.9",
+ "version": "0.27.10",
"description": "One NotFair OAuth MCP for Google, Meta, X, LinkedIn, Reddit, and TikTok Ads, GA4, Search Console, GoHighLevel, and WordPress, plus open-source SEO, GEO, and content skills.",
"author": {
"name": "Notfair",
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 50077048..5b680da0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,12 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
+## [0.27.10] — 2026-09-21
+
+### Fixed
+
+- GSC scripts now resolve the gcloud config directory per platform, so the Application Default Credentials quota project is found on Windows (`%APPDATA%\gcloud`) as well as POSIX (`~/.config/gcloud`); `CLOUDSDK_CONFIG` still takes precedence. Fixes Search Console calls failing with 403 "requires a quota project" on Windows.
+
## [0.27.9] — 2026-09-19
### Changed
diff --git a/VERSION b/VERSION
index 334fe890..f49ede62 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.27.9
+0.27.10
diff --git a/gemini-extension.json b/gemini-extension.json
index bdbe26b8..542f378b 100644
--- a/gemini-extension.json
+++ b/gemini-extension.json
@@ -1,6 +1,6 @@
{
"name": "notfair",
- "version": "0.27.9",
+ "version": "0.27.10",
"description": "Operate ads and analytics, and run open-source SEO, GEO, and content workflows with NotFair.",
"contextFileName": "AGENTS.md",
"mcpServers": {
diff --git a/plugin.json b/plugin.json
index 05848d6d..3adbd453 100644
--- a/plugin.json
+++ b/plugin.json
@@ -1,7 +1,7 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "notfair",
- "version": "0.27.9",
+ "version": "0.27.10",
"description": "Operate Google, Meta, X, LinkedIn, Reddit, and TikTok Ads plus GA4, Search Console, GoHighLevel, and WordPress through one OAuth MCP, and run open-source SEO, GEO, and content workflows.",
"author": {
"name": "NotFair",
diff --git a/seo/seo-analysis/scripts/_gcloud.py b/seo/seo-analysis/scripts/_gcloud.py
index 4e4f1258..c89bd9c7 100644
--- a/seo/seo-analysis/scripts/_gcloud.py
+++ b/seo/seo-analysis/scripts/_gcloud.py
@@ -1,5 +1,6 @@
"""Helpers for invoking the gcloud CLI portably."""
+import os
import shutil
import subprocess
import sys
@@ -59,3 +60,18 @@ def adc_access_token(scopes=GSC_SCOPES, timeout=15):
if result.returncode == 0 and result.stdout.strip():
return result
return result
+
+
+def adc_config_dir():
+ """Return the gcloud config directory that holds the ADC file.
+
+ CLOUDSDK_CONFIG wins when set. Otherwise gcloud writes its config to
+ %APPDATA%\\gcloud on Windows and ~/.config/gcloud everywhere else.
+ """
+ if os.environ.get("CLOUDSDK_CONFIG"):
+ return os.environ["CLOUDSDK_CONFIG"]
+ if sys.platform == "win32":
+ appdata = os.environ.get("APPDATA")
+ if appdata:
+ return os.path.join(appdata, "gcloud")
+ return os.path.join(os.path.expanduser("~"), ".config", "gcloud")
diff --git a/seo/seo-analysis/scripts/analyze_gsc.py b/seo/seo-analysis/scripts/analyze_gsc.py
index 716d2c5b..f2ceaf64 100644
--- a/seo/seo-analysis/scripts/analyze_gsc.py
+++ b/seo/seo-analysis/scripts/analyze_gsc.py
@@ -21,7 +21,7 @@ import urllib.error
from concurrent.futures import ThreadPoolExecutor, as_completed
from datetime import date, timedelta
-from _gcloud import adc_access_token, gcloud_run
+from _gcloud import adc_access_token, adc_config_dir, gcloud_run
from _uid import portable_uid, secure_write_json
@@ -41,9 +41,7 @@ DEFAULT_PAGE_GROUPS = [
def get_quota_project():
"""Return the quota_project_id from the ADC JSON file, or None."""
- adc_dir = os.environ.get("CLOUDSDK_CONFIG") or os.path.join(
- os.path.expanduser("~"), ".config", "gcloud"
- )
+ adc_dir = adc_config_dir()
adc_path = os.path.join(adc_dir, "application_default_credentials.json")
try:
with open(adc_path) as f:
diff --git a/seo/seo-analysis/scripts/list_gsc_sites.py b/seo/seo-analysis/scripts/list_gsc_sites.py
index 682c3f31..ecadf2fd 100644
--- a/seo/seo-analysis/scripts/list_gsc_sites.py
+++ b/seo/seo-analysis/scripts/list_gsc_sites.py
@@ -9,15 +9,13 @@ import tempfile
import urllib.request
import urllib.error
-from _gcloud import adc_access_token, gcloud_run
+from _gcloud import adc_access_token, adc_config_dir, gcloud_run
from _uid import portable_uid, secure_write_json
def get_quota_project():
"""Return the quota_project_id from the ADC JSON file, or None."""
- adc_dir = os.environ.get("CLOUDSDK_CONFIG") or os.path.join(
- os.path.expanduser("~"), ".config", "gcloud"
- )
+ adc_dir = adc_config_dir()
adc_path = os.path.join(adc_dir, "application_default_credentials.json")
try:
with open(adc_path) as f:
diff --git a/seo/seo-analysis/scripts/preflight.py b/seo/seo-analysis/scripts/preflight.py
index d90ec207..7d1c7fa2 100644
--- a/seo/seo-analysis/scripts/preflight.py
+++ b/seo/seo-analysis/scripts/preflight.py
@@ -18,7 +18,7 @@ import subprocess
import sys
import urllib.request
-from _gcloud import adc_access_token, gcloud_run
+from _gcloud import adc_access_token, adc_config_dir, gcloud_run
def check_python_version():
@@ -249,9 +249,7 @@ def check_adc_credentials():
def _get_adc_quota_project():
"""Return the quota_project_id from the ADC JSON file, or None if absent."""
- adc_dir = os.environ.get("CLOUDSDK_CONFIG") or os.path.join(
- os.path.expanduser("~"), ".config", "gcloud"
- )
+ adc_dir = adc_config_dir()
adc_path = os.path.join(adc_dir, "application_default_credentials.json")
if not os.path.isfile(adc_path):
return None
diff --git a/seo/seo-analysis/scripts/url_inspection.py b/seo/seo-analysis/scripts/url_inspection.py
index b124df6c..7be9da33 100644
--- a/seo/seo-analysis/scripts/url_inspection.py
+++ b/seo/seo-analysis/scripts/url_inspection.py
@@ -33,15 +33,13 @@ import urllib.request
import urllib.error
from concurrent.futures import ThreadPoolExecutor, as_completed
-from _gcloud import adc_access_token, gcloud_run
+from _gcloud import adc_access_token, adc_config_dir, gcloud_run
from _uid import portable_uid, secure_write_json
def get_quota_project():
"""Return the quota_project_id from the ADC JSON file, or None."""
- adc_dir = os.environ.get("CLOUDSDK_CONFIG") or os.path.join(
- os.path.expanduser("~"), ".config", "gcloud"
- )
+ adc_dir = adc_config_dir()
adc_path = os.path.join(adc_dir, "application_default_credentials.json")
try:
with open(adc_path) as f:
diff --git a/server.json b/server.json
index f4ee1d86..ecd09247 100644
--- a/server.json
+++ b/server.json
@@ -8,7 +8,7 @@
"url": "https://github.com/nowork-studio/notfair-plugin",
"source": "github"
},
- "version": "0.27.9",
+ "version": "0.27.10",
"remotes": [
{
"type": "streamable-http",
diff --git a/test/unit/test_gcloud_helper.py b/test/unit/test_gcloud_helper.py
index b3d2d9f2..00232c5c 100644
--- a/test/unit/test_gcloud_helper.py
+++ b/test/unit/test_gcloud_helper.py
@@ -55,3 +55,45 @@ class TestGcloudCommand(unittest.TestCase):
if __name__ == "__main__":
unittest.main()
+
+
+class TestAdcConfigDir(unittest.TestCase):
+ def test_cloudsdk_config_wins(self):
+ with (
+ patch.dict(os.environ, {"CLOUDSDK_CONFIG": "/custom/gcloud"}, clear=False),
+ patch.object(gcloud.sys, "platform", "win32"),
+ ):
+ self.assertEqual(gcloud.adc_config_dir(), "/custom/gcloud")
+
+ def test_windows_uses_appdata(self):
+ env = {"APPDATA": r"C:\Users\ada\AppData\Roaming"}
+ with (
+ patch.dict(os.environ, env, clear=True),
+ patch.object(gcloud.sys, "platform", "win32"),
+ ):
+ self.assertEqual(
+ gcloud.adc_config_dir(),
+ os.path.join(env["APPDATA"], "gcloud"),
+ )
+
+ def test_windows_without_appdata_falls_back_to_home(self):
+ with (
+ patch.dict(os.environ, {}, clear=True),
+ patch.object(gcloud.sys, "platform", "win32"),
+ patch.object(gcloud.os.path, "expanduser", return_value="/home/ada"),
+ ):
+ self.assertEqual(
+ gcloud.adc_config_dir(),
+ os.path.join("/home/ada", ".config", "gcloud"),
+ )
+
+ def test_posix_uses_home_config(self):
+ with (
+ patch.dict(os.environ, {}, clear=True),
+ patch.object(gcloud.sys, "platform", "darwin"),
+ patch.object(gcloud.os.path, "expanduser", return_value="/Users/ada"),
+ ):
+ self.assertEqual(
+ gcloud.adc_config_dir(),
+ os.path.join("/Users/ada", ".config", "gcloud"),
+ )