Note:
- This project is under active development, and there may be many imperfections. Your understanding is appreciated.
- This is a fork of @google/aside, evolved to support AI-native workflows and unified architectures.
wyside is a next-generation CLI and scaffolding tool for Google Apps Script (GAS) development. It transforms the traditional GAS experience into a modern, professional software engineering workflow.
By enforcing a "Test-Separated Hybrid" architecture, wyside enables you to write code that runs identically on both your local Node.js environment and the GAS runtime. This allows for true TDD (Test-Driven Development), local execution, and robust CI/CD pipelines without the typical limitations of GAS.
-
๐ Unified Hybrid Runtime Write business logic that runs on both Node.js and GAS. Use standard
googleapisREST APIs instead of the proprietary GAS SDK for data operations, enabling 100% local testability. -
๐ค AI-Native Infrastructure Includes a built-in MCP (Model Context Protocol) Server. AI assistants (like Claude or Gemini) can use this to autonomously provision GCP projects, enable APIs (Sheets, Drive, Gmail), and manage Service Accounts for you.
-
๐ ๏ธ Modern Toolchain Pre-configured with TypeScript, ESLint, Prettier, and Vitest. Forget about configuration hell and start coding immediately.
-
๐ฆ Automatic Global Exposure Write standard ESM
exportfunctions. The build system automatically generates the necessary GAS global wrappers (function onOpen() { ... }), keeping your code clean and modular. -
๐ Multi-Environment Support Seamlessly switch between
devandprodenvironments with dedicated deployment configurations.
To achieve true local development, wyside mandates a strict architectural pattern:
- No GAS SDK in Business Logic: Avoid
ScriptApporSpreadsheetAppin your core logic. - Universal Clients: Use the provided "Universal Client" patterns that detect the runtime:
- On Node.js (Local/CI): Uses
googleapiswith a Service Account. - On GAS (Production): Uses
UrlFetchAppand GAS OAuth tokens.
- On Node.js (Local/CI): Uses
- Result: Your code is environment-agnostic. You can write fast, reliable unit tests in Vitest that run locally, ensuring high quality before deployment.
you need to complete the following prerequisites (including creating a Service Account and getting its key):
- Verifying authentication (
gcloud). - Selecting/Creating a Google Cloud Project.
- Enabling necessary APIs (Sheets, Drive, Gmail).
- Creating a Service Account & downloading keys (
secrets/service-account.json). - Configuring environment variables: Create a
.envfile based on.env.exampleand configure the necessary environment variables, especiallyGOOGLE_APPLICATION_CREDENTIALSto point to the downloaded service account key, and also Spreadsheet IDs and GCP project ID.
Once these prerequisites are completed, execute the following command:
npx @wywyjp/wyside init --setup-gcpTo inspect initialization issues with verbose debug logs:
WYSIDE_DEBUG=1 npx @wywyjp/wyside init --setup-gcpAfter running the init command, wyside orchestrates the following:
- Scaffolds Configuration: Sets up
tsconfig.json,eslint.config.js,vitest.config.ts, and.prettierrc. - Installs Dependencies: Fetches all necessary packages for building, linting, and testing.
- Configures Scripts: Adds convenience commands like
npm run build,npm run test, andnpm run deployto yourpackage.json. - Sets up Clasp: Initializes clasp for code synchronization with Google Drive.
You can customize the initialization with these flags:
--setup-gcpRun the automated Google Cloud Platform setup (APIs, Service Account, Secrets) using the embedded MCP server.--yes/-yAnswer 'yes' to all prompts (non-interactive mode).--no/-nAnswer 'no' to all prompts.--title/-t"string" Set the project title explicitly.--script-dev"string" Set the Apps Script ID for thedevenvironment.--script-prod"string" Set the Apps Script ID for theproductionenvironment.