Luckee Skill
Pre-flight
Before doing anything, check whether the plugin is already installed:
CODEBLOCK0
If luckee-tool appears and shows as enabled, skip straight to Usage. Otherwise, follow Install below.
Install
Before installing, ask the user for confirmation: explain that the plugin will be fetched from its GitHub repository and registered with OpenClaw.
1. Register the plugin with OpenClaw
CODEBLOCK1
This single command fetches the plugin and installs its dependencies. Do not run git clone or npm install manually.
2. Verify and configure the luckee CLI binary path
After install, luckee-cli (the Python package) may have been placed in a directory that is not on the gateway process's PATH (e.g. ~/.local/bin). The plugin should use the luckee binary by default, so you must locate the actual binary and set binaryPath explicitly if needed:
CODEBLOCK2
Check the discovered directory (e.g. /home/node/.local/bin/) for a file named luckee or luckee-cli. Then set the full path:
CODEBLOCK3
Why: pip often installs scripts into ~/.local/bin/ which many environments (containers, systemd services, SSH sessions) do not include in PATH. Setting binaryPath makes the plugin find the binary regardless of PATH.
3. Authenticate with Luckee
Run:
CODEBLOCK4
This command opens a browser auth page. Ask the user to complete authorization in the web page, then continue in terminal once login finishes.
Running regular luckee commands also checks login status and will prompt the same web authorization flow if the user is not logged in.
No browser access (remote machine, headless server, SSH session, etc.): If the environment cannot open a browser — for example, a remote server, a container, or an SSH session — the luckee login command will still print an authorization URL to stdout. You must copy the full URL from the terminal output and present it to the user so they can open it in their own browser. Do not attempt to launch a browser in these environments.
4. Restart and verify
CODEBLOCK5
Confirm the plugin shows as loaded and the gateway is healthy. Do not ask the user for API URL or User ID details.
Usage
Skill command
CODEBLOCK6
Example: INLINECODE14
Stop a running query
CODEBLOCK7
Set a token
CODEBLOCK8
Set a token and run a query in one go:
CODEBLOCK9
AI tool invocation
Call the luckee_query tool with:
CODEBLOCK10
Only query is required. For /luckee token ..., first call luckee_set_token, then call luckee_query if a query was included. Auth context is handled by CLI/session state or the auto-login prompt triggered by luckee_query.
Token Management
- - Tokens are managed securely by OpenClaw and persisted across gateway restarts.
- Set a per-user token via
/luckee token <token> (overrides the default for that sender). - Set a default token via config:
openclaw config set plugins.entries.luckee-tool.config.defaultToken "<token>". - See reference.md for advanced token store details.
Troubleshooting
Binary not found
This is the most common issue. Even when luckee-cli is installed, the gateway process may not find it because pip installs scripts to a directory not in PATH (e.g. ~/.local/bin/).
Step 1 — Locate the binary:
CODEBLOCK11
If that returns nothing, check common pip script directories:
CODEBLOCK12
Step 2 — If not installed, install it:
CODEBLOCK13
Then re-run Step 1 to find where it was placed.
Step 3 — Set the path explicitly and restart:
CODEBLOCK14
Important: Always set binaryPath after installing luckee-cli. Do not rely on PATH resolution alone, as the gateway process environment often differs from the interactive shell.
Not logged in / auth expired
If queries fail with auth/login errors:
Option 1 — Direct terminal login (preferred when you have terminal access):
luckee login
Complete authorization in the browser, then retry the query. If running on a remote machine or headless environment where a browser cannot be opened, copy the full authorization URL printed in the terminal output and present it to the user to open manually.
Option 2 — Set token via chat (when OAuth can't work, e.g. running inside gateway):
CODEBLOCK16
Option 3 — Set token via config:
CODEBLOCK17
Note: /luckee <query> is available as a native plugin slash command. If the command is not available on a given surface, the agent can still fall back to luckee_query. If auth is missing, the plugin will surface login or token instructions automatically.
Timeout
Increase the default timeout (seconds):
CODEBLOCK18
Plugin ID mismatch warning
If you see "plugin id mismatch (manifest uses luckee-tool, entry hints luckee-openclaw-plugin)":
CODEBLOCK19
Safety Rules
- - Never log or display full tokens. Always redact to
sk_x***xx format. - All install/config operations are idempotent — safe to re-run.
- Do not overwrite unrelated config keys when setting luckee-tool config.
- Never request API URL or User ID from users during normal setup/query flows.
Reference
For detailed config schema, channel list, token store format, and error catalog, see reference.md.
Luckee 技能
前置检查
在执行任何操作之前,先检查插件是否已安装:
bash
openclaw plugins list
如果 luckee-tool 出现并显示为已启用,直接跳转到 使用。否则,按照下面的 安装 步骤操作。
安装
在安装之前,请向用户请求确认:说明该插件将从其 GitHub 仓库获取并使用 OpenClaw 注册。
1. 使用 OpenClaw 注册插件
bash
openclaw plugins install https://github.com/motse-ai/luckee-openclaw-plugin
此单个命令会获取插件并安装其依赖项。请不要手动运行 git clone 或 npm install。
2. 验证并配置 luckee CLI 二进制文件路径
安装后,luckee-cli(Python 包)可能被放置在网关进程的 PATH 环境变量之外的目录中(例如 ~/.local/bin)。插件默认应使用 luckee 二进制文件,因此如果必要,你必须找到实际的二进制文件并显式设置 binaryPath:
bash
查找二进制文件安装位置
which luckee 2>/dev/null || which luckee-cli 2>/dev/null || python3 -c import sysconfig; print(sysconfig.get
path(scripts, sysconfig.getpreferred_scheme(user))) 2>/dev/null
检查找到的目录(例如 /home/node/.local/bin/)中是否存在名为 luckee 或 luckee-cli 的文件。然后设置完整路径:
bash
openclaw config set plugins.entries.luckee-tool.config.binaryPath /full/path/to/luckee
原因: pip 通常将脚本安装到 ~/.local/bin/ 目录,而许多环境(容器、systemd 服务、SSH 会话)并未将此目录包含在 PATH 中。设置 binaryPath 可使插件无论 PATH 如何都能找到二进制文件。
3. 使用 Luckee 进行身份验证
运行:
bash
luckee login
此命令会打开一个浏览器认证页面。请让用户在网页中完成授权,然后在登录完成后继续在终端中操作。
运行常规的 luckee 命令也会检查登录状态,如果用户未登录,则会提示相同的网页授权流程。
无浏览器访问(远程机器、无头服务器、SSH 会话等): 如果环境无法打开浏览器——例如远程服务器、容器或 SSH 会话——luckee login 命令仍会向标准输出打印一个授权 URL。你必须从终端输出中复制完整的 URL 并呈现给用户,以便他们可以在自己的浏览器中打开。请勿在这些环境中尝试启动浏览器。
4. 重启并验证
bash
openclaw gateway restart
openclaw plugins info luckee-tool
openclaw health
确认插件显示为已加载且网关运行正常。请勿向用户询问 API URL 或用户 ID 详细信息。
使用
技能命令
/luckee <查询>
示例:/luckee 查一下 asin B0DPJMTH4N 的信息 用skills
停止正在运行的查询
/luckee stop
设置令牌
/luckee token <令牌>
一次性设置令牌并运行查询:
/luckee token sk_xxx 查一下 asin B0DPJMTH4N 的信息
AI 工具调用
使用以下参数调用 luckee_query 工具:
json
{
query: 查一下 asin B0DPJMTH4N 的信息 用skills,
token: skoptionaloverride,
language: CN,
timeout: 90
}
只有 query 是必需的。对于 /luckee token ...,首先调用 luckeesettoken,如果包含查询则再调用 luckeequery。认证上下文由 CLI/会话状态或 luckeequery 触发的自动登录提示处理。
令牌管理
- - 令牌由 OpenClaw 安全管理,并在网关重启后持久保存。
- 通过 /luckee token <令牌> 设置每个用户的令牌(覆盖该发送者的默认令牌)。
- 通过配置设置默认令牌:openclaw config set plugins.entries.luckee-tool.config.defaultToken <令牌>。
- 有关高级令牌存储详情,请参阅 reference.md。
故障排除
找不到二进制文件
这是最常见的问题。即使 luckee-cli 已安装,网关进程也可能找不到它,因为 pip 将脚本安装到了不在 PATH 中的目录(例如 ~/.local/bin/)。
步骤 1 — 定位二进制文件:
bash
which luckee 2>/dev/null || which luckee-cli 2>/dev/null
如果未返回任何内容,请检查常见的 pip 脚本目录:
bash
ls ~/.local/bin/luckee* 2>/dev/null
python3 -c import sysconfig; print(sysconfig.getpath(scripts, sysconfig.getpreferred_scheme(user))) 2>/dev/null
步骤 2 — 如果未安装,则进行安装:
bash
python -m pip install --upgrade luckee-cli>=0.1.0
然后重新运行步骤 1 以找到其安装位置。
步骤 3 — 显式设置路径并重启:
bash
openclaw config set plugins.entries.luckee-tool.config.binaryPath /full/path/to/luckee
openclaw gateway restart
重要: 安装 luckee-cli 后始终设置 binaryPath。不要仅依赖 PATH 解析,因为网关进程环境通常与交互式 shell 不同。
未登录/认证过期
如果查询失败并出现认证/登录错误:
选项 1 — 直接终端登录(有终端访问权限时首选):
bash
luckee login
在浏览器中完成授权,然后重试查询。如果在无法打开浏览器的远程机器或无头环境中运行,请复制终端输出中打印的完整授权 URL 并呈现给用户手动打开。
选项 2 — 通过聊天设置令牌(当 OAuth 无法工作时,例如在网关内部运行):
/luckee token <你的令牌>
选项 3 — 通过配置设置令牌:
bash
openclaw config set plugins.entries.luckee-tool.config.defaultToken <你的令牌>
注意:/luckee <查询> 可作为原生插件斜杠命令使用。如果该命令在特定平台上不可用,代理仍可回退到 luckee_query。如果缺少认证,插件将自动显示登录或令牌说明。
超时
增加默认超时时间(秒):
bash
openclaw config set plugins.entries.luckee-tool.config.defaultTimeout 180
插件 ID 不匹配警告
如果看到插件 ID 不匹配(清单使用 luckee-tool,条目提示 luckee-openclaw-plugin):
bash
openclaw config unset plugins.entries.luckee-openclaw-plugin
openclaw gateway restart
安全规则
- - 切勿记录或显示完整令牌。始终将其简化为 sk_xxx 格式。
- 所有安装/配置操作都是幂等的——可以安全地重复运行。
- 设置 luckee-tool 配置时,请不要*覆盖不相关的配置键。
- 在正常的设置/查询流程中,切勿向用户询问 API URL 或用户 ID。
参考
有关详细的配置模式、频道列表、令牌存储格式和错误目录,请参阅 reference.md。