btw Command
Local skill by Claw0x — runs entirely in your OpenClaw agent.
Runs locally. No external API calls, no API key required. Complete privacy.
What It Does
The btw Command skill allows AI agents to ask clarifying questions without halting their main workflow. Questions are queued, users are notified via multiple channels, and if no answer is received within the timeout period, a default answer is used automatically.
Think of it as "by the way, I need to know..." — the agent continues working while waiting for your input.
Quick Reference
| When This Happens | Do This | What You Get |
|---|
| Need deployment confirmation | Ask "Deploy to staging or production?" | Non-blocking answer with default |
| Code review decision |
Ask "Refactor this complex function?" | User choice without workflow halt |
| Data validation | Ask "Found duplicates, merge or keep?" | Timeout-safe decision |
| Security check | Ask "API key expiring, rotate now?" | Priority-based notification |
5-Minute Quickstart
Step 1: Install (30 seconds)
CODEBLOCK0
Step 2: Ask Your First Question (1 minute)
CODEBLOCK1
Step 3: Handle the Answer (instant)
CODEBLOCK2
Real-World Use Cases
Scenario 1: Deployment Automation
Problem: Agent needs to deploy but unsure which environment
Solution: Ask non-blocking question with timeout
Example:
CODEBLOCK3
Scenario 2: Code Review Decisions
Problem: Agent finds complex code, unsure if refactoring is needed
Solution: Ask for human judgment without blocking
Example:
CODEBLOCK4
Scenario 3: Data Validation
Problem: Agent finds duplicate records, needs merge strategy
Solution: Ask with context and smart default
Example:
CODEBLOCK5
Scenario 4: Security Checks
Problem: API key expiring soon, needs rotation decision
Solution: High-priority question with short timeout
Example:
CODEBLOCK6
Integration Recipes
OpenClaw Agent
CODEBLOCK7
LangChain Agent
CODEBLOCK8
Custom Agent
CODEBLOCK9
Workflow Diagram
CODEBLOCK10
Why Use Via Claw0x?
- - Zero configuration: No API keys, no setup
- Complete privacy: Runs entirely locally
- Offline capable: Works without internet
- Unlimited usage: No rate limits or quotas
- Open source: Transparent implementation
- Agent-native: Built for autonomous workflows
Prerequisites
None. Just install and use.
Input Parameters
| Parameter | Type | Required | Default | Description |
|---|
| INLINECODE0 | string | Yes | - | The question to ask |
| INLINECODE1 |
string[] | No | - | Available answer options |
|
default | string | No | First option | Default if timeout |
|
timeout | number | No | 300 | Timeout in seconds |
|
priority | string | No | "normal" | Priority: urgent/normal/low |
|
context | object | No | {} | Additional context |
Output Schema
| Field | Type | Description |
|---|
| INLINECODE6 | string | User's answer or default |
| INLINECODE7 |
string | ISO timestamp |
|
timed_out | boolean | Whether timeout occurred |
|
response_time_ms | number | Time to answer |
Error Codes
| Code | Meaning | Solution |
|---|
| 400 | Invalid input | Check question is non-empty |
| 500 |
Internal error | Retry or check logs |
Pricing
Free. No API key required, no usage limits.
- - Runs entirely locally in your agent
- No external API calls
- Complete privacy
- Unlimited questions
Rate Limits
None. Unlimited questions.
About Claw0x
Claw0x is the native skills layer for AI agents — providing unified API access, atomic billing, and quality control.
Explore more skills: claw0x.com/skills
GitHub: github.com/kennyzir/btw
btw 命令
由 Claw0x 提供的本地技能 — 完全在您的 OpenClaw 代理中运行。
本地运行。 无需外部 API 调用,无需 API 密钥。完全隐私。
功能概述
btw 命令技能允许 AI 代理在不中断其主要工作流程的情况下提出澄清性问题。问题会被排队,通过多种渠道通知用户,如果在超时时间内未收到回答,则自动使用默认答案。
可以将其理解为顺便问一下,我需要知道...——代理在等待您输入的同时继续工作。
快速参考
| 发生情况 | 操作 | 结果 |
|---|
| 需要部署确认 | 询问部署到预发布环境还是生产环境? | 带默认值的非阻塞回答 |
| 代码审查决策 |
询问重构这个复杂函数? | 不中断工作流程的用户选择 |
| 数据验证 | 询问发现重复数据,合并还是保留? | 超时安全的决策 |
| 安全检查 | 询问API 密钥即将过期,立即轮换? | 基于优先级的通知 |
5 分钟快速入门
步骤 1:安装(30 秒)
bash
openclaw skill add btw
步骤 2:提出第一个问题(1 分钟)
typescript
const result = await agent.run(btw, {
question: 部署到预发布环境还是生产环境?,
options: [staging, production],
default: staging,
timeout: 300,
priority: urgent
});
console.log(result.answer); // production 或 staging(默认值)
步骤 3:处理回答(即时)
typescript
if (result.timed_out) {
console.log(使用默认值:${result.answer});
} else {
console.log(用户选择:${result.answer},响应时间:${result.response
timems}ms);
}
实际应用场景
场景 1:部署自动化
问题:代理需要部署但不确定环境
解决方案:提出带超时的非阻塞问题
示例:
typescript
const { answer } = await btw({
question: 测试通过!部署到哪个环境?,
options: [staging, production, skip],
default: staging,
timeout: 600, // 10 分钟
priority: urgent
});
if (answer === production) {
await deployToProduction();
} else if (answer === staging) {
await deployToStaging();
}
场景 2:代码审查决策
问题:代理发现复杂代码,不确定是否需要重构
解决方案:不阻塞地请求人工判断
示例:
typescript
const { answer } = await btw({
question: 函数 processData 有 150 行。需要重构吗?,
options: [yes, no, later],
default: later,
timeout: 300,
priority: normal,
context: {
file: src/utils/data.ts,
lines: 150,
complexity: high
}
});
场景 3:数据验证
问题:代理发现重复记录,需要合并策略
解决方案:带上下文和智能默认值提问
示例:
typescript
const { answer } = await btw({
question: 发现 5 个重复用户。如何处理?,
options: [merge, keep-all, keep-newest],
default: keep-newest,
timeout: 180,
priority: normal,
context: {
duplicates: 5,
table: users,
criteria: email
}
});
场景 4:安全检查
问题:API 密钥即将过期,需要轮换决策
解决方案:高优先级问题,短超时
示例:
typescript
const { answer } = await btw({
question: API 密钥将在 2 天后过期。立即轮换?,
options: [yes, no, remind-tomorrow],
default: remind-tomorrow,
timeout: 60,
priority: urgent,
context: {
key
name: STRIPEAPI_KEY,
expires_at: 2026-03-29
}
});
集成方案
OpenClaw 代理
typescript
agent.onTask(async (task) => {
// 不阻塞地提问
const { answer } = await agent.run(btw, {
question: 批准此更改?,
options: [yes, no],
default: no,
timeout: 300
});
if (answer === yes) {
await task.execute();
}
});
LangChain 代理
python
def ask_user(question, options, default, timeout=300):
# 本地使用 btw 技能
result = agent.run(btw, {
question: question,
options: options,
default: default,
timeout: timeout
})
return result[answer]
在代理中使用
answer = ask_user(
部署到生产环境?,
[yes, no],
no,
timeout=600
)
自定义代理
javascript
// 本地 btw 实现
async function askBtw(question, options, defaultAnswer) {
const result = await agent.run(btw, {
question,
options,
default: defaultAnswer,
timeout: 300
});
return result.answer;
}
工作流程示意图
代理工作流程
│
├─ 主要任务(继续执行)
│
└─ btw 问题
├─ 排队问题
├─ 通知用户(Web/移动端/Slack)
│
├─ 用户回答 → 返回回答
│
└─ 超时 → 返回默认值
为什么选择 Via Claw0x?
- - 零配置:无需 API 密钥,无需设置
- 完全隐私:完全本地运行
- 离线可用:无需互联网即可工作
- 无限制使用:无速率限制或配额
- 开源:实现透明
- 代理原生:专为自主工作流程构建
前提条件
无。 只需安装即可使用。
输入参数
| 参数 | 类型 | 必需 | 默认值 | 描述 |
|---|
| question | string | 是 | - | 要提出的问题 |
| options |
string[] | 否 | - | 可用的回答选项 |
| default | string | 否 | 第一个选项 | 超时时的默认值 |
| timeout | number | 否 | 300 | 超时时间(秒) |
| priority | string | 否 | normal | 优先级:urgent/normal/low |
| context | object | 否 | {} | 额外上下文 |
输出模式
| 字段 | 类型 | 描述 |
|---|
| answer | string | 用户的回答或默认值 |
| answered_at |
string | ISO 时间戳 |
| timed_out | boolean | 是否发生超时 |
| response
timems | number | 回答时间 |
错误代码
| 代码 | 含义 | 解决方案 |
|---|
| 400 | 无效输入 | 检查问题是否非空 |
| 500 |
内部错误 | 重试或检查日志 |
定价
免费。 无需 API 密钥,无使用限制。
- - 完全在您的代理中本地运行
- 无外部 API 调用
- 完全隐私
- 无限问题
速率限制
无。 无限问题。
关于 Claw0x
Claw0x 是 AI 代理的原生技能层——提供统一的 API 访问、原子计费和质量控制。
探索更多技能:claw0x.com/skills
GitHub:github.com/kennyzir/btw