cli

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: GPL-3.0 Imports: 37 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cli 定义 sctl 的 cobra 子命令。serve 引导一个 cago 应用并挂载桥接 Component; 其余命令是驱动常驻 daemon 的本机内部控制客户端(见 internal/client/control),或纯本地操作。

输出约定:stdout 只承载用户可读结果 / -o/--output 的结构化(json)或原始源码(source)输出 / MCP 协议(sctl mcp);诊断日志一律走全局 stderr/文件 logger(cmd/sctl 的 PersistentPreRunE 已初始化)。

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   = "0.0.0-dev"
	Commit    = "none"
	BuildDate = "unknown"
)

Version / Commit / BuildDate 由发布工作流通过 -ldflags 注入。 源码构建时保留 dev 占位值,便于区分“自己 go build 的”与“发布产物”。

Functions

func NewRootCmd

func NewRootCmd() *cobra.Command

NewRootCmd 组装 sctl 根命令:全局 --log-level / -o|--output 标志,并挂载全部子命令。

Types

type ExitError

type ExitError struct {
	Code    int
	Message string
	// BridgeCode 是引发该错误的桥接错误码(如 METHOD_NOT_FOUND),非桥接错误为空;
	// 命令据此对特定错误码追加提示,而不必解析 Message。
	BridgeCode string
}

ExitError 携带自定义退出码,由 cmd/sctl 的 main 解包为 os.Exit。Message 非空时打印到 stderr。

func (*ExitError) Error

func (e *ExitError) Error() string

Directories

Path Synopsis
Package upgradehint 放 scripts.run / scripts.logs 在旧版 ScriptCat 上得到 METHOD_NOT_FOUND 时给用户的 升级提示。
Package upgradehint 放 scripts.run / scripts.logs 在旧版 ScriptCat 上得到 METHOD_NOT_FOUND 时给用户的 升级提示。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL