aicmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AICommand = &gcli.Command{
	Name: "ai",
	Desc: "AI tool command",
	Subs: []*gcli.Command{
		NewAIChatCmd(),
		NewQuestionCmd(),
		NewTranslateCmd(),
		NewAIToolCmd(),
		ClaudeCommand,
		SkillsCmd,
	},
	Config: func(c *gcli.Command) {
		c.BoolOpt2(&aiOpts.showConfig, "show", "Show config info")
		c.StrOpt2(&aiOpts.configKey, "key", "Show config info by key, with --show")
	},
	Func: func(c *gcli.Command, args []string) error {
		if aiOpts.showConfig {
			aisrv, err := service.AI().Init()
			if err != nil {
				return fmt.Errorf("failed to initialize AI service: %w", err)
			}
			aisrv.ShowConfig(aiOpts.configKey)
			return nil
		}
		return c.ShowHelp()
	},
}
View Source
var ClaudeCommand = &gcli.Command{
	Name:    "claude",
	Desc:    "Claude code managment commands",
	Aliases: []string{"cc"},
	Subs: []*gcli.Command{
		NewClaudeSetCmd(),
	},
}

ClaudeCommand is the AI Claude command group

View Source
var SkillsCmd = &gcli.Command{
	Name:    "skills",
	Desc:    "Manage local AI skills for extending capabilities",
	Aliases: []string{"skill"},
	Help: `
Manage local AI skills that extend Claude's capabilities.

Skills are stored in:
  - User level: ~/.claude/skills/<skill-name>/SKILL.md
  - Project level: ./.claude/skills/<skill-name>/SKILL.md

Each skill is a directory containing a SKILL.md file with YAML frontmatter
and markdown instructions.
`,
	Subs: []*gcli.Command{
		SkillsListCmd(),
		SkillsShowCmd(),
		SkillsCreateCmd(),
		SkillsEditCmd(),
		SkillsDeleteCmd(),
		SkillsPathCmd(),
		SkillsOpenCmd(),
	},
	Func: func(c *gcli.Command, args []string) error {
		return c.ShowHelp()
	},
}

Functions

func NewAIChatCmd

func NewAIChatCmd() *gcli.Command

NewAIChatCmd create 实现一个AI终端

  • 可以跟AI大模型交互
  • 支持多轮对话
  • 支持子命令调整设置
  • 支持上下文存储
  • 支持历史记录存储

func NewAIToolCmd

func NewAIToolCmd() *gcli.Command

NewAIToolCmd AI工具命令,通过内置的提示词将ai当做工具使用

func NewClaudeSetCmd

func NewClaudeSetCmd() *gcli.Command

NewClaudeSetCmd creates the Claude Code info manage command

func NewQuestionCmd

func NewQuestionCmd() *gcli.Command

NewQuestionCmd create.

func NewTranslateCmd

func NewTranslateCmd() *gcli.Command

NewTranslateCmd instance

func SkillsCreateCmd

func SkillsCreateCmd() *gcli.Command

SkillsCreateCmd creates a new skill

func SkillsDeleteCmd

func SkillsDeleteCmd() *gcli.Command

SkillsDeleteCmd deletes a skill

func SkillsEditCmd

func SkillsEditCmd() *gcli.Command

SkillsEditCmd opens a skill in the editor

func SkillsListCmd

func SkillsListCmd() *gcli.Command

SkillsListCmd lists all available skills

func SkillsOpenCmd

func SkillsOpenCmd() *gcli.Command

SkillsOpenCmd opens the skills directory in file manager

func SkillsPathCmd

func SkillsPathCmd() *gcli.Command

SkillsPathCmd shows the skills directory path

func SkillsShowCmd

func SkillsShowCmd() *gcli.Command

SkillsShowCmd shows details of a specific skill

Types

type AICommonOptions

type AICommonOptions struct {
	// custom set llm model name
	Model string
	// custom set llm provider name. eg: openai, deepseek, aliyun/bailian, siliconflow
	Provider  string
	SystemMsg string
}

func (*AICommonOptions) BindFlags

func (o *AICommonOptions) BindFlags(c *gcli.Command)

BindFlags for common options

type AITerminal

type AITerminal struct {
	AICommonOptions
	SystemPrompt string
	// contains filtered or unexported fields
}

func (*AITerminal) Create

func (at *AITerminal) Create()

Create terminal

func (*AITerminal) Run

func (at *AITerminal) Run()

Directories

Path Synopsis
Package skills provides skill management functionality for kite ai skills command.
Package skills provides skill management functionality for kite ai skills command.

Jump to

Keyboard shortcuts

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