Skip to content

plugin-commands — 指令系统

包名: @aalis/plugin-commands
源码: packages/plugin-commands/src/index.ts

概述

内置指令注册与执行系统,支持指令前缀配置、递归子指令和声明式参数/选项解析。

插件声明

typescript
meta.name = '@aalis/plugin-commands'
meta.provides = ['commands']
meta.inject = {}

内置指令

指令说明可见性
/help显示帮助信息public
/status系统状态public
/clear [--type/-t <type>]清空当前会话记忆;类型可重复或逗号分隔public
/clear list列出可清理类型public
/clear all [--type/-t <type>]全局清空指定类型或全部类型restricted
/model查看或切换会话模型public
/tools列出所有 AI 工具public
/shutdown关闭应用restricted
/restart重启应用restricted
/authority [target]查看自己或指定用户的权限等级public
/level <target> <n>设置用户权限等级(整数,越大越高;0 默认,负数封禁)restricted
/auto [分钟|off|on]自动确认模式:临时免 dangerous 二次确认(仅 owner 本人)restricted

/clear 类型

/clear 通过 memory:clear hook 让各插件参与清理,命令插件只负责编排和基础缓存清理。可用类型:

类型内容
context消息历史与会话上下文
summary会话摘要
vector向量记忆
image图片缓存
persona会话角色状态
user-profile用户档案,仅全局清理

示例:

text
/clear
/clear --type context,summary
/clear -t vector -t image
/clear all --type user-profile