Agentuity云平台键值存储设置工具Skill agentuity-cli-cloud-keyvalue-set

Agentuity云平台键值存储设置工具,用于在云端命名空间中存储和管理键值对数据。支持设置生存时间(TTL),适用于缓存、会话存储、用户数据管理等场景。关键词:Agentuity云平台,键值存储,KV存储,云存储,缓存设置,TTL,数据管理,DevOps工具。

云原生架构 0 次安装 0 次浏览 更新于 2/28/2026

name: agentuity-cli-cloud-keyvalue-set description: 在键值存储中设置键和值。需要身份验证。用于Agentuity云平台操作 version: “0.0.103” license: Apache-2.0 allowed-tools: “Bash(agentuity:*)” argument-hint: “<命名空间> <键> <值> [生存时间]” metadata: command: “agentuity cloud keyvalue set” tags: “mutating updates-resource slow requires-auth”

云键值设置

在键值存储中设置键和值

前提条件

  • 已通过 agentuity auth login 进行身份验证
  • 需要项目上下文(从项目目录运行或使用 --project-id

用法

agentuity cloud keyvalue set <命名空间> <键> <值> [生存时间]

参数

参数 类型 是否必需 描述
<命名空间> 字符串 -
<键> 字符串 -
<值> 字符串 -
<生存时间> 字符串 -

示例

存储用户数据:

bunx @agentuity/cli kv set production user:123 '{"name":"Alice","email":"alice@example.com"}'

存储会话,生存时间为1小时:

bunx @agentuity/cli kv set cache session:abc "session-data-here" --ttl 3600

缓存主页10分钟:

bunx @agentuity/cli kv set staging cache:homepage "<!DOCTYPE html>..." --ttl 600

输出

返回JSON对象:

{
  "success": "boolean",
  "namespace": "string",
  "key": "string",
  "contentType": "string",
  "durationMs": "number",
  "ttl": "number"
}
字段 类型 描述
success 布尔值 操作是否成功
namespace 字符串 命名空间名称
key 字符串 键名称
contentType 字符串 内容类型(application/json 或 text/plain)
durationMs 数字 操作持续时间(毫秒)
ttl 数字 如果设置了生存时间,则为生存时间(秒)