Agentuity云键值设置工具Skill agentuity-cli-cloud-keyvalue-set

Agentuity云键值设置工具是一个命令行接口(CLI)技能,用于在Agentuity云平台的键值存储服务中设置、存储和管理数据。该工具支持设置键值对、指定命名空间、配置生存时间(TTL),适用于缓存管理、会话存储、用户数据持久化等场景。主要功能包括:键值存储、数据缓存、TTL过期设置、JSON和文本内容支持。关键词:Agentuity CLI,云键值存储,数据缓存,TTL设置,命令行工具,云平台操作,键值数据库,DevOps工具。

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

name: agentuity-cli-cloud-keyvalue-set description: 在键值存储中设置键和值。需要身份验证。用于Agentuity云平台操作 version: “0.0.104” 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 数字 生存时间(秒,如果已设置)