Skip to content

Commit b9553b3

Browse files
committed
feat: implement cli
1 parent f6d850c commit b9553b3

File tree

116 files changed

+23282
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+23282
-1
lines changed

.agent/skills/vhs.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
description: Writing and editing VHS `.tape` files for terminal demo GIFs
3+
---
4+
5+
# VHS Tape Files
6+
7+
[VHS](https://github.com/charmbracelet/vhs) records terminal sessions into GIFs/MP4s/WebMs from `.tape` scripts. Run with `vhs demo.tape`.
8+
9+
## Critical Syntax Rules
10+
11+
### Type command and inline directives
12+
13+
`Type`, `Sleep`, `Enter` are **separate directives on the same line**, delimited by the closing `"` of the `Type` string. The most common bug is forgetting to close the `Type` string, which causes `Sleep`/`Enter` to be typed literally into the terminal.
14+
15+
```
16+
# ✅ CORRECT — closing " before Sleep
17+
Type "echo hello" Sleep 300ms Enter
18+
19+
# ❌ WRONG — Sleep and Enter are typed as literal text
20+
Type "echo hello Sleep 300ms Enter
21+
```
22+
23+
### Type with @speed override
24+
25+
Override typing speed per-command with `@<time>` immediately after `Type` (no space):
26+
27+
```
28+
Type@80ms '{"pageSize": 2}' Sleep 100ms
29+
```
30+
31+
### Quoting
32+
33+
- Double quotes `"..."` are the standard Type delimiter
34+
- Single quotes `'...'` also work and are useful when the typed content contains double quotes (e.g. JSON)
35+
- Escape quotes inside strings with backticks: `` Type `VAR="value"` ``
36+
- When building shell commands with nested quotes, split across multiple `Type` lines:
37+
38+
```
39+
Type "gws drive files list --params '" Sleep 100ms
40+
Type@80ms '{"pageSize": 2, "fields": "nextPageToken,files(id)"}' Sleep 100ms
41+
Type "' --page-all" Sleep 300ms Enter
42+
```
43+
44+
> **Pitfall**: Every `Type` line that is followed by `Sleep` or `Enter` on the same line MUST close its string first. Audit each line to ensure the quote is closed before any directive.
45+
46+
## Settings (top of file only)
47+
48+
Settings must appear before any non-setting command (except `Output`). `TypingSpeed` is the only setting that can be changed mid-tape.
49+
50+
```
51+
Output demo.gif
52+
53+
Set Shell "bash"
54+
Set FontSize 14
55+
Set Width 1200
56+
Set Height 1200
57+
Set Theme "Catppuccin Mocha"
58+
Set WindowBar Colorful
59+
Set WindowBarSize 40
60+
Set TypingSpeed 40ms
61+
Set Padding 20
62+
```
63+
64+
## Common Commands
65+
66+
| Command | Example | Notes |
67+
|---|---|---|
68+
| `Output` | `Output demo.gif` | `.gif`, `.mp4`, `.webm` |
69+
| `Type` | `Type "ls -la"` | Type characters |
70+
| `Type@<time>` | `Type@80ms "slow"` | Override typing speed |
71+
| `Sleep` | `Sleep 2s`, `Sleep 300ms` | Pause recording |
72+
| `Enter` | `Enter` | Press enter |
73+
| `Hide` / `Show` | `Hide` ... `Show` | Hide setup commands |
74+
| `Ctrl+<key>` | `Ctrl+C` | Key combos |
75+
| `Tab`, `Space`, `Backspace` | `Tab 2` | Optional repeat count |
76+
| `Up`, `Down`, `Left`, `Right` | `Up 3` | Arrow keys |
77+
| `Wait` | `Wait /pattern/` | Wait for regex on screen |
78+
| `Screenshot` | `Screenshot out.png` | Capture frame |
79+
| `Env` | `Env FOO "bar"` | Set env var |
80+
| `Source` | `Source other.tape` | Include another tape |
81+
| `Require` | `Require jq` | Assert program exists |
82+
83+
## Hide/Show for Setup
84+
85+
Use `Hide`/`Show` to run setup commands (e.g. setting `$PATH`, clearing screen) without recording them:
86+
87+
```
88+
Hide
89+
Type "export PATH=$PWD/target/release:$PATH" Enter
90+
Type "clear" Enter
91+
Sleep 2s
92+
Show
93+
```
94+
95+
## Checklist When Editing Tape Files
96+
97+
1. **Every `Type` string must be closed** before `Sleep`/`Enter` on the same line
98+
2. **Multi-line Type sequences** that build a single shell command: ensure the final line closes its string and includes `Enter`
99+
3. **Sleep durations** after commands should be long enough for the command to finish (network calls may need 8s+)
100+
4. **Settings go at the top** — only `TypingSpeed` can appear later
101+
5. **Test locally** with `vhs <file>.tape` before committing

.agent/workflows/verify-skills.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
description: Verify all skills/*/SKILL.md files against actual CLI output for accuracy
3+
---
4+
5+
# Verify Skills
6+
7+
Ensure every `skills/*/SKILL.md` file is accurate and optimized for AI agent consumption.
8+
9+
## Steps
10+
11+
1. **List all skill files**
12+
13+
```bash
14+
find skills -name SKILL.md | sort
15+
```
16+
17+
2. **Get top-level help for every service**
18+
19+
// turbo
20+
```bash
21+
for svc in drive sheets gmail calendar admin admin-reports docs slides tasks people chat vault groupssettings reseller licensing apps-script; do
22+
echo "=== $svc ==="
23+
./target/debug/gws $svc --help 2>&1
24+
echo
25+
done
26+
```
27+
28+
3. **Get sub-resource help for key services** (spot-check method names used in examples)
29+
30+
// turbo
31+
```bash
32+
./target/debug/gws drive files --help 2>&1
33+
./target/debug/gws gmail users messages --help 2>&1
34+
./target/debug/gws sheets spreadsheets --help 2>&1
35+
./target/debug/gws sheets spreadsheets values --help 2>&1
36+
./target/debug/gws calendar events --help 2>&1
37+
./target/debug/gws people people --help 2>&1
38+
./target/debug/gws chat spaces --help 2>&1
39+
./target/debug/gws vault matters --help 2>&1
40+
./target/debug/gws admin users --help 2>&1
41+
./target/debug/gws tasks tasks --help 2>&1
42+
```
43+
44+
4. **For each SKILL.md, verify the following against the CLI `--help` output:**
45+
46+
- [ ] **Resource names** match exactly (e.g., `files`, `spreadsheets`, `users`)
47+
- [ ] **Method names** match exactly (e.g., `list`, `insert`, `batchUpdate`, `getContent`)
48+
- [ ] **Nested resource paths** are correct (e.g., `spreadsheets values get`, not `values get`)
49+
- [ ] **Alias** mentioned in the file matches `services.rs` (e.g., `gws script` for apps-script)
50+
- [ ] **API version** in the header is correct
51+
- [ ] **Example commands** use valid `--params` and `--json` flag syntax
52+
- [ ] **No OAuth scopes section** — scopes should not be listed in skill files
53+
- [ ] **Tips section** contains accurate, actionable advice
54+
55+
5. **Cross-check `shared/SKILL.md`** covers:
56+
57+
- [ ] `--fields` / field mask syntax
58+
- [ ] CLI syntax (`--params`, `--json`, `--output`, `--upload`, `--page-all`, `--page-limit`, `--page-delay`)
59+
- [ ] Authentication (`GOOGLE_WORKSPACE_CLI_CREDENTIALS`, `GOOGLE_WORKSPACE_API_KEY`)
60+
- [ ] Auto-pagination (`--page-all`) with NDJSON output
61+
- [ ] `gws schema <method>` introspection
62+
- [ ] Error handling JSON structure
63+
- [ ] Binary download with `--output`
64+
- [ ] Version override (`--api-version`, colon syntax)
65+
66+
6. **Fix any issues found** — update the SKILL.md files directly.
67+
68+
7. **Rebuild and re-verify** if any examples were changed.
69+
70+
// turbo
71+
```bash
72+
cargo build 2>&1
73+
```

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.env.example

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# OAuth Client Credentials
2+
# Create these at https://console.cloud.google.com/apis/credentials
3+
GOOGLE_WORKSPACE_CLI_CLIENT_ID=
4+
GOOGLE_WORKSPACE_CLI_CLIENT_SECRET=
5+
6+
# Authentication
7+
# Path to a service account JSON key file or user credentials
8+
# GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE=
9+
10+
# Impersonation (Domain-Wide Delegation)
11+
# Email address of the user to impersonate when using a service account
12+
# GOOGLE_WORKSPACE_CLI_IMPERSONATED_USER=
13+
14+
# Model Armor Sanitization
15+
# Default template resource name for --sanitize
16+
# GOOGLE_WORKSPACE_CLI_SANITIZE_TEMPLATE=projects/my-project/locations/us-central1/templates/my-template
17+
# Sanitization mode: 'warn' (default) or 'block'
18+
# GOOGLE_WORKSPACE_CLI_SANITIZE_MODE=warn

.github/CODEOWNERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Codeowners
2+
3+
# Core engine code strictly requires your review
4+
# Isolates agents to `skills/` or `src/helpers/` unless absolutely necessary
5+
/src/main.rs @jpoehnelt
6+
/src/executor.rs @jpoehnelt
7+
/src/discovery.rs @jpoehnelt
8+
/src/commands.rs @jpoehnelt
9+
/src/auth.rs @jpoehnelt
10+
/src/schema.rs @jpoehnelt

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Description
2+
3+
Please include a summary of the change and which issue is fixed. If adding a new feature or command, please include the output of running it with `--dry-run` to prove the JSON request body matches the Discovery Document schema.
4+
5+
**Dry Run Output:**
6+
```json
7+
// Paste --dry-run output here if applicable
8+
```
9+
10+
## Checklist:
11+
12+
- [ ] My code follows the `AGENTS.md` guidelines (no generated `google-*` crates).
13+
- [ ] I have run `cargo fmt --all` to format the code perfectly.
14+
- [ ] I have run `cargo clippy -- -D warnings` and resolved all warnings.
15+
- [ ] I have added tests that prove my fix is effective or that my feature works.
16+
- [ ] I have provided a Changeset file (e.g. via `pnpx changeset`) to document my changes.

.github/labeler.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
area: schema:
16+
- 'src/schema.rs'
17+
area: auth:
18+
- 'src/auth.rs'
19+
area: execution:
20+
- 'src/executor.rs'
21+
- 'src/commands.rs'
22+
- 'src/main.rs'
23+
area: discovery:
24+
- 'src/discovery.rs'
25+
skill: docs:
26+
- 'src/helpers/docs.rs'
27+
skill: drive:
28+
- 'src/helpers/drive.rs'
29+
skill: events:
30+
- 'src/helpers/events.rs'
31+
skill: gmail:
32+
- 'src/helpers/gmail.rs'
33+
skill: script:
34+
- 'src/helpers/script.rs'
35+
skill: sheets:
36+
- 'src/helpers/sheets.rs'
37+
core: docs:
38+
- '**/*.md'
39+
core: ci:
40+
- '.github/**/*'

0 commit comments

Comments
 (0)