Skip to content

feat: implement cli#1

Merged
jpoehnelt merged 20 commits intomainfrom
feat/implement-cli
Mar 3, 2026
Merged

feat: implement cli#1
jpoehnelt merged 20 commits intomainfrom
feat/implement-cli

Conversation

@jpoehnelt
Copy link
Copy Markdown
Member

No description provided.

@jpoehnelt jpoehnelt force-pushed the feat/implement-cli branch from b9553b3 to 56914f3 Compare March 2, 2026 20:02
@googleworkspace googleworkspace deleted a comment from google-cla bot Mar 2, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request lays the foundation for the gws CLI, a tool designed to provide dynamic access to Google Workspace APIs. It includes the core CLI implementation, documentation, and security features, enabling users and AI agents to interact with Google Workspace services from the command line.

Highlights

  • CLI Implementation: This PR introduces the core implementation of the gws CLI, enabling users to interact with Google Workspace services directly from the terminal.
  • Dynamic Command Surface: The CLI dynamically generates its command surface from Google Discovery Service JSON documents, providing access to a wide range of Google Workspace APIs.
  • Documentation and Agent Skills: This PR adds comprehensive documentation, including guides for VHS tape files, skill verification workflows, and agent skills definitions for every supported Google Workspace API.
  • Authentication and Security: The PR implements authentication mechanisms, including OAuth2 and service account support, and integrates with Google Cloud Model Armor for prompt injection risk mitigation.
Changelog
  • .agent/skills/vhs.md
    • Added a guide for writing and editing VHS .tape files for terminal demo GIFs.
  • .agent/workflows/verify-skills.md
    • Added a workflow to verify skills/*/SKILL.md files against actual CLI output.
  • .changeset/README.md
    • Added a README file for Changesets.
  • .changeset/config.json
    • Added a configuration file for Changesets.
  • .env.example
    • Added an example .env file for OAuth client credentials and other settings.
  • .github/CODEOWNERS
    • Added a CODEOWNERS file to enforce code review for core engine code.
  • .github/PULL_REQUEST_TEMPLATE.md
    • Added a pull request template to guide contributors.
  • .github/labeler.yml
    • Added a labeler configuration to automatically apply labels to pull requests.
  • AGENTS.md
    • Added a document outlining the project overview, build & test instructions, architecture, and demo video generation.
  • CONTEXT.md
    • Added a document providing context for the Google Workspace CLI, including core syntax, key flags, usage patterns, and schema introspection.
  • Cargo.toml
    • Added dependencies for aes-gcm, anyhow, clap, dirs, dotenvy, hostname, reqwest, rand, serde, serde_json, sha2, thiserror, tokio, yup-oauth2, futures-util, base64, derive_builder, ratatui, and crossterm.
  • README.md
    • Modified the README to include installation instructions, AI agent & skills information, usage examples, authentication details, supported services, architecture overview, testing & coverage instructions, and security & sanitization information.
  • art/features.txt
    • Added ASCII art for feature roll.
  • art/intro.txt
    • Added ASCII art for the intro scene.
  • art/outro.txt
    • Added ASCII art for the outro scene.
  • art/qr.txt
    • Added ASCII art for a QR code.
  • demo.tape
    • Added a VHS tape file for generating a YouTube Short demo.
  • dist-workspace.toml
    • Added a configuration file for cargo-dist.
  • gemini-extension.json
    • Added a Gemini extension configuration file.
  • package.json
    • Added a package.json file for npm integration.
  • pnpm-lock.yaml
    • Added a pnpm lockfile for dependency management.
  • scripts/coverage.sh
    • Added a script for generating code coverage reports.
  • scripts/show-art.sh
    • Added a script for displaying ASCII art.
  • skills/gws-admin-reports/SKILL.md
    • Added a skill definition for gws admin-reports.
  • skills/gws-admin/SKILL.md
    • Added a skill definition for gws admin.
  • skills/gws-alertcenter/SKILL.md
    • Added a skill definition for gws alertcenter.
  • skills/gws-apps-script-push/SKILL.md
    • Added a skill definition for gws apps-script +push.
  • skills/gws-apps-script/SKILL.md
    • Added a skill definition for gws apps-script.
  • skills/gws-calendar-agenda/SKILL.md
    • Added a skill definition for gws calendar +agenda.
  • skills/gws-calendar-insert/SKILL.md
    • Added a skill definition for gws calendar +insert.
  • skills/gws-calendar/SKILL.md
    • Added a skill definition for gws calendar.
  • skills/gws-chat-send/SKILL.md
    • Added a skill definition for gws chat +send.
  • skills/gws-chat/SKILL.md
    • Added a skill definition for gws chat.
  • skills/gws-classroom/SKILL.md
    • Added a skill definition for gws classroom.
  • skills/gws-cloudidentity/SKILL.md
    • Added a skill definition for gws cloudidentity.
  • skills/gws-docs-write/SKILL.md
    • Added a skill definition for gws docs +write.
  • skills/gws-docs/SKILL.md
    • Added a skill definition for gws docs.
  • skills/gws-drive-upload/SKILL.md
    • Added a skill definition for gws drive +upload.
  • skills/gws-drive/SKILL.md
    • Added a skill definition for gws drive.
  • skills/gws-events-renew/SKILL.md
    • Added a skill definition for gws events +renew.
  • skills/gws-events-subscribe/SKILL.md
    • Added a skill definition for gws events +subscribe.
  • skills/gws-events/SKILL.md
    • Added a skill definition for gws events.
  • skills/gws-forms/SKILL.md
    • Added a skill definition for gws forms.
  • skills/gws-gmail-send/SKILL.md
    • Added a skill definition for gws gmail +send.
  • skills/gws-gmail-triage/SKILL.md
    • Added a skill definition for gws gmail +triage.
  • skills/gws-gmail-watch/SKILL.md
    • Added a skill definition for gws gmail +watch.
  • skills/gws-gmail/SKILL.md
    • Added a skill definition for gws gmail.
  • skills/gws-groupssettings/SKILL.md
    • Added a skill definition for gws groupssettings.
  • skills/gws-keep/SKILL.md
    • Added a skill definition for gws keep.
  • skills/gws-licensing/SKILL.md
    • Added a skill definition for gws licensing.
  • skills/gws-meet/SKILL.md
    • Added a skill definition for gws meet.
  • skills/gws-modelarmor-create-template/SKILL.md
    • Added a skill definition for gws modelarmor +create-template.
  • skills/gws-modelarmor-sanitize-prompt/SKILL.md
    • Added a skill definition for gws modelarmor +sanitize-prompt.
  • skills/gws-modelarmor-sanitize-response/SKILL.md
    • Added a skill definition for gws modelarmor +sanitize-response.
  • skills/gws-modelarmor/SKILL.md
    • Added a skill definition for gws modelarmor.
  • skills/gws-people/SKILL.md
    • Added a skill definition for gws people.
  • skills/gws-reseller/SKILL.md
    • Added a skill definition for gws reseller.
  • skills/gws-shared/SKILL.md
    • Added a skill definition for gws shared.
  • skills/gws-sheets-append/SKILL.md
    • Added a skill definition for gws sheets +append.
  • skills/gws-sheets-read/SKILL.md
    • Added a skill definition for gws sheets +read.
  • skills/gws-sheets/SKILL.md
    • Added a skill definition for gws sheets.
  • skills/gws-slides/SKILL.md
    • Added a skill definition for gws slides.
  • skills/gws-tasks/SKILL.md
    • Added a skill definition for gws tasks.
  • skills/gws-vault/SKILL.md
    • Added a skill definition for gws vault.
  • src/auth.rs
    • Added authentication and credential management logic.
  • src/auth_commands.rs
    • Added authentication-related commands.
  • src/client.rs
    • Added code to build the reqwest client.
  • src/commands.rs
    • Added code to build the CLI command structure.
  • src/credential_store.rs
    • Added code for storing credentials.
  • src/discovery.rs
    • Added code for fetching and parsing discovery documents.
  • src/error.rs
    • Added code for error handling.
  • src/executor.rs
    • Added code for executing API requests.
  • src/formatter.rs
    • Added code for formatting output.
  • src/generate_skills.rs
    • Added code for generating skills.
  • src/helpers/calendar.rs
    • Added helper functions for calendar.
  • src/helpers/chat.rs
    • Added helper functions for chat.
  • src/helpers/docs.rs
    • Added helper functions for docs.
  • src/helpers/drive.rs
    • Added helper functions for drive.
  • src/helpers/events/mod.rs
    • Added helper functions for events.
  • src/helpers/gmail/mod.rs
    • Added helper functions for gmail.
  • src/helpers/mod.rs
    • Added helper functions for the project.
  • src/helpers/modelarmor.rs
    • Added helper functions for modelarmor.
  • src/helpers/script.rs
    • Added helper functions for script.
  • src/helpers/sheets.rs
    • Added helper functions for sheets.
  • src/main.rs
    • Added main function.
  • src/oauth_config.rs
    • Added code for oauth config.
  • src/schema.rs
    • Added code for schema.
  • src/services.rs
    • Added code for services.
  • src/setup.rs
    • Added code for setup.
  • src/setup_tui.rs
    • Added code for setup tui.
  • templates/modelarmor/jailbreak.json
    • Added code for templates modelarmor.
Ignored Files
  • Ignored by pattern: .github/workflows/** (6)
    • .github/workflows/ci.yml
    • .github/workflows/coverage.yml
    • .github/workflows/labeler.yml
    • .github/workflows/release-changesets.yml
    • .github/workflows/release.yml
    • .github/workflows/stale.yml
Activity
  • Implemented core CLI structure
  • Implemented dynamic command generation from Discovery Documents
  • Added OAuth2 and service account authentication
  • Integrated with Google Cloud Model Armor for sanitization
  • Added documentation and agent skills definitions
  • Added helper commands for common tasks
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive new CLI tool for Google Workspace, including dynamic command generation, authentication, helper commands, and extensive documentation. The architecture is well-thought-out. My review focuses on improving robustness, maintainability, and correctness. I've identified a potential panic in the HTTP client setup, a URL encoding bug, a complex manual date-time implementation that could be replaced by a standard library, an opportunity to refactor repeated code, and a minor error in the README documentation.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 2, 2026

⚠️ No Changeset found

Latest commit: 9550727

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@jpoehnelt
Copy link
Copy Markdown
Member Author

/gemini review

@jpoehnelt
Copy link
Copy Markdown
Member Author

@gemini-code-assist review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is an impressive initial implementation of a complex CLI tool. The architecture with dynamic command generation from discovery documents is powerful, and the code is generally well-structured with good separation of concerns. The security considerations, like encrypted credential storage, are well-handled. The TUI for setup is a great user-friendly feature. The main issues are related to dependency versions in configuration files, which are critical but easy to fix. There are also a few opportunities to improve performance and code clarity in some of the helper functions.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the initial implementation of the gws CLI, a dynamic tool for interacting with Google Workspace APIs. The changes are extensive, including the core application logic in Rust, documentation, helper scripts, and configuration files. The overall architecture is well-thought-out, with a dynamic command structure based on Google's Discovery Documents and a clear separation of concerns for authentication, execution, and formatting.

My review focuses on improving maintainability and correctness. I've identified several areas for refactoring, such as breaking down very large functions in src/setup.rs and src/executor.rs into smaller, more manageable pieces. I also found some duplicated code and an opportunity to use the chrono library for more robust date parsing instead of a manual implementation. Finally, I've pointed out an unnecessary use of an unsafe block in the tests. Addressing these points will enhance the long-term health and readability of this new codebase.

@jpoehnelt jpoehnelt merged commit f75bf6d into main Mar 3, 2026
22 checks passed
@jpoehnelt jpoehnelt deleted the feat/implement-cli branch March 3, 2026 00:26
shigechika pushed a commit to shigechika/gws-cli that referenced this pull request Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant