К основному содержанию
команда

gws-admin — команда для Claude Code: Google Workspace Admin SDK

Слэш-команда для Claude, которая выполняет операции Google Workspace Admin SDK: пользователи, группы, устройства, домены.

Установить в Claude Code · Через claude-code-templates Все способы и платформы ↓
npx claude-code-templates@latest --command google-workspace/gws-admin
Открыть на GitHub

Что делает gws-admin

Команда принимает ресурс, метод и флаги и превращает их в вызов gws admin <resource> <method> [flags]. Внутри — справочник по ресурсам Directory API: users, groups, members, chromeosdevices, mobiledevices, orgunits, roles, roleAssignments, schemas, domains, domainAliases, tokens, privileges, asps, channels, twoStepVerification, customers и resources.

Перед первым запуском нужен установленный Google Workspace CLI gws. Проверить авторизацию можно через gws auth status, а полный список команд — через gws admin --help. Без настроенной аутентификации команда не сработает: сначала gws auth status, потом уже вызовы.

Часть методов работает с оговорками. members list и mobiledevices list отваливаются по таймауту через 60 минут. chromeosdevices action помечен как устаревший — вместо него советуют BatchChangeChromeOsDeviceStatus. Деprovisioning устройства останавливает синхронизацию политик и удаляет принтеры, а само устройство придётся стирать перед повторной регистрацией. Вложенное членство в группах проверяется только внутри одного домена, для внешних сущностей нужен Cloud Identity Groups API.

Какие задачи решает

  • создать и удалить группу в домене
  • добавить пользователя в группу или убрать его оттуда
  • посмотреть список Chrome OS и мобильных устройств аккаунта
  • переместить устройства в организационное подразделение
  • выдать роль или проверить назначенные роли

Примеры запросов агенту

  • Покажи всех пользователей домена через gws admin users list
  • Добавь сотрудника в группу [email protected]
  • Перемести устройства в OU Sales

Как установить gws-admin

1Через claude-code-templates

npx claude-code-templates@latest --command google-workspace/gws-admin

2Вручную: положить файлы

.claude/commands/gws-admin.md

Вызов — /gws-admin. Для всех проектов — ~/.claude/commands/

Вопросы о gws-admin

Как установить gws-admin в Claude Code?

Через шаблоны: npx claude-code-templates@latest --command google-workspace/gws-admin. Файл команды появится по пути .claude/commands/gws-admin.md.

Что делает gws-admin?

Выполняет операции Google Workspace Admin SDK из Claude: управляет пользователями, группами, устройствами, доменами, ролями и схемами через CLI gws.

Что нужно для работы gws-admin?

Установленный Google Workspace CLI gws и настроенная аутентификация. Проверить её можно командой gws auth status.

Исходный текст

gws-admin.md · MIT
---
allowed-tools: Bash, Read, Write, Edit
argument-hint: "[resource] [method] [flags]"
description: "Google Workspace Admin SDK: Manage users, groups, and devices."
---

# Google Workspace Admin

Execute Google Workspace Admin operations: $ARGUMENTS

## Prerequisites

- Google Workspace CLI (`gws`) must be installed
- Authentication configured: Run `gws auth status` to verify
- Review `gws admin --help` for all available commands

## Available Resources and Methods

# admin (directory_v1)

> **PREREQUISITE:** Read `../gws-shared/SKILL.md` for auth, global flags, and security rules. If missing, run `gws generate-skills` to create it.

```bash
gws admin <resource> <method> [flags]
```

## API Resources

### asps

  - `delete` — Deletes an ASP issued by a user.
  - `get` — Gets information about an ASP issued by a user.
  - `list` — Lists the ASPs issued by a user.

### channels

  - `stop` — Stops watching resources through this channel.

### chromeosdevices

  - `action` — Use [BatchChangeChromeOsDeviceStatus](https://developers.google.com/workspace/admin/directory/reference/rest/v1/customer.devices.chromeos/batchChangeStatus) instead. Takes an action that affects a Chrome OS Device. This includes deprovisioning, disabling, and re-enabling devices. *Warning:* * Deprovisioning a device will stop device policy syncing and remove device-level printers. After a device is deprovisioned, it must be wiped before it can be re-enrolled.
  - `get` — Retrieves a Chrome OS device's properties.
  - `list` — Retrieves a paginated list of Chrome OS devices within an account.
  - `moveDevicesToOu` — Moves or inserts multiple Chrome OS devices to an organizational unit. You can move up to 50 devices at once.
  - `patch` — Updates a device's updatable properties, such as `annotatedUser`, `annotatedLocation`, `notes`, `orgUnitPath`, or `annotatedAssetId`. This method supports [patch semantics](https://developers.google.com/workspace/admin/directory/v1/guides/performance#patch).
  - `update` — Updates a device's updatable properties, such as `annotatedUser`, `annotatedLocation`, `notes`, `orgUnitPath`, or `annotatedAssetId`.

### customer

  - `devices` — Operations on the 'devices' resource

### customers

  - `get` — Retrieves a customer.
  - `patch` — Patches a customer.
  - `update` — Updates a customer.
  - `chrome` — Operations on the 'chrome' resource

### domainAliases

  - `delete` — Deletes a domain Alias of the customer.
  - `get` — Retrieves a domain alias of the customer.
  - `insert` — Inserts a domain alias of the customer.
  - `list` — Lists the domain aliases of the customer.

### domains

  - `delete` — Deletes a domain of the customer.
  - `get` — Retrieves a domain of the customer.
  - `insert` — Inserts a domain of the customer.
  - `list` — Lists the domains of the customer.

### groups

  - `delete` — Deletes a group.
  - `get` — Retrieves a group's properties.
  - `insert` — Creates a group.
  - `list` — Retrieves all groups of a domain or of a user given a userKey (paginated).
  - `patch` — Updates a group's properties. This method supports [patch semantics](https://developers.google.com/workspace/admin/directory/v1/guides/performance#patch).
  - `update` — Updates a group's properties.
  - `aliases` — Operations on the 'aliases' resource

### members

  - `delete` — Removes a member from a group.
  - `get` — Retrieves a group member's properties.
  - `hasMember` — Checks whether the given user is a member of the group. Membership can be direct or nested, but if nested, the `memberKey` and `groupKey` must be entities in the same domain or an `Invalid input` error is returned. To check for nested memberships that include entities outside of the group's domain, use the [`checkTransitiveMembership()`](https://cloud.google.com/identity/docs/reference/rest/v1/groups.memberships/checkTransitiveMembership) method in the Cloud Identity Groups API.
  - `insert` — Adds a user to the specified group.
  - `list` — Retrieves a paginated list of all members in a group. This method times out after 60 minutes. For more information, see [Troubleshoot error codes](https://developers.google.com/workspace/admin/directory/v1/guides/troubleshoot-error-codes).
  - `patch` — Updates the membership properties of a user in the specified group. This method supports [patch semantics](https://developers.google.com/workspace/admin/directory/v1/guides/performance#patch).
  - `update` — Updates the membership of a user in the specified group.

### mobiledevices

  - `action` — Takes an action that affects a mobile device. For example, remotely wiping a device.
  - `delete` — Removes a mobile device.
  - `get` — Retrieves a mobile device's properties.
  - `list` — Retrieves a paginated list of all user-owned mobile devices for an account. To retrieve a list that includes company-owned devices, use the Cloud Identity [Devices API](https://cloud.google.com/identity/docs/concepts/overview-devices) instead. This method times out after 60 minutes. For more information, see [Troubleshoot error codes](https://developers.google.com/workspace/admin/directory/v1/guides/troubleshoot-error-codes).

### orgunits

  - `delete` — Removes an organizational unit.
  - `get` — Retrieves an organizational unit.
  - `insert` — Adds an organizational unit.
  - `list` — Retrieves a list of all organizational units for an account.
  - `patch` — Updates an organizational unit. This method supports [patch semantics](https://developers.google.com/workspace/admin/directory/v1/guides/performance#patch)
  - `update` — Updates an organizational unit.

### privileges

  - `list` — Retrieves a paginated list of all privileges for a customer.

### resources

  - `buildings` — Operations on the 'buildings' resource
  - `calendars` — Operations on the 'calendars' resource
  - `features` — Operations on the 'features' resource

### roleAssignments

  - `delete` — Deletes a role assignment.
  - `get` — Retrieves a role assignment.
  - `insert` — Creates a role assignment.
  - `list` — Retrieves a paginated list of all roleAssignments.

### roles

  - `delete` — Deletes a role.
  - `get` — Retrieves a role.
  - `insert` — Creates a role.
  - `list` — Retrieves a paginated list of all the roles in a domain.
  - `patch` — Patches a role.
  - `update` — Updates a role.

### schemas

  - `delete` — Deletes a schema.
  - `get` — Retrieves a schema.
  - `insert` — Creates a schema.
  - `list` — Retrieves all schemas for a customer.
  - `patch` — Patches a schema.
  - `update` — Updates a schema.

### tokens

  - `delete` — Deletes all access tokens issued by a user for an application.
  - `get` — Gets information about an access token issued by a user.
  - `list` — Returns the set of tokens specified user has issued to 3rd party applications.

### twoStepVerification

  - `turnOff` — Turns off 2-Step Verification for user.

### users

  - `createGuest` — Create a guest user with access to a [subset of Workspace capabilities](https://support.google.com/a/answer/16558545). This feature is currently in Alpha. Please reach out to support if you are interested in trying this feature.
  - `delete` — Deletes a user.
  - `get` — Retrieves a user.
  - `insert` — Creates a user. Mutate calls immediately following user creation might sometimes fail as the user isn't fully created due to propagation delay in our backends. Check the error details for the "User creation is not complete" message to see if this is the case. Retrying the calls after some time can help in this case. If `resolveConflictAccount` is set to `true`, a `202` response code means that a conflicting unmanaged account exists and was invited to join the organization.
  - `list` — Retrieves a paginated list of either deleted users or all users in a domain.
  - `makeAdmin` — Makes a user a super administrator.
  - `patch` — Updates a user using patch semantics. The update method should be used instead, because it also supports patch semantics and has better performance. If you're mapping an external identity to a Google identity, use the [`update`](https://developers.google.com/workspace/admin/directory/v1/reference/users/update) method instead of the `patch` method. This method is unable to clear fields that contain repeated objects (`addresses`, `phones`, etc). Use the update method instead.
  - `signOut` — Signs a user out of all web and device sessions and reset their sign-in cookies. User will have to sign in by authenticating again.
  - `undelete` — Undeletes a deleted user.
  - `update` — Updates a user. This method supports patch semantics, meaning that you only need to include the fields you wish to update. Fields that are not present in the request will be preserved, and fields set to `null` will be cleared. For repeating fields that contain arrays, individual items in the array can't be patched piecemeal; they must be supplied in the request body with the desired values for all items.
  - `watch` — Watches for changes in users list.
  - `aliases` — Operations on the 'aliases' resource
  - `photos` — Operations on the 'photos' resource

### verificationCodes

  - `generate` — Generates new backup verification codes for the user.
  - `invalidate` — Invalidates the current backup verification codes for the user.
  - `list` — Returns the current set of valid backup verification codes for the specified user.

## Discovering Commands

Before calling any API method, inspect it:

```bash
# Browse resources and methods
gws admin --help

# Inspect a method's required params, types, and defaults
gws schema admin.<resource>.<method>
```

Use `gws schema` output to build your `--params` and `--json` flags.

## Usage

```bash
# List available resources and methods
gws admin --help

# Inspect method schema before calling
gws schema admin.<resource>.<method>

# Execute command with arguments
gws admin $ARGUMENTS
```

## Task

Execute the requested Admin operation: $ARGUMENTS

1. **Verify Prerequisites**
   - Check `gws` is installed: `gws --version`
   - Verify authentication: `gws auth status`
   - Review available commands: `gws admin --help`

2. **Inspect Method Schema**
   - Before calling any method, inspect its parameters
   - Use `gws schema` to understand required fields
   - Review parameter types and constraints

3. **Execute Operation**
   - Build command with appropriate flags
   - Use `--params` for query/path parameters
   - Use `--json` for request body
   - Handle pagination with `--max-results` or `--page-token`

4. **Error Handling**
   - Check command output for errors
   - Review API quotas and rate limits
   - Handle authentication issues
   - Retry transient failures

---

**License**: Apache License 2.0
**Source**: [Google Workspace CLI](https://github.com/googleworkspace/cli)
**Original Skill**: `gws-admin`

© davila7 · MIT · davila7/claude-code-templates

Похожие слэш-команды

Всё по теме «Облака: AWS, Azure, GCP» →

Из того же набора361

Весь набор →
gws-sheets Слэш-команда запускает операции Google Sheets через CLI gws: чтение значений, запись строк, создание таблиц и пакетные обновления. 77установок server-management Скилл для Claude, который учит агента думать о процессах, мониторинге, логах и масштабировании продакшена, а не заучивать команды. 76установок resume-ats-optimizer Разбирает резюме так же, как это делает софт для скрининга: ищет ключевые слова из вакансии, ломающую парсинг вёрстку и считает процент совпадения. 75установок android-cicd Скилл настраивает сборку и публикацию Android-приложения в Google Play через GitHub Actions: мастер сам определит фреймворк и разложит секреты. 74установок threat-modeling-expert Скилл для разбора архитектуры на угрозы: строит деревья атак, считает риски и вытаскивает требования по безопасности. 73установок gws-workflow-meeting-prep Собирает повестку, участников и привязанные документы по ближайшему событию в календаре. Пригодится перед звонком, когда некогда листать приглашение. 72установок gws-apps-script Команда для работы с проектами Google Apps Script через CLI: создание, обновление кода, запуск скриптов и проверка метрик выполнения. 72установок fine-tuning-peft Скилл для дообучения больших языковых моделей через LoRA, QLoRA и другие адаптерные методы, когда видеопамяти мало. 71установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой