Design & UI v1.0.0

whoami-tool

Print the current effective username. Simple identity query for scripts, session tracking, and access control...

dinghaibin 更新于 2026-05-14 1 浏览
下载 SKILL

技能说明

Print the current effective username. Simple identity query for scripts, session tracking, and access control verification.

使用场景

Display the current effective username (and optionally uid/gid/group membership). Essential for scripts that need to verify permissions, log user context, or conditionally execute based on identity.

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

帮我下载并安装这个SKILL:https://skillhub.cstcloud.cn/download/whoami-tool
  1. 点击上方「下载 SKILL」按钮,获取技能压缩包。
  2. 将压缩包解压到你的 Agent 技能目录。
  3. 重启客户端后即可在技能列表中选择该技能。

技能文件内容

5 个文件 · 19 kB
SKILL.md text/markdown
---
name: whoami-tool
description: Print the current effective username. Simple identity query for scripts, session tracking, and access control verification.
---

# Whoami Tool — Current User Identity

Display the current effective username (and optionally uid/gid/group membership). Essential for scripts that need to verify permissions, log user context, or conditionally execute based on identity.

## Quick Start

```bash
# Show current username
whoami-tool

# Show full identity
whoami-tool --full
```

## Usage

```bash
whoami-tool [OPTIONS]

Options:
  --full         Show username, UID, GID, and primary group
  --uid          Show numeric user ID only
  --groups       Show all group memberships
  --json         Output as structured JSON
  --check USER   Exit 0 if current user matches, 1 if not
```

## Examples

```bash
# Basic username
whoami-tool

# Full user identity
whoami-tool --full

# Check if running as root (for privilege checks)
whoami-tool --check root && echo "Running as root"

# Show all groups
whoami-tool --groups

# JSON output for logging
whoami-tool --json

# UID for numeric comparisons
whoami-tool --uid
```

## Features

- **Quick identity** — one command to know who you are
- **Full mode** — UID, GID, primary group
- **Group membership** — all groups the user belongs to
- **Identity check** — conditional execution based on username
- **JSON output** — structured for logging and automation
- **Exit codes** — 0 = success, useful for script conditionals

文件内容直接读取自技能仓库,仅供安装前审阅;以实际下载的压缩包为准。