Gws Install
A Claude Code skill for gws install workflows and automation
Category: development Source: jezweb/claude-skillsWhat Is Gws Install?
Gws Install is a skill for Anthropic’s Claude Code platform that streamlines the installation and configuration of the Google Workspace CLI (gws) on additional machines using existing OAuth credentials. Rather than repeating the full authorization flow each time you add a workstation or reinstall your operating system, Gws Install leverages previously obtained credentials to expedite setup. This skill is ideal for developers, IT administrators, and automation engineers who frequently work with Google Workspace APIs and require rapid, authenticated CLI access across multiple environments.
Why Use Gws Install?
The standard setup for the Google Workspace CLI involves generating OAuth credentials, authorizing scopes, and configuring local authentication. For users already set up on one machine, repeating this multi-step process on every new device can be time-consuming and error-prone. Gws Install resolves this by allowing you to reuse your client_secret.json file, copied from an existing setup or exported from the Google Cloud Console, to quickly configure the CLI on any compatible system.
With Gws Install, you ensure consistent credential management, minimize downtime during workstation migrations, and accelerate onboarding for new development environments. This is especially valuable in collaborative or dynamic environments where team members or automated agents may need rapid, secure access to Google Workspace APIs from multiple hosts.
How to Get Started
The Gws Install skill can be invoked in Claude Code using natural triggers such as “install gws,” “gws on new machine,” or “set up gws again.” Below is a step-by-step workflow demonstrating how to use this skill to install and configure the Google Workspace CLI on a new machine:
Step 1: Pre-flight Checks
Before proceeding, verify if you already have gws installed and properly configured:
which gws && gws --version
ls ~/.config/gws/client_secret.json
gws auth status
If these checks confirm that gws is installed and authenticated with the necessary scopes, you can skip the installation process.
Step 2: Install the CLI
If gws is not present or needs updating, install it globally using npm:
npm install -g @googleworkspace/cli
gws --version
Ensure that the CLI version matches your requirements.
Step 3: Set Up Credentials
You will need your client_secret.json file, which contains the OAuth client credentials. There are multiple ways to provide this file:
Option A — Paste the JSON Content
Ask the user to paste the JSON content of their client_secret.json. Then create the configuration directory and write the credentials:
mkdir -p ~/.config/gws
## Paste the JSON content into ~/.config/gws/client_secret.json
The expected JSON structure is:
{
"installed": {
"client_id": "YOUR_CLIENT_ID",
"project_id": "YOUR_PROJECT_ID",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
...
}
}
Option B — Copy the File
If you have access to the original client_secret.json, simply copy it to the target location:
mkdir -p ~/.config/gws
cp /path/to/client_secret.json ~/.config/gws/client_secret.json
Option C — Download from Google Cloud Console
If you no longer have the original file, download a new client_secret.json from the Google Cloud Console, then place it in the configuration directory as above.
Step 4: Authenticate the CLI
With the credentials in place, run:
gws auth login
Follow the prompts to complete authentication. If the credentials and scopes are correct, your CLI should now be authenticated and ready to use.
Key Features
- Rapid Installation: Significantly reduces setup time on new or reconfigured machines by reusing existing OAuth credentials.
- Cross-Platform Compatibility: Works on any system where Node.js and npm are available.
- Seamless Integration: Produces a fully authenticated CLI that is immediately compatible with all agent skills and workflows utilizing
gws. - Flexible Credential Input: Supports direct JSON pasting, file copying, or downloading credentials from Google Cloud Console.
Best Practices
- Safeguard Your Credentials: Always protect your
client_secret.jsonfile. Store it securely and do not share it in plaintext over insecure channels. - Consistent Versioning: Maintain consistent versions of
gwsacross all machines to prevent compatibility issues, especially in collaborative setups. - Automation Scripts: Consider scripting the installation and credential setup process for repeatable deployments across multiple environments.
- Regular Audits: Periodically run
gws auth statusto verify that your CLI remains authenticated and that scopes are correctly configured.
Important Notes
- Prerequisite: Gws Install requires you to already have a
client_secret.jsonfile from a previous setup. If you do not have this file, you must perform the full OAuth setup using thegws-setupskill or obtain the credentials from the Google Cloud Console. - Security: Exposing or mishandling your
client_secret.jsoncan compromise your Google Workspace account. Follow your organization’s best practices for secret management. - Scope Consistency: Ensure that the client credentials used have the appropriate scopes for your intended Google Workspace API usage.
- Skill Compatibility: Gws Install is intended for Claude Code environments and may not be compatible with other assistant platforms or workflows.
By following the outlined process and recommendations, you can leverage Gws Install to efficiently manage Google Workspace CLI deployments across all your development and automation environments.