Scaffold the Gemini CLI Transform extension#1
Conversation
Add the extension manifest, agent guidance, docs, license, and a bash consistency check with CI. Installs the Transform MCP server (https://mcp.transform.unstructured.io) into Gemini CLI over OAuth.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
All reported issues were addressed across 11 files
Tip: instead of fixing issues one by one fix them all with cubic
Re-trigger cubic
- validate.sh: match the server URL as a fixed string (dots were being treated as regex wildcards), parse the manifest with python3 when jq is absent instead of scanning text, and derive the checked file list from git ls-remote so new files are covered. - Pin actions/checkout to the v4.2.2 commit SHA. - README: describe the check as 'no file references a different URL'. - AGENTS.md: tell agents to back off between status polls.
|
Thanks, good catches. All six addressed in cd6db6a:
|
There was a problem hiding this comment.
2 issues found across 4 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/validate.sh">
<violation number="1" location="scripts/validate.sh:63">
P2: A URL with userinfo, a port, or a query is truncated before comparison, so a different endpoint can pass this all-tracked-file check; for example, `https://mcp.transform.unstructured.io@attacker.example` is reduced to the canonical hostname. Comparing complete URL tokens (or parsing the URL) would preserve the intended drift detection.</violation>
<violation number="2" location="scripts/validate.sh:67">
P2: Outside a Git worktree, `git ls-files` fails but this process substitution hides the failure, so the loop scans nothing and the script reports success. Capturing the file list with an explicit status check, or failing when `git ls-files` cannot run, would prevent the consistency check from being silently bypassed.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| | grep -Fvqx "$canonical"; then | ||
| err "$f references a server URL that differs from the canonical one ($canonical)" | ||
| fi | ||
| done < <(git ls-files) |
There was a problem hiding this comment.
P2: Outside a Git worktree, git ls-files fails but this process substitution hides the failure, so the loop scans nothing and the script reports success. Capturing the file list with an explicit status check, or failing when git ls-files cannot run, would prevent the consistency check from being silently bypassed.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/validate.sh, line 67:
<comment>Outside a Git worktree, `git ls-files` fails but this process substitution hides the failure, so the loop scans nothing and the script reports success. Capturing the file list with an explicit status check, or failing when `git ls-files` cannot run, would prevent the consistency check from being silently bypassed.</comment>
<file context>
@@ -12,40 +12,59 @@ err() {
+ | grep -Fvqx "$canonical"; then
+ err "$f references a server URL that differs from the canonical one ($canonical)"
+ fi
+ done < <(git ls-files)
fi
</file context>
| while IFS= read -r f; do | ||
| [ "$f" = "scripts/validate.sh" ] && continue | ||
| [ -f "$f" ] || continue | ||
| if grep -oE 'https://mcp\.[A-Za-z0-9./-]*[A-Za-z0-9/-]' "$f" 2>/dev/null \ |
There was a problem hiding this comment.
P2: A URL with userinfo, a port, or a query is truncated before comparison, so a different endpoint can pass this all-tracked-file check; for example, https://mcp.transform.unstructured.io@attacker.example is reduced to the canonical hostname. Comparing complete URL tokens (or parsing the URL) would preserve the intended drift detection.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/validate.sh, line 63:
<comment>A URL with userinfo, a port, or a query is truncated before comparison, so a different endpoint can pass this all-tracked-file check; for example, `https://mcp.transform.unstructured.io@attacker.example` is reduced to the canonical hostname. Comparing complete URL tokens (or parsing the URL) would preserve the intended drift detection.</comment>
<file context>
@@ -12,40 +12,59 @@ err() {
+ while IFS= read -r f; do
+ [ "$f" = "scripts/validate.sh" ] && continue
+ [ -f "$f" ] || continue
+ if grep -oE 'https://mcp\.[A-Za-z0-9./-]*[A-Za-z0-9/-]' "$f" 2>/dev/null \
+ | grep -Fvqx "$canonical"; then
+ err "$f references a server URL that differs from the canonical one ($canonical)"
</file context>
| if grep -oE 'https://mcp\.[A-Za-z0-9./-]*[A-Za-z0-9/-]' "$f" 2>/dev/null \ | |
| if grep -oE 'https://mcp\.[A-Za-z0-9./:@?&=%_+#~-]*[A-Za-z0-9/@?&=%_+#~-]' "$f" 2>/dev/null \ |
This adds the scaffolding for the Gemini CLI extension, per the proposal William approved when spinning up the repo. The extension installs the Transform MCP server into Gemini CLI over browser OAuth, no API key needed.
What is here
gemini-extension.json- the extension manifest (server URL, version,contextFileName).AGENTS.md- agent guidance that ships with the extension: the upload/PUT/file_refflow, poll-do-not-resubmit, the prompt-injection boundary, and the OAuth-first auth note.README.md- install command, usage, and links out to the docs and theunstructured-mcp-integrationsindex for other tools.LICENSE(MIT),CONTRIBUTING.md,CODEOWNERS, editor/attributes/ignore dotfiles.scripts/validate.sh- plain-bash check that the manifest is valid JSON and every file references the same server URL, wired into CI (.github/workflows/validate.yml).Most of this content was written and reviewed earlier in the retired
transform-mcp-helperrepo; this is the Gemini-only slice, moved to its own repo because Gemini installs and lists one extension per repo.How it was verified
./scripts/validate.shpasses locally.git ls-remoteon the default branch (documented inCONTRIBUTING.md), so the manifest version does not drive updates for this install method.After merge
Add the
gemini-cli-extensiontopic and repo description, then a follow-up PR tounstructured-mcp-integrationsadding an index row that links here.Summary by cubic
Scaffolded the Unstructured Transform extension for Gemini CLI, adding the manifest, agent guidance, and validation workflow. Installs the
transformMCP server ingeminivia browser OAuth (no API key) to parse documents into markdown, JSON, HTML, or text.New Features
gemini-extension.jsonwithcontextFileNameandmcpServers.transform.httpUrlset tohttps://mcp.transform.unstructured.io.AGENTS.mdwith upload/PUT/file_refflow, polling guidance with backoff, error handling, and auth boundaries.README.mdwith install and usage; addedLICENSE,CONTRIBUTING.md,CODEOWNERS, and editor/ignore configs.scripts/validate.shand CI to enforce JSON validity and server URL consistency; hardened to parse JSON withpython3ifjqis absent, match the URL as a fixed string, scan all tracked files viagit, and pinnedactions/checkoutto v4.2.2.Migration
gemini extensions install https://github.com/Unstructured-IO/transform-gemini-extension/mcp auth transformto sign in via browser OAuth.Written for commit cd6db6a. Summary will update on new commits.