How deepakkasundra/gas-github works
Project type and purpose
• This is a small Node.js CLI utility (an open-source tool) whose sole responsibility is to automate the flow of:
• Cloning a Google Apps Script project (via Google’s clasp CLI)
• Sanitizing sensitive content (optional)
• Copying files into a local Git repo directory
• Performing Git operations to push to a GitHub remote
• Logging all steps
File structure
• Top level:
• GAS-Git.js (core script)
• README.md (documentation)
• No subdirectories except those created at runtime:
• ./temp-clasp (for clasp clone)
• Destination folder (e.g., D:/AppScripts/CM) for the Git repo
• SanitizingOutput.txt (log file)
Extract architectural insights from README
• External dependencies: Node.js, npm, @google/clasp, git CLI
• Runtime interactions with: Google Apps Script servers, local filesystem, GitHub
• Main phases: Prompt → clone → sanitize → copy → git commit/push → log
Main components & relationships
a. User CLI
• Initiates the script, provides Script ID, sanitization flag, and GitHub URL
b. Node.js Process (GAS-Git.js)
• Orchestrator that invokes all modules/functions
c. clasp CLI
• Subprocess calls to pull down the GAS project into ./temp-clasp
d. Sanitization Module
• In-memory transformation of source files to scrub domains/API paths
e. Local Filesystem
• ./temp-clasp (input)
• Destination Git folder (staging area for cleaned files)
• SanitizingOutput.txt (log)
f. Git CLI & GitHub
• Local Git: add, commit, rebase, push
• Remote GitHub: final destination of cleaned code
Architectural patterns & design principles
• Single-entry orchestrator (linear workflow)
• Modular subprocess calls (clasp, git)
• Separation of concerns:
• Input gathering (CLI)
• Data retrieval (clasp clone)
• Data processing (sanitization)
• Data deployment (Git commit/push)
• Logging & error handling