50% off 所有套餐限时优惠,起价 $2.48/mo
nanobot

nanobot

nanobot 是一个轻量级自动化框架。通过 SSH 运行定时机器人和代理,占用资源极少,仅需单个二进制文件。专为需要后台守护进程、但不值得引入完整编排系统的个人自动化项目而设计。

Version

Latest

Operating System

Ubuntu Server 24.04 LTS

Min. RAM

1 GB

IP Types

IPV4,IPV6

User

Username: nanobot

网关服务运行于 nanobot user.

有两种方式访问系统。

1. 以 nanobot 身份直接通过 SSH 登录

ssh nanobot@<SERVER_IP>

Password:

cat /root/.cloudzy-creds

2. 以 root 登录后切换用户

ssh root@<SERVER_IP>
su - nanobot

Usage

0. 通过 SSH 连接服务器

以 root 身份连接到服务器:

ssh root@<SERVER_IP>

使用密码登录。

1. 切换到应用用户

su -  nanobot

Nanobot 不能以 root 用户身份运行。

2. Configuration

编辑配置文件: /home/nanobot/.nanobot/config.json

在配置中设置以下两个部分(其他选项均有默认值)。

将以下配置块添加或合并到现有配置文件中,而不是替换整个文件。

Providers 块(API 密钥)

设置你的 API 密钥(例如 OpenRouter,推荐全球用户使用):

{
  "providers": {
    "openrouter": {
      "apiKey": "sk-or-v1-xxx"
    }
  }
}

Agents 块(模型)

设置你的模型(可选择指定 provider,默认自动检测):

{
  "agents": {
    "defaults": {
      "provider": "openrouter",
      "model": "anthropic/claude-opus-4-6"
    }
  }
}

3. Restart gateway

完成配置后,重启网关服务以使更改生效,并启用与 Telegram 等聊天应用的连接。

sudo systemctl restart nanobot-gateway

nanobot 用户密码:存储于 /root/.cloudzy-creds

4. Chat

启动交互式聊天:

nanobot agent

发送单条提示词:

nanobot agent -m "Hello!"

Telegram Integration

1. Create bot

Open Telegram:

  • Search: @BotFather
  • Run /newbot
  • 复制 bot token

2. Configure nanobot

Edit config: /home/nanobot/.nanobot/config.json

将以下配置块添加或合并到现有配置文件中,而不是替换整个文件。

{
  "channels": {
    "telegram": {
      "enabled": true,
      "token": "YOUR_BOT_TOKEN",
      "allowFrom": ["YOUR_USER_ID"]
    }
  }
}

Set enabled to true.

YOUR_BOT_TOKEN 是你通过 BotFather 创建 Telegram bot 时获得的 token。

YOUR_USER_ID 是你的 Telegram 用户 ID,可在 Telegram 设置中找到,显示为 @yourUserId。复制该值时请去掉 @ 符号,然后粘贴到配置文件中。

4. Restart service

sudo systemctl restart nanobot-gateway

重要文件与目录

  • User home: /home/nanobot
  • App data: /home/nanobot/.nanobot
  • Config file: /home/nanobot/.nanobot/config.json
  • CLI binary: /home/nanobot/.local/bin/nanobot
  • Systemd service: /etc/systemd/system/nanobot-gateway.service
  • Credentials file: /root/.cloudzy-creds

Notes

  • 每次修改配置后: systemctl restart nanobot-gateway
  • 服务将在系统启动时自动运行
  • Use systemctl and journalctl for management
  • Reset nanobot 用户密码(以 root 身份): passwd nanobot

More in Automation

Related apps.

立即部署 nanobot。 From $2.48/mo.