Lix Agents
Use lix-agents to get temporary API tokens for the Lix API. Tokens require human approval via email, so agents never hold unsupervised credentials.
Always tell the user what you're doing and why before running each command. Don't silently run commands — explain the purpose of each step so the user can follow along.
When to use this
- - You need to call any
https://api.lix-it.com endpoint that requires authentication - You need to enrich LinkedIn profiles, companies, or other data via Lix
- You don't already have a valid Lix API token in your environment
Step-by-step workflow
Follow these steps in order. Before each step, explain to the user why you're running the command.
Step 1: Check if lix-agents is installed
Tell the user: "First, I'll check if the lix-agents CLI is installed on your machine."
CODEBLOCK0
If the command is not found, tell the user you need to install it and why — it's a CLI that manages Lix API authentication for AI agents. Then install it:
CODEBLOCK1
If brew is unavailable, suggest go install github.com/lix-it/lix-agents@latest or downloading from GitHub Releases.
Step 2: Check if the user is already logged in
Tell the user: "Now I'll check if you already have a Lix session. This avoids asking you to log in again if you've done it before."
CODEBLOCK2
- - If already logged in, skip to Step 4.
- If not logged in, continue to Step 3.
Step 3: Log in (only if needed)
Tell the user: "You're not logged in yet. I'll start the login flow — this will give you a URL to open in your browser. You only need to do this once; your session will be saved locally."
CODEBLOCK3
Share the URL with the user and wait for them to confirm they've signed in.
Step 4: Request a temporary API token
Tell the user: "Now I'll request a temporary API token. For security, Lix will send you an approval email — please check your inbox and approve the request. I'll wait for the approval before continuing."
CODEBLOCK4
The command blocks until the user approves via email. Once approved, it prints the token to stdout. Save this token for use in subsequent API calls.
Step 5: Use the token
Set the token in the Authorization header for API requests:
CODEBLOCK5
All requests go to https://api.lix-it.com. See the Lix API docs for available endpoints, request formats, and response formats.
Reference
Run lix-agents --help for the full command reference.
Lix Agents
使用 lix-agents 获取 Lix API 的临时 API 令牌。令牌需要通过电子邮件进行人工审批,因此代理永远不会持有无监督的凭证。
在运行每条命令之前,务必告知用户你将要做什么以及原因。 不要默默运行命令——解释每一步的目的,以便用户能够跟上操作。
何时使用
- - 你需要调用任何需要身份验证的 https://api.lix-it.com 端点
- 你需要通过 Lix 丰富 LinkedIn 个人资料、公司或其他数据
- 你的环境中尚未拥有有效的 Lix API 令牌
分步工作流程
请按顺序执行以下步骤。在每一步之前,向用户解释为什么你要运行该命令。
第 1 步:检查是否已安装 lix-agents
告知用户:首先,我将检查你的机器上是否已安装 lix-agents CLI。
bash
which lix-agents
如果未找到该命令,告知用户你需要安装它及其原因——它是一个为 AI 代理管理 Lix API 身份验证的 CLI。然后进行安装:
bash
brew tap lix-it/lix-agents && brew install lix-agents
如果 brew 不可用,建议使用 go install github.com/lix-it/lix-agents@latest 或从 GitHub Releases 下载。
第 2 步:检查用户是否已登录
告知用户:现在我将检查你是否已有 Lix 会话。这样可以避免在你之前登录过的情况下要求你再次登录。
bash
lix-agents auth status
- - 如果已登录,跳至第 4 步。
- 如果未登录,继续执行第 3 步。
第 3 步:登录(仅在需要时)
告知用户:你尚未登录。我将启动登录流程——这将为你提供一个在浏览器中打开的 URL。你只需执行一次;你的会话将保存在本地。
bash
lix-agents auth login
与用户分享该 URL,并等待他们确认已登录。
第 4 步:请求临时 API 令牌
告知用户:现在我将请求一个临时 API 令牌。出于安全考虑,Lix 会向你发送一封审批邮件——请检查你的收件箱并批准该请求。在审批完成前,我将等待。
bash
lix-agents auth token
该命令会阻塞,直到用户通过电子邮件批准。批准后,它会将令牌打印到标准输出。保存此令牌,以便在后续 API 调用中使用。
第 5 步:使用令牌
在 API 请求的 Authorization 标头中设置令牌:
Authorization: Bearer
所有请求均发送至 https://api.lix-it.com。有关可用端点、请求格式和响应格式,请参阅 Lix API 文档。
参考
运行 lix-agents --help 获取完整的命令参考。