# CLI 命令

本参考描述的是 CLI 1.2.3 版。本页中的每个命令都使用您的凭据调用 Tomba API，因此会像其调用的端点一样消耗积分并计入您的限制：请参阅[积分消耗](/usage-and-quotas#credit-costs)和[速率限制](/rate-limits)。有单独页面的命令：[`tomba bulk`](/cli/bulk)、[`tomba chat`](/cli/chat)、[`tomba serve`](/cli/http)、[`tomba skill`](/cli/skill)、[`tomba login` 和 `tomba logout`](/cli/authentication)，以及 [`tomba version`、`tomba completion` 和 `tomba update`](/cli/installation)。

## 全局标志

所有命令都接受以下标志。

| 标志         | 简写 | 类型   | 默认值 | 说明                                                                                                         |
| ------------ | ----- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------- |
| `--target`   | `-t`  | string | —       | 命令的输入：域名、邮箱地址、URL 或文本，具体取决于命令。                               |
| `--json`     | `-j`  | bool   | `false` | 以 JSON 格式输出响应。                                                                                         |
| `--yaml`     | `-y`  | bool   | `false` | 以 YAML 格式输出响应。优先于 `--json`。                                                                     |
| `--csv`      | —     | bool   | `false` | 以 CSV 格式输出响应的 `data`。                                                                                 |
| `--output`   | `-o`  | string | —       | 同时将响应以 JSON 格式写入此文件。对于 `tomba bulk` 和 `tomba chat --file`，则为输出 CSV 的路径。 |
| `--key`      | `-k`  | string | —       | API 密钥。请参阅[按命令传递凭据](/cli/authentication#pass-credentials-per-command)。                      |
| `--secret`   | `-s`  | string | —       | API Secret。                                                                                                         |
| `--no-color` | —     | bool   | `false` | 禁用彩色输出。将 `NO_COLOR` 环境变量设置为任意值也有同样效果。                     |
| `--port`     | `-p`  | int    | `3000`  | [`tomba serve`](/cli/http) 使用的端口。其他命令会忽略此标志。                                                      |
| `--verbose`  | —     | bool   | `false` | 可以传入，但没有任何效果。                                                                                        |
| `--help`     | `-h`  | —      | —       | 显示任意命令的帮助信息。                                                                                          |

## 输出和错误

默认情况下，命令会输出格式化的摘要。`--json` 以 JSON 格式输出响应，仅当输出目标为终端时才进行语法着色。`--yaml` 的输出始终包含终端颜色代码，即使使用 `--no-color` 也是如此，因此在重定向或解析输出时请使用 `--json`。`--csv` 适用于扁平结构的响应；嵌套对象不会被展开。

`lead`、`leads-list`、`attribute`、`key` 和 `flag` 的 list 子命令会在文本输出中为各行编号，但不显示 ID。使用 `--json` 运行这些子命令，即可获取 `get`、`update` 和 `delete` 所需的 `id` 值。

当请求失败，或者 `search`、`finder`、`author`、`enrich`、`linkedin`、`verify`、`sources` 或 `count` 没有结果时，CLI 会输出一条简短消息而不是响应，即使使用 `--json` 也是如此。API 错误显示为 `error: <HTTP status>, status code: <code>`，例如 `error: 429 Too Many Requests, status code: 429`；不会显示响应体。请参阅[状态码](/error-handling#status-codes)。在所有这些情况下，退出状态均为 `0`；只有用法错误（例如未知标志或缺少标志）才会以 `1` 退出。在脚本中，请解析输出而不是退出状态，并添加 `--no-color`。

## 别名

| 别名     | 运行                    |
| --------- | ----------------------- |
| `a`       | `tomba author`          |
| `ai`      | `tomba chat`            |
| `b`       | `tomba bulk`            |
| `c`       | `tomba count`           |
| `e`       | `tomba enrich`          |
| `l`       | `tomba linkedin`        |
| `pf`      | `tomba phone-finder`    |
| `pv`      | `tomba phone-validator` |
| `r`       | `tomba reveal`          |
| `s`       | `tomba finder`          |
| `sim`     | `tomba similar`         |
| `sk`      | `tomba skill`           |
| `t`       | `tomba status`          |
| `tech`    | `tomba technology`      |
| `upgrade` | `tomba update`          |
| `w`       | `tomba whoami`          |

`tomba search` 和 `tomba sources` 的帮助信息列出了别名 `s`，`tomba verify` 的帮助信息列出了 `t`，但这些别名实际运行的是 `tomba finder` 和 `tomba status`。

## `tomba search`

查找 Tomba 掌握的某个域名下的邮箱地址。调用 [`GET /v1/domain-search`](/api/finder#domain-search)。

```text
tomba search --target <domain> [--limit 10|20|50] [--page <n>]
```

| 标志           | 简写 | 类型   | 默认值 | 说明                                                                                                                          |
| -------------- | ----- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `--target`     | `-t`  | string | —       | 要搜索的域名。必填。                                                                                                          |
| `--limit`      | —     | int    | `10`    | 每页地址数：`10`、`20` 或 `50`。CLI 会拒绝其他值。该值会影响[积分消耗](/usage-and-quotas#credit-costs)。 |
| `--page`       | —     | int    | `1`     | 结果页码。                                                                                                                     |
| `--department` | —     | string | —       | 没有效果：CLI 不会将其发送到 API。                                                                                   |

```bash
tomba search --target stripe.com
tomba search --target stripe.com --limit 50 --page 2
tomba search --target stripe.com --json --output stripe.json
```

文本输出会先显示组织信息，然后是邮箱地址表，包含姓名、职位、部门和置信度评分。Free 套餐会限制 `--limit` 和 `--page`；请参阅 [Free 套餐限制](/usage-and-quotas#free-plan-limits)。

## `tomba finder`

根据人员姓名和公司域名查找其邮箱地址。调用 [`GET /v1/email-finder`](/api/finder#email-finder)。

```text
tomba finder --target <domain> --first <first name> --last <last name> [--enrich-mobile]
tomba finder --target <domain> --full "<full name>" [--enrich-mobile]
```

| 标志              | 简写 | 类型   | 默认值 | 说明                                                                                           |
| ----------------- | ----- | ------ | ------- | ----------------------------------------------------------------------------------------------------- |
| `--target`        | `-t`  | string | —       | 公司域名。必填。                                                                             |
| `--first`         | `-f`  | string | —       | 名字。与 `--last` 一起使用。                                                                        |
| `--last`          | `-l`  | string | —       | 姓氏。与 `--first` 一起使用。                                                                        |
| `--full`          | —     | string | —       | 全名，代替 `--first` 和 `--last`。当两者都已设置时会被忽略。                              |
| `--enrich-mobile` | —     | bool   | `false` | 同时返回该人员的电话号码。电话数据会改变[积分消耗](/usage-and-quotas#credit-costs)。 |

```bash
tomba finder --target stripe.com --first Jane --last Doe
tomba finder --target stripe.com --full "Jane Doe" --enrich-mobile
```

## `tomba author`

查找文章作者的邮箱地址。调用 [`GET /v1/author-finder`](/api/finder#author-finder)。

```text
tomba author --target <article URL>
```

| 标志       | 简写 | 类型   | 默认值 | 说明                   |
| ---------- | ----- | ------ | ------- | ----------------------------- |
| `--target` | `-t`  | string | —       | 文章的 URL。必填。 |

```bash
tomba author --target "https://stripe.com/blog/example-article"
```

## `tomba enrich`

查找邮箱地址背后的人员：姓名、职位、公司、社交资料和来源。调用 [`GET /v1/enrich`](/api/finder#email-enrichment)。如需分别获取人员和公司资料，请使用 [`tomba enrichment`](#tomba-enrichment)。

```text
tomba enrich --target <email> [--enrich-mobile]
```

| 标志              | 简写 | 类型   | 默认值 | 说明                                                                                           |
| ----------------- | ----- | ------ | ------- | ----------------------------------------------------------------------------------------------------- |
| `--target`        | `-t`  | string | —       | 邮箱地址。必填。                                                                              |
| `--enrich-mobile` | —     | bool   | `false` | 同时返回该人员的电话号码。电话数据会改变[积分消耗](/usage-and-quotas#credit-costs)。 |

```bash
tomba enrich --target jane.doe@stripe.com
tomba enrich --target jane.doe@stripe.com --enrich-mobile --json
```

## `tomba enrichment`

获取人员资料、公司资料或两者。每个子命令都通过 `--target` 接收输入，没有其他标志。

```text
tomba enrichment person --target <email>
tomba enrichment company --target <domain>
tomba enrichment combined --target <email>
```

### `tomba enrichment person`

获取拥有某个邮箱地址的人员的资料。调用 [`GET /v1/people/find`](/api/enrichment#person-api)。

```bash
tomba enrichment person --target jane.doe@stripe.com
```

### `tomba enrichment company`

获取某个域名背后的公司资料。调用 [`GET /v1/companies/find`](/api/enrichment#company-api)。

```bash
tomba enrichment company --target stripe.com
```

### `tomba enrichment combined`

通过单个请求获取某个邮箱地址的人员和公司资料。调用 [`GET /v1/combined/find`](/api/enrichment#combined-api)。

```bash
tomba enrichment combined --target jane.doe@stripe.com --json
```

## `tomba verify`

检查邮箱地址是否可送达。调用 [`GET /v1/email-verifier`](/api/verifier#email-verifier)。关于 `status` 和 `result` 值的含义，请参阅[邮箱验证响应](/attributes/verifier)。

```text
tomba verify --target <email>
```

| 标志       | 简写 | 类型   | 默认值 | 说明              |
| ---------- | ----- | ------ | ------- | ------------------------ |
| `--target` | `-t`  | string | —       | 邮箱地址。必填。 |

```bash
tomba verify --target jane.doe@stripe.com
tomba verify --target jane.doe@stripe.com --json
```

对于网页邮箱或一次性邮箱域名的地址，CLI 会输出警告而不是结果，即使使用 `--json` 也是如此。验证仍会照常运行并消耗积分。

## `tomba linkedin`

查找 LinkedIn 个人资料对应的邮箱地址。调用 [`GET /v1/linkedin`](/api/finder#linkedin-finder)。

```text
tomba linkedin --target <profile URL> [--enrich-mobile]
```

| 标志              | 简写 | 类型   | 默认值 | 说明                                                                                           |
| ----------------- | ----- | ------ | ------- | ----------------------------------------------------------------------------------------------------- |
| `--target`        | `-t`  | string | —       | LinkedIn 个人资料 URL。必填。                                                                       |
| `--enrich-mobile` | —     | bool   | `false` | 同时返回该人员的电话号码。电话数据会改变[积分消耗](/usage-and-quotas#credit-costs)。 |

```bash
tomba linkedin --target "https://www.linkedin.com/in/jane-doe-example"
```

## `tomba sources`

列出 Tomba 找到某个邮箱地址的公开网页。调用 [`GET /v1/email-sources`](/api/email#email-sources)。

```text
tomba sources --target <email>
```

| 标志       | 简写 | 类型   | 默认值 | 说明              |
| ---------- | ----- | ------ | ------- | ------------------------ |
| `--target` | `-t`  | string | —       | 邮箱地址。必填。 |

```bash
tomba sources --target jane.doe@stripe.com
```

## `tomba count`

按部门和资历统计 Tomba 掌握的某个域名下的邮箱地址数量。调用 [`GET /v1/email-count`](/api/finder#email-count)。

```text
tomba count --target <domain>
```

| 标志       | 简写 | 类型   | 默认值 | 说明       |
| ---------- | ----- | ------ | ------- | ----------------- |
| `--target` | `-t`  | string | —       | 域名。必填。 |

```bash
tomba count --target stripe.com
```

## `tomba status`

检查某个域名是否属于网页邮箱或一次性邮箱服务商。调用 [`GET /v1/domain-status`](/api/domain#domain-status)。

```text
tomba status --target <domain>
```

| 标志       | 简写 | 类型   | 默认值 | 说明       |
| ---------- | ----- | ------ | ------- | ----------------- |
| `--target` | `-t`  | string | —       | 域名。必填。 |

```bash
tomba status --target gmail.com
```

## `tomba format`

获取某个域名使用的邮箱地址格式，例如 `{first}.{last}`。调用 [`GET /v1/email-format`](/api/finder#email-format)。

```text
tomba format --target <domain>
```

| 标志       | 简写 | 类型   | 默认值 | 说明       |
| ---------- | ----- | ------ | ------- | ----------------- |
| `--target` | `-t`  | string | —       | 域名。必填。 |

```bash
tomba format --target stripe.com
```

## `tomba location`

按所在地获取公司的员工人数。调用 [`GET /v1/location`](/api/finder#location)。

```text
tomba location --target <domain>
```

| 标志       | 简写 | 类型   | 默认值 | 说明       |
| ---------- | ----- | ------ | ------- | ----------------- |
| `--target` | `-t`  | string | —       | 域名。必填。 |

```bash
tomba location --target stripe.com
```

## `tomba autocomplete`

根据部分名称推荐公司，并附带其域名和邮箱数量。调用 [`GET /v1/domain-suggestions`](/api/domain-suggestions#get-domain-suggestions)。

```text
tomba autocomplete --target <text>
```

| 标志       | 简写 | 类型   | 默认值 | 说明                                            |
| ---------- | ----- | ------ | ------- | ------------------------------------------------------ |
| `--target` | `-t`  | string | —       | 公司名称或域名，可以是完整的或部分的。必填。 |

```bash
tomba autocomplete --target strip
```

## `tomba phone-finder`

通过邮箱地址、域名或 LinkedIn 个人资料查找电话号码。调用 [`GET /v1/phone-finder`](/api/phone#phone-finder)。

```text
tomba phone-finder --email <email> [--full]
tomba phone-finder --domain <domain> [--full]
tomba phone-finder --linkedin <profile URL> [--full]
```

| 标志         | 简写 | 类型   | 默认值 | 说明                                             |
| ------------ | ----- | ------ | ------- | ------------------------------------------------------- |
| `--email`    | —     | string | —       | 要查询的邮箱地址。                               |
| `--domain`   | —     | string | —       | 要查询的域名。                                      |
| `--linkedin` | —     | string | —       | 要查询的 LinkedIn 个人资料 URL。                        |
| `--full`     | —     | bool   | `false` | 返回找到的所有电话号码，而不是只返回 1 个。         |
| `--target`   | `-t`  | string | —       | 当 3 个输入均未设置时，用作 `--email`。 |

只传入 1 个输入。如果传入多个，CLI 只会发送 `--email`、`--domain` 和 `--linkedin` 中的第一个。输入类型会影响[积分消耗](/usage-and-quotas#credit-costs)。

```bash
tomba phone-finder --email jane.doe@stripe.com
tomba phone-finder --domain stripe.com --full
tomba phone-finder --linkedin "https://www.linkedin.com/in/jane-doe-example"
```

## `tomba phone-validator`

检查电话号码是否有效，并获取其格式、线路类型和运营商。调用 [`GET /v1/phone-validator`](/api/phone#phone-validator)。

```text
tomba phone-validator --phone <number> [--country-code <code>]
```

| 标志             | 简写 | 类型   | 默认值 | 说明                                                                                       |
| ---------------- | ----- | ------ | ------- | ------------------------------------------------------------------------------------------------- |
| `--phone`        | —     | string | —       | 要验证的号码，采用国际格式；如果使用 `--country-code`，则可采用本地格式。必填。 |
| `--country-code` | —     | string | —       | 用于解析本地号码的 2 位字母国家代码，例如 `US`。                                 |

```bash
tomba phone-validator --phone "+14155552671"
tomba phone-validator --phone 4155552671 --country-code US
```

## `tomba reveal`

使用自然语言查询或筛选条件搜索公司。调用 [`POST /v1/reveal/search`](/api/reveal#search-companies)。

```text
tomba reveal --query "<description>" [--page <n>]
tomba reveal [filter flags] [--page <n>]
```

请使用 `--query` 或筛选标志，不要同时使用：API 会拒绝同时包含两者的请求。每个筛选标志接受逗号分隔的列表，您也可以重复使用该标志；CLI 会将这些值作为 `include` 筛选条件发送。可接受的值列在[搜索公司](/api/reveal#search-companies)中。

| 标志             | 简写 | 类型    | 默认值 | 说明                                                                  |
| ---------------- | ----- | ------- | ------- | ---------------------------------------------------------------------------- |
| `--query`        | `-q`  | string  | —       | 要查找的公司的描述，例如 `Fintech companies in France`。 |
| `--page`         | —     | int     | `1`     | 结果页码。                                                             |
| `--country`      | —     | strings | —       | 国家代码（ISO 3166-1 alpha-2），例如 `US,GB`。                         |
| `--state`        | —     | strings | —       | 州或地区。                                                           |
| `--city`         | —     | strings | —       | 城市。                                                                      |
| `--industry`     | —     | strings | —       | 行业。                                                                  |
| `--size`         | —     | strings | —       | 员工人数范围，例如 `51-250`。                                     |
| `--type`         | —     | strings | —       | 公司类型。                                                               |
| `--keywords`     | —     | strings | —       | 关键词。                                                                    |
| `--founded`      | —     | strings | —       | 成立年份范围。                                                        |
| `--technologies` | —     | strings | —       | 公司使用的技术。                                               |
| `--similar`      | —     | strings | —       | 用于查找相似公司的参照公司域名。                                 |
| `--revenue`      | —     | strings | —       | 营收范围。                                                              |
| `--sic`          | —     | strings | —       | SIC 代码。                                                                   |
| `--naics`        | —     | strings | —       | NAICS 代码。                                                                 |

```bash
tomba reveal --query "Fintech companies in France"
tomba reveal --country US,GB --size 51-250,251-1K
tomba reveal --country FR --size 51-250 --page 2 --json
```

在 Free 套餐中，公司搜索只返回第一页，并会忽略部分筛选条件；请参阅 [Free 套餐限制](/usage-and-quotas#free-plan-limits)。

## `tomba similar`

查找与某个域名相似的公司。调用 [`GET /v1/similar`](/api/domain#similar)。

```text
tomba similar --target <domain>
```

| 标志       | 简写 | 类型   | 默认值 | 说明       |
| ---------- | ----- | ------ | ------- | ----------------- |
| `--target` | `-t`  | string | —       | 域名。必填。 |

```bash
tomba similar --target stripe.com
```

## `tomba technology`

列出在某个域名的网站上检测到的技术。调用 [`GET /v1/technology`](/api/domain#technology)。

```text
tomba technology --target <domain>
```

| 标志       | 简写 | 类型   | 默认值 | 说明       |
| ---------- | ----- | ------ | ------- | ----------------- |
| `--target` | `-t`  | string | —       | 域名。必填。 |

```bash
tomba technology --target stripe.com
```

## `tomba flag`

报告 Tomba 中有误的数据（例如已退信的邮箱地址），并列出您的报告。部分报告经确认后会返还 1 个积分；请参阅[错误数据的积分返还](/usage-and-quotas#refunds-for-incorrect-data)。

### `tomba flag create`

报告一项数据。调用 [`POST /v1/flag`](/api/flag#flag-incorrect-data)。

```text
tomba flag create --type <type> --value <item> --reason <reason> [--comment <text>]
```

| 标志        | 简写 | 类型   | 默认值 | 说明                                                                                            |
| ----------- | ----- | ------ | ------- | ------------------------------------------------------------------------------------------------------ |
| `--type`    | —     | string | —       | 条目类型：`email`、`organization`、`phone`、`author_url` 或 `website`。必填。                  |
| `--value`   | —     | string | —       | 条目本身：邮箱地址、域名、电话号码或 URL。必填。                                    |
| `--reason`  | —     | string | —       | 数据有误的原因。有效原因取决于 `--type`；`tomba flag create --help` 会列出这些原因。必填。 |
| `--comment` | —     | string | —       | 可选的详细信息。                                                                                      |

```bash
tomba flag create --type email --value jane.doe@stripe.com --reason hard_bounce
tomba flag create --type phone --value "+14155552671" --reason wrong_phone --comment "Number disconnected"
```

### `tomba flag list`

列出您的报告及其审核状态。调用 [`GET /v1/flag`](/api/flag#list-my-flags)。文本输出中被报告的条目显示为空白；请使用 `--json`。

| 标志      | 简写 | 类型 | 默认值 | 说明       |
| --------- | ----- | ---- | ------- | ----------------- |
| `--page`  | —     | int  | `1`     | 结果页码。  |
| `--limit` | —     | int  | `10`    | 每页报告数。 |

```bash
tomba flag list --json
```

## `tomba lead`

管理您账户中保存的线索。使用 `tomba lead list --json` 获取线索 ID。

```text
tomba lead list [--page <n>] [--limit <n>]
tomba lead get --id <id>
tomba lead create --email <email> --list-id <id> [--first-name <name>] [--last-name <name>]
tomba lead update --id <id> [--email <email>] [--first-name <name>] [--last-name <name>]
tomba lead delete --id <id>
```

### `tomba lead list`

列出线索，最新的在前。调用 [`GET /v1/leads`](/api/leads#retrieve-leads)。

| 标志       | 简写 | 类型   | 默认值 | 说明                                            |
| ---------- | ----- | ------ | ------- | ------------------------------------------------------ |
| `--page`   | —     | int    | `1`     | 结果页码。                                       |
| `--limit`  | —     | int    | `10`    | 每页线索数。                                        |
| `--domain` | —     | string | —       | 没有效果：API 不会按域名筛选线索。 |

### `tomba lead get`

获取单条线索。调用 [`GET /v1/leads/{id}`](/api/leads#retrieve-a-single-lead)。需要 `--id`。

### `tomba lead create`

保存一条线索。调用 [`POST /v1/leads`](/api/leads#create-a-lead)。

| 标志           | 简写 | 类型   | 默认值 | 说明                                                    |
| -------------- | ----- | ------ | ------- | -------------------------------------------------------------- |
| `--email`      | —     | string | —       | 邮箱地址。必填。                                       |
| `--list-id`    | —     | string | —       | 线索列表 ID。CLI 要求必填，但不会生效：请参阅下文。 |
| `--first-name` | —     | string | —       | 名字。                                                    |
| `--last-name`  | —     | string | —       | 姓氏。                                                     |

CLI 将 `--list-id` 作为字符串发送，而 API 不接受字符串形式的列表 ID，因此线索保存时不会加入任何列表。要将线索添加到列表，请使用仪表板，或使用带数字 `list_id` 的 [`POST /v1/leads`](/api/leads#create-a-lead)。

```bash
tomba lead create --email jane.doe@stripe.com --list-id 1 --first-name Jane --last-name Doe
```

### `tomba lead update`

更改线索的邮箱地址或姓名。调用 [`PUT /v1/leads/{id}`](/api/leads#update-a-lead)。

| 标志           | 简写 | 类型   | 默认值 | 说明        |
| -------------- | ----- | ------ | ------- | ------------------ |
| `--id`         | —     | string | —       | 线索 ID。必填。 |
| `--email`      | —     | string | —       | 新的邮箱地址。 |
| `--first-name` | —     | string | —       | 新的名字。    |
| `--last-name`  | —     | string | —       | 新的姓氏。     |

### `tomba lead delete`

删除一条线索。调用 [`DELETE /v1/leads/{id}`](/api/leads#delete-a-lead)。需要 `--id`。

## `tomba leads-list`

管理线索列表。使用 `tomba leads-list list --json` 获取列表 ID。

```text
tomba leads-list list
tomba leads-list get --id <id>
tomba leads-list create --name <name>
tomba leads-list update --id <id> --name <name>
tomba leads-list delete --id <id>
```

### `tomba leads-list list`

列出您的线索列表。调用 [`GET /v1/leads_lists`](/api/lead-lists#retrieve-leads-lists)。不接受任何标志。

### `tomba leads-list get`

获取单个列表。调用 [`GET /v1/leads_lists/{id}`](/api/lead-lists#retrieve-a-single-leads-list)。需要 `--id`。

### `tomba leads-list create`

创建列表。调用 [`POST /v1/leads_lists`](/api/lead-lists#create-leads-list)。需要 `--name`。

```bash
tomba leads-list create --name "Q3 prospects"
```

### `tomba leads-list update`

重命名列表。调用 [`PUT /v1/leads_lists/{id}`](/api/lead-lists#update-leads-list)。需要 `--id` 和 `--name`。

### `tomba leads-list delete`

删除列表。调用 [`DELETE /v1/leads_lists/{id}`](/api/lead-lists#delete-leads-list)。需要 `--id`。

## `tomba attribute`

管理自定义线索属性。使用 `tomba attribute list --json` 获取属性 ID。

```text
tomba attribute list
tomba attribute get --id <id>
tomba attribute create --name <name> --type <type>
tomba attribute delete --id <id>
```

### `tomba attribute list`

列出您的自定义属性。调用 [`GET /v1/attributes`](/api/lead-attributes#retrieve-lead-attributes)。不接受任何标志。

### `tomba attribute get`

获取单个属性。调用 [`GET /v1/attributes/{id}`](/api/lead-attributes#retrieve-a-single-lead-attribute)。需要 `--id`。

### `tomba attribute create`

创建属性。调用 [`POST /v1/attributes`](/api/lead-attributes#create-a-lead-attribute)。需要 `--name` 和 `--type`；可接受的类型列在[创建线索属性](/api/lead-attributes#create-a-lead-attribute)中。

```bash
tomba attribute create --name "Company size" --type string
```

### `tomba attribute update`

使用 `--id` 和 `--name` 调用 [`PUT /v1/attributes/{id}`](/api/lead-attributes#update-a-lead-attribute)。API 还要求提供属性的 `type`，而 CLI 不会发送该字段，因此此子命令会以 `error: 422 Unprocessable Entity` 失败。请在仪表板中或通过 API 重命名属性。

### `tomba attribute delete`

删除属性。调用 [`DELETE /v1/attributes/{id}`](/api/lead-attributes#delete-a-lead-attribute)。需要 `--id`。

## `tomba key`

管理您工作区的 API 密钥。关于密钥如何过期以及如何替换，请参阅[密钥过期](/authentication#key-expiry)和[轮换密钥](/authentication#rotate-keys)。使用 `tomba key list --json` 获取密钥 ID。

```text
tomba key list
tomba key get --id <id>
tomba key create
tomba key delete --id <id>
```

### `tomba key list`

列出您工作区所有成员的密钥。调用 [`GET /v1/keys`](/api/keys#retrieve-api-keys)。文本输出会缩短每个密钥；`--json` 会显示完整值、ID 和过期日期。

### `tomba key get`

获取单个密钥。调用 [`GET /v1/keys/{id}`](/api/keys#retrieve-a-single-api-key)。需要 `--id`。

### `tomba key create`

使用自动生成的名称和默认有效期创建密钥。调用 [`POST /v1/keys`](/api/keys#create-an-api-key)。文本输出只显示新密钥的 ID；运行 `tomba key create --json` 可在 `data.message` 中获取密钥本身。该命令不接受任何标志；要设置名称或更短的有效期，请使用仪表板或 API。

### `tomba key delete`

删除密钥。调用 [`DELETE /v1/keys/{id}`](/api/keys#delete-an-api-key)。需要 `--id`。此后使用该密钥的请求都会失败；如果您是用该密钥登录的，CLI 自身的请求也会失败。

### `tomba key reset`

调用 `PUT /v1/keys/{id}/reset`，但 API 中没有这个路由，因此会以 `error: 404 Not Found` 失败。要轮换密钥，请使用仪表板或 [`PUT /v1/keys/{id}`](/api/keys#reset-an-api-key)。

## `tomba whoami`

显示 CLI 当前登录的账户。调用 [`GET /v1/me`](/api/account#get-account)。

```bash
tomba whoami
tomba whoami --json
```

文本输出显示您的账户详情和套餐名称。`--json` 还会在 `requests.domains` 和 `requests.verifications` 中加入您的搜索和验证额度及用量（[查看用量](/usage-and-quotas#check-usage)），并在 `secret_token` 中加入您的 API Secret。不要分享此命令的 `--json` 或 `--output` 输出。

## `tomba usage`

显示您的每日用量。调用 [`GET /v1/usage`](/api/account#retrieve-api-usage)。

```bash
tomba usage
```

CLI 只保留响应中的验证次数；搜索次数和其他计数显示为 `0`。要查看余额，请使用 `tomba whoami --json`、仪表板的 [Usage](https://app.tomba.io/usage) 页面，或 [`GET /v1/usage`](/api/account#retrieve-api-usage)。

## `tomba logs`

按时间从新到旧显示您最近 20 条有记录的请求。调用 [`GET /v1/logs`](/api/account#retrieve-api-logs)。只有计费的查询才会被记录，包括按 `0` 计费的重复请求；请参阅[重复请求](/usage-and-quotas#duplicate-requests)。文本输出列出每个请求的方法、URI、类型和日期；`--json` 还会加入其费用。

```bash
tomba logs
tomba logs --json
```

该命令不接受分页标志。要翻阅更早的条目，请使用 `page` 和 `limit` 调用 [`GET /v1/logs`](/api/account#retrieve-api-logs)。
