Documentation Index
Fetch the complete documentation index at: https://mintlify.com/googleworkspace/cli/llms.txt
Use this file to discover all available pages before exploring further.
Before You Begin
Contributor License Agreement
Contributions to this project must be accompanied by a Contributor License Agreement (CLA). You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. If you or your current employer have already signed the Google CLA (even if it was for a different project), you probably don’t need to do it again. Visit cla.developers.google.com to see your current agreements or to sign a new one.Community Guidelines
This project follows Google’s Open Source Community Guidelines.Changesets (Required)
Creating a Changeset
Create a file at.changeset/<descriptive-name>.md:
Choosing the Change Type
| Type | When to Use | Examples |
|---|---|---|
patch | Fixes, chores, documentation | Bug fixes, dependency updates, typo fixes |
minor | New features, non-breaking additions | New commands, new flags, new APIs |
major | Breaking changes | Removed commands, changed output format, incompatible API changes |
Example Changesets
Patch (bug fix):Code Style Guidelines
Formatting
Userustfmt for consistent formatting:
Linting
Run Clippy with strict warnings:Naming Conventions
- Functions:
snake_case - Types/Structs:
PascalCase - Constants:
SCREAMING_SNAKE_CASE - Modules:
snake_case
Input Validation & URL Safety
Validation Checklist
When adding a new feature or CLI command:| Scenario | What to Use |
|---|---|
File path for writing (--output-dir) | validate::validate_safe_output_dir() |
File path for reading (--dir) | validate::validate_safe_dir_path() |
| URL path segment (file ID, resource ID) | helpers::encode_path_segment() |
| Query parameters | reqwest .query() builder |
Resource names (--project, --space) | helpers::validate_resource_name() |
Enum flags (--msg-format) | clap value_parser |
Path Safety Example
URL Encoding Example
Query Parameter Example
Resource Name Example
Testing Requirements
Test Coverage
- Run
cargo testlocally before submitting - Verify new branches are exercised
- Use
./scripts/coverage.shto generate a coverage report - The
codecov/patchcheck requires new or modified lines to be tested
Writing Tests
Extract testable helper functions:Serial Tests
Tests that modify the process CWD must use#[serial] from serial_test:
Tempdir Paths
Canonicalize tempdir paths to handle macOS/var → /private/var symlinks:
Pull Request Workflow
1. Fork and Clone
2. Create a Branch
3. Make Changes
- Write code following the style guidelines
- Add tests for new functionality
- Update documentation if needed
4. Create a Changeset
5. Run Checks Locally
6. Commit and Push
7. Create Pull Request
- Go to github.com/googleworkspace/cli
- Click New Pull Request
- Select your branch
- Fill out the PR template
- Submit for review
Code Review Process
All submissions, including submissions by project members, require review:- A maintainer will review your PR
- Address any requested changes
- Once approved, a maintainer will merge your PR
- Your changes will be included in the next release
Package Manager Note
Important: Use
pnpm instead of npm for Node.js package management in this repository.Additional Resources
Getting Help
If you have questions or need help:- Check the documentation
- Search existing issues
- Open a new issue
- Join discussions in pull requests