gas-fakes provides a "Keyless" and "Silent" runtime for Microsoft Graph, allowing your Google Apps Script code to interact with OneDrive as if it were performing native Drive operations.
- Zero-Cache: Authentication tokens are never stored in local files.
gas-fakesrelies entirely on the OS-level Azure CLI cache or in-memory credentials. - Silent Runtime: Once authorized, subsequent executions are 100% silent, leveraging a hardened CLI fallback mechanism.
- Worker-Thread Auth: All authentication logic, including interactive fallbacks, is handled within the worker thread to maintain synchronous execution in your main script.
- Local Cache: To eliminate redundant login prompts, tokens can be stored locally in
.msgraph-token.jwt. See Security Advisory below. - Automatic Refresh: If the cached access token expires,
gas-fakesautomatically falls back to the Azure CLI to refresh it silently.
You must have the Azure CLI (az) installed on your machine.
Install Azure CLI
Run the gas-fakes initialization and select msgraph as a backend (you can also the other backends mentioned for multi client use - this example sets up gas-fakes to use any or all of google workspace, ms graph or ksuite):
gas-fakes init -b msgraph,google,ksuiteThis will add msgraph,google,ksuite to your GF_PLATFORM_AUTH in the .env file.
To populate the OS-level cache for silent runs, perform a one-time login:
gas-fakes auth - Quiet Experience:
gas-fakesautomatically suppresses redundant subscription selectors and verbose JSON output for a professional onboarding experience. - Silent Fallback: This process enables the "Silent Runtime" for all future executions.
Note that I don't have any Microsoft licenses, or a business account, and apparently I don't qualify for the Microsoft developer program that would allow me to get one. I've attempted to theoritically support theses and other scenarios, but I've only been able to test on personal accounts. If you're a gas-fakes user and have a business account,and other Microsoft license variants, I'd love to hear about your experiences - and would welcome any collaboration you can provide for this open source project.
Currently, gas-fakes has been only tested with Personal Microsoft Accounts (OneDrive Personal). While it supports custom App Registrations, personal accounts are the most stable path for "keyless" local development. The default tenant used for fallback is now consumers.
If you are using a Business account, a Guest account, or an External (EXT) identity, you may encounter a 400 Bad Request: Tenant does not have a SPO license error.
- Why?: Microsoft Graph requires a SharePoint Online (SPO) license to access the
/me/driveendpoint. Many business guest accounts or restricted identities do not have this license assigned. - Resolution: Ensure you are logged into an account with an active OneDrive/SharePoint license, or use a standard Personal account. If other issues arise please log an issue on github as this track has not yet been able to be tested.
If the silent CLI fallback fails, gas-fakes might trigger an interactive browser fallback directly from the worker threa, although it should be able to take care of this silently. If you see this raise an issue along with details of your environment.
- Behavior: A browser window will open to request consent or credentials, just needing your consent.
For consumer accounts, gas-fakes caches MS Graph tokens in a local file called .msgraph-token.jwt in your project root.
- Locally Signed JWT Storage: Tokens are stored as a locally-signed JWT (JSON Web Token), rather than plaintext JSON. While
gas-fakesalso sets restrictive file permissions (chmod 600), and this prevents casual viewing and tampering, the token is still readable by the node process. - Persistence: These tokens grant persistent access to your OneDrive/SharePoint resources until they expire along with the ability to silently refresh.
- Commit Risk: CRITICAL: Ensure
**/.msgraph-token.jwtis added to your.gitignore. Pushing this file to a public repository could expose some token info.
gas-fakesautomatically adds.msgraph-token.jwtto.gitignoreduringinit.- If you prefer a "Zero-Cache" approach, delete the
.msgraph-token.jwtfile and rely on the Azure CLI cache (which may require occasional re-auth).
When your script requests a token, gas-fakes attempts the following in order:
- Local Token Cache: Checks
.msgraph-token.jwtfor a valid, non-expired token or a way to refresh one. - Custom Client ID + Tenant: Uses your
.envconfiguration for your specific App Registration. - Universal CLI Fallback: Automatically picks up the active Azure CLI session from your machine, defaulting to
consumersif no specific tenant is provided. - Interactive Fallback: Opens a browser if all silent methods fail, also defaulting to the
consumerstenant.
You can check if a platform is authorized directly from your script:
if (ScriptApp.__isPlatformAuthed('msgraph')) {
console.log('MS Graph is ready!');
}
console.log('Currently authorized platforms:', ScriptApp.__platforms);Managed via gas-fakes init:
| Service | Classes | Methods | Completed | In Progress | Not Started |
|---|---|---|---|---|---|
| Base | 17 | 127 | 93 | 2 | 32 |
| Cache | 2 | 11 | 7 | 4 | 0 |
| Calendar | 13 | 273 | 273 | 0 | 0 |
| Charts | 29 | 238 | 37 | 0 | 201 |
| Content | 3 | 16 | 16 | 0 | 0 |
| Document | 47 | 1032 | 880 | 12 | 140 |
| Drive | 8 | 164 | 124 | 8 | 32 |
| Forms | 41 | 504 | 266 | 0 | 238 |
| Gmail | 6 | 168 | 167 | 0 | 1 |
| HTML | 6 | 39 | 34 | 0 | 5 |
| JDBC | 20 | 753 | 311 | 0 | 442 |
| Lock | 2 | 7 | 7 | 0 | 0 |
| 1 | 5 | 0 | 0 | 5 | |
| Properties | 4 | 11 | 6 | 5 | 0 |
| Script | 16 | 84 | 22 | 0 | 62 |
| Slides | 76 | 1288 | 1005 | 0 | 283 |
| Spreadsheet | 108 | 1771 | 1301 | 19 | 451 |
| URL Fetch | 2 | 13 | 12 | 0 | 1 |
| Utilities | 5 | 59 | 59 | 0 | 0 |
| XML | 14 | 149 | 142 | 0 | 7 |
| Total | 420 | 6712 | 4762 | 50 | 1900 |
- release notes
- gas fakes intro video
- getting started - how to handle authentication for Workspace scopes.
- readme
- apps script parity
- omlx setup
- Natural Language Automation with Gemini Skills & MCP Server - new skills-based agent approach.
- Add agent skills to gf_agent
- gf_agent documentation - instructions for the Gemini CLI automation agent and MCP server.
- gas fakes cli
- local add-on and webapp development with gas-fakes
- Bringing the webapp home
- Local development example code
- github actions using adc
- github actions using dwd and wif
- ksuite as a back end
- msgraph as a back end
- resurrecting scriptDb repo
- Resurrecting ScriptDb – nosql database for Apps Script
- gas-fakes in serverless containers
- apps script - a lingua franca for workspace platforms
- Apps Script: A ‘Lingua Franca’ for the Multi-Cloud Era
- running gas-fakes on google cloud run
- running gas-fakes on google kubernetes engine
- running gas-fakes on Amazon AWS lambda
- running gas-fakes on Azure ACA
- running gas-fakes on Github actions
- jdbc notes
- Yes – you can run native apps script code on Azure ACA as well!
- Yes – you can run native apps script code on AWS Lambda!
- initial idea and thoughts - how it all started
- Inside the volatile world of a Google Document
- Apps Script Services on Node – using apps script libraries
- Apps Script environment on Node – more services
- Turning async into synch on Node using workers
- All about Apps Script Enums and how to fake them
- colaborators - additional information for collaborators
- oddities - a collection of oddities uncovered during this project
- named colors
- sandbox
- senstive scopes
- using apps script libraries with gas-fakes
- how libhandler works
- article:using apps script libraries with gas-fakes
- named range identity
- Workspace scopes with local authentication
- sharing cache and properties between gas-fakes and live apps script
- gas-fakes-cli now has built in mcp server and gemini extension
- gas-fakes CLI: Run apps script code directly from your terminal
- How to allow access to Workspace scopes with Application Default Credentials
- Supercharge Your Google Apps Script Caching with GasFlexCache
- Fake-Sandbox for Google Apps Script: Granular controls.
- A Fake-Sandbox for Google Apps Script: Securely Executing Code Generated by Gemini CLI
- Power of Google Apps Script: Building MCP Server Tools for Gemini CLI and Google Antigravity in Google Workspace Automation
- A New Era for Google Apps Script: Unlocking the Future of Google Workspace Automation with Natural Language
- Next-Generation Google Apps Script Development: Leveraging Antigravity and Gemini 3.0
- Modern Google Apps Script Workflow Building on the Cloud
- Bridging the Gap: Seamless Integration for Local Google Apps Script Development
- Next-Level Google Apps Script Development
- Secure and Streamlined Google Apps Script Development with gas-fakes CLI and Gemini CLI Extension
- Secure and Conversational Google Workspace Automation: Integrating Gemini CLI with a gas-fakes MCP Server
- A Fake-Sandbox for Google Apps Script: A Feasibility Study on Securely Executing Code Generated by Gemini CL





