Promote

From indigoai-us/hq-core · View interactive version

Promote is an AI agent skill from the GitHub repository indigoai-us/hq-core. Change an HQ company member role or guest path scope.

How to use this skill

Skill file

/promote — Change a Member's Role

Change an existing member's role on a company. Admin+ only.

Usage:

/promote <person-slug-or-uid> <owner|admin|member|guest> [--paths <docs/,shared/>] [--company <slug>]

Process

  1. Resolve auth — read the Cognito session from ~/.hq/cognito-tokens.json
  2. Resolve company — from --company flag, or active company via .hq/config.json
  3. Validate args — --paths is only valid with guest role
  4. Call vault-service — via VaultClient.updateRole() from @indigoai-us/hq-cloud
  5. Print result — updated role and any scope changes

Implementation

import { promote } from "@indigoai-us/hq-cloud";

const result = await promote({
  target: "psn_alice",
  newRole: "guest",
  paths: "docs/",
  company: "acme",
  callerUid: "<caller-person-uid>",
  vaultConfig: { apiUrl, authToken },
});

console.log(`Role updated to ${result.membership.role}`);

Output Format

On success:

Role updated for psn_alice on acme:
  member → guest
  Allowed paths: docs/

Next STS vend will reflect scoped credentials.

On error:

Permission denied — only admins and owners can change member roles.
Cannot leave company without an owner — promote another member to owner first.
Member "psn_alice" not found in this company.

Roles

| Role | Permissions |

|------|-------------|

| owner | Full control + delete entity |

| admin | Manage members + read/write all |

| member | Read/write unrestricted paths |

| guest | Scoped to --paths prefixes only |

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.