Logo ggsrun

ggsrun

Cộng đồng
tanaikech

High-performance Google Drive CLI and Model Context Protocol (MCP) Server for LLM/AI agents. Natively execute Google Apps Script (GAS) under a secure whitelisted runtime sandbox, automate transfers, and manage Drive infrastructure.

Nhà phát hànhtanaikech
Kho mãggsrun
Ngôn ngữGo
Bản fork
19
Sao
173
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    ggsrun cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    173 sao và 19 bản fork từ kho mã được liên kết.

ggsrun

Go Version MCP Ready Build Status MIT License


🚀 Overview

ggsrun is an enterprise-grade CLI application and Model Context Protocol (MCP) Server designed to relentlessly orchestrate Google Drive I/O operations and statefully execute Google Apps Script (GAS) natively from your local terminal or via autonomous Large Language Model (LLM) agents.

Built on Go 1.26.4+, ggsrun transitions legacy single-threaded processing into a state-of-the-art, channel-based concurrent streaming architecture. It delivers maximum network throughput, native Shared Drives (Omni-Drive) support, advanced MIME resolution, resilient self-healing retries, and a native Security Sandbox to restrict Google Workspace APIs during autonomous executions.


🗺️ Documentation Directory Index

To make onboarding, development, and advanced operations as seamless as possible, our documentation is fully modularized. Navigate directly to your area of interest:

Guide / ManualDescriptionLink
🚀 Setup & Onboarding GuideStep-by-step instructions to configure GCP, generate OAuth2 client secrets, link Google Apps Script, and deploy gateway endpoints.Setup Guide
📖 Command Reference ManualIn-depth breakdown of all 15+ subcommands (e.g. exe1, exe2, download, upload), recipes, and Mermaid architectural diagrams.Command Reference
🛡️ Security Sandbox GuideExplains the memory-based wrapper injection, whitelist configuration schemas (sandbox_config.json), and security validation scenarios.Sandbox Guide
🔄 Stateful Execution LifecycleDeep-dive explanation of the backup, sandboxing, upload, execution, and resilient rollback phases of the exe1 command.Execution Lifecycle
🤖 MCP Server GuideConfiguration to run ggsrun as an autonomous tool provider in AI environments (like Claude Desktop or Antigravity), schemas, and scenarios.MCP Server Guide
💻 Interactive TUI Filer GuideAll keyboard shortcuts, search highlighter rules, clipboard integration, and history for the split-screen Japanese PC-98 Filer Mode (ggsrun fd).TUI Filer Guide
🧪 Local Development & TestingDetailed guide for configuring environment variables (.env), understanding CLI/TUI mock tests, and running automated test suites.Development Guide
🔬 Manual Integration Tests SuiteGuided verification commands to manually test authorization, sandbox policies, tool schemas, and local file operations.Manual Tests Suite
📚 Detailed User ManualComprehensive manual detailing all commands, advanced options, custom editor integrations (Sublime Text), and legacy parameters.Detailed Manual
📜 Version Update HistoryChronological record of all updates, bug fixes, features, and refactoring milestones from v1.0.0 to the latest release.Update History

✨ Features of ggsrun

  1. Terminal GAS Development: Develop Google Apps Script using your favorite local text editors and terminals seamlessly.
  2. Dynamic Script Execution: Execute GAS directly by injecting values, arguments, and payloads into your scripts dynamically.
  3. Massively Parallel Downloads: Pull files and folders concurrently from Google Drive with stunning progress visualizations.
  4. Massively Parallel Uploads: Push folders recursively with native Resumable upload wrappers and automated chunks handling.
  5. Flexible Project Formats: Download standalone scripts or container-bound projects flawlessly.
  6. Recursive Folder Structuring: Map local directories to Google Drive folders recursively, retaining absolute directory trees.
  7. Multi-Format Container Synced Uploads: Upload script files and instantly provision standalone scripts OR container-bound scripts.
  8. Permissions Orchestration: Inspect, list, and manage file and folder sharing permissions across your entire Drive.
  9. Advanced Metadata Search: Query your Google Drive utilizing Google Drive API v3 query syntax and local filename Regular Expressions (Regex).
  10. Flexible Authentication: Natively supports robust browser loopback OAuth2, secure Service Accounts, and direct Access Token injection (--accesstoken / --at) for automated testing and CI/CD pipelines.
  11. Security Sandboxing: Officially integrates with the Antigravity CLI via an embedded in-memory security sandbox wrapper (--sandbox) to guard Workspace resources.
  12. Self-Healing Project Recovery: Restore the remote GAS project to a clean initial state at any time with a single command (ggsrun recover).
  13. Enterprise & Sandbox Proxy Ready: Natively honors environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) for robust connectivity within Gemini Managed Agents sandboxes and enterprise corporate networks.

🏛️ The 5 Pillars of the v5 Architecture

A. Massively Parallel I/O & UI

Legacy single-threaded processing has been completely replaced. ggsrun implements a channel-based worker pool built on golang.org/x/sync/errgroup to maximize network throughput on massive folder hierarchies.

B. Full Shared Drive (Omni-Drive) Support

The v5 engine forces supportsAllDrives=true and includeItemsFromAllDrives=true across all Google Drive API permutations, allowing enterprise Shared Drives to be mapped and managed seamlessly.

C. Intelligent GAS & MIME Resolution

The extraction logic dynamically categorizes Google Workspace entities. Downloader rules bypass the standard Drive API for GAS files, automatically routing to the Apps Script API to download scripts natively as structured JSON or packaged ZIP archives.

D. Robust Fault Tolerance & Auto-Retry

The v5 execution and transfer phase is strictly non-blocking. Google API Rate Limits (HTTP 429) and Server Errors (5xx) trigger an exponential backoff sequence per-worker, ensuring resilient self-healing.

E. MCP (Model Context Protocol) Integration

Running ggsrun mcp transforms the application into an autonomous JSON-RPC background server via standard I/O, allowing Large Language Model (LLM) agents to search, transfer, and execute scripts safely.


📦 Rapid Installation

Method A: Build from Source (Using Go)

Requires Go 1.26.4 or higher installed. Compile and install the binary natively:

bash
$ go install github.com/tanaikech/ggsrun@latest

Method B: Download Pre-built Binaries

Alternatively, download the pre-compiled binary matching your CPU architecture and operating system from the Official Releases Page:

  • macOS (Darwin): ggsrun_darwin_amd64 (Intel) or ggsrun_darwin_arm64 (Apple Silicon M1/M2/M3)
  • Linux: ggsrun_linux_amd64 (or matching ARM, 32-bit, or MIPS variants)
  • Windows: ggsrun_windows_amd64.exe (or 32-bit, ARM variants)

🧪 Post-Installation Verification

Once you have downloaded or compiled ggsrun, verify that the binary is functional inside your terminal:

1. Verify Command Help

Run the help display command to verify the binary executes and lists available options:

bash
$ ggsrun --help

2. Setup & Authentication

Before running any diagnostics or script execution commands, you must configure your Google Cloud credentials and authorize the local application.

Please follow the detailed, step-by-step instructions in the Setup & Onboarding Guide to:

  1. Obtain and load your GCP OAuth client_secret.json credentials.
  2. Link your Google Cloud project to your Google Apps Script project.
  3. Automatically deploy and secure the execution gateway.

3. Run Diagnostics

Once you have completed the onboarding process, verify API connectivity and loopback token health by running:

bash
$ ggsrun status

⚡ Quick Start: Dynamic & Complex Script Execution

With v5.3.21, ggsrun seamlessly executes inline or complex multi-line Google Apps Script code directly from your terminal or scripts without escaping issues:

1. Execute Inline or Multi-line Script Directly (--ss):

bash
$ ggsrun exe1 --ss "function test(e){
  return 'ok ' + e.key;
}" -f "test" -v '{"key":"value1"}'

2. Execute Complex Multi-line Scripts via Piped Standard Input / Heredoc:

Piping script payloads via standard input completely bypasses shell quotation and variable expansion limitations, supporting arbitrary comments, regular expressions, and template literals:

bash
$ cat << 'EOF' | ggsrun exe1 -f "test" -v '{"key":"value1"}'
function test(e) {
  // Complex regular expressions, comments, and string escapes
  const re = /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/gi;
  /* Multi-line comment:
     Special characters: $ \ ' " ` \n \t
  */
  const msg = `Processed Key: ${e.key}`;
  return {
    status: "success",
    result: msg,
    regexMatch: re.test("https://google.com")
  };
}
EOF

3. Passing Function Arguments from a File:

You can pass large JSON datasets or parameter files into your function using shell file substitution $(< filename) or "$(cat filename)":

bash
# Pass data.json directly to the function's parameter
$ ggsrun exe1 --ss "function process(data){ return Object.keys(data).length; }" -f "process" -v "$(< data.json)"

# Combine with Heredoc script execution and file arguments:
$ cat << 'EOF' | ggsrun exe1 -f "analyze" -v "$(< payload.json)"
function analyze(e) {
  return "Received " + e.items.length + " records from file.";
}
EOF

4. Passing Function Arguments from External Command Pipelines:

Pass outputs from tools like curl, jq, or custom scripts dynamically into Google Apps Script:

bash
# Fetch live API payload and pass to GAS execution
$ ggsrun exe1 --ss "function run(e){ return e; }" -f "run" -v "$(curl -s https://api.github.com/users/octocat)"

5. Direct Access Token Execution (CI/CD & Automated Testing):

Directly pass an OAuth2 access token via --accesstoken or --at (or -at). This completely bypasses ggsrun.cfg, refresh tokens, and credentials files, making it ideal for CI/CD environments and ephemeral pipelines:

bash
# Execute GAS script using a temporary access token without any local configuration files
$ ggsrun exe1 -i "SCRIPT_ID" -ss "function main() { return 'success'; }" -f "main" --at "ACCESS_TOKEN" -j

# Execute Drive search with direct access token
$ ggsrun searchfiles -q "name contains 'Project'" --at "ACCESS_TOKEN" -j

For more detailed execution recipes, sandboxing configurations, and lifecycle guides, visit the Command Reference Manual.


🤖 Antigravity CLI Integration (Plugin Installation)

You can easily integrate ggsrun into the Antigravity CLI (agy) as a plugin. Installing this plugin automatically registers the ggsrun MCP server and installs the dedicated Apps Script development Agent Skill (skills/gas-execution/SKILL.md).

Installation

Run the following command inside your terminal:

bash
$ agy plugin install https://github.com/tanaikech/ggsrun
# or
$ agy plugin install https://github.com/tanaikech/ggsrun.git

To uninstall the plugin at any time:

bash
$ agy plugin uninstall ggsrun-plugin

Plugin Directory Structure

The plugin is structured as follows (excluding legacy Agent Hooks, which are now natively handled by the ggsrun core binary):

ggsrun/
├── plugin.json             # Plugin metadata config for Antigravity CLI
├── mcp_config.json        # MCP server definitions (ggsrun-mcp, workspace-developer)
└── skills/
    └── gas-execution/
        └── SKILL.md        # AI agent guidelines for GAS development and execution

💬 Q&A & Troubleshooting

For general Q&A, standard Google API errors, and runtime limits, please refer to the detailed Legacy Q&A Guide.

For setup, Web App redirects, headless authentications, and 404s, please consult the Setup Guide Troubleshooting Section.


📄 License & Author

Cài đặt

TypingMind
{
  "mcpServers": {
    "ggsrun": {
      "command": "ggsrun",
      "args": [
        "mcp"
      ]
    }
  }
}

Dùng MCP ggsrun với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối ggsrun, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm ggsrun làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của ggsrun.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "ggsrun": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của ggsrun, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của ggsrun.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng ggsrun giúp tôi làm việc này không?
ggsrun
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng ggsrun.

Câu hỏi thường gặp

Máy chủ MCP ggsrun dùng để làm gì?

ggsrun là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP ggsrun với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng ggsrun với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP ggsrun với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối ggsrun, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP ggsrun với TypingMind?

ggsrun hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP ggsrun cung cấp những công cụ nào trong TypingMind?

ggsrun cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP ggsrun không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu ggsrun yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇