DEKI/ENGINE docs
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
DekiEditor::CliTool Class Referenceabstract

A tool a package adds to the editor's command line and MCP server. More...

#include <C:/Users/kirby/Documents/Github/deki/deki-editor/deki-editor/include/deki-editor/CliTool.h>

Inherits DekiEditor::EditorExtension.

Public Member Functions

 ~CliTool () override
EditorType GetEditorType () const override
const char * GetName () const override
virtual const char * GetToolName () const =0
 Unique across the editor and every package, e.g. "graph_add_node".
virtual const char * GetToolDescription () const =0
virtual const char * GetInputSchema () const =0
 JSON Schema of the arguments object, as text.
virtual bool Run (const CliToolContext &context, const std::string &argsJson, std::string &resultJson, std::string &error)=0
 Runs with argsJson (an object).
Public Member Functions inherited from DekiEditor::EditorExtension
virtual ~EditorExtension ()=default

Detailed Description

A tool a package adds to the editor's command line and MCP server.

A package that brings its own kind of content, such as a node graph, brings the tools that author it too, so that content can be made from --tool / --script like any scene edit. Register with REGISTER_EDITOR like any editor extension; the tool appears in --list-tools and can be called while its package is loaded.

Arguments and results cross the package boundary as JSON text.

Constructor & Destructor Documentation

◆ ~CliTool()

DekiEditor::CliTool::~CliTool ( )
override

Member Function Documentation

◆ GetEditorType()

EditorType DekiEditor::CliTool::GetEditorType ( ) const
inlineoverridevirtual

◆ GetName()

const char * DekiEditor::CliTool::GetName ( ) const
inlineoverridevirtual

◆ GetToolName()

virtual const char * DekiEditor::CliTool::GetToolName ( ) const
pure virtual

Unique across the editor and every package, e.g. "graph_add_node".

◆ GetToolDescription()

virtual const char * DekiEditor::CliTool::GetToolDescription ( ) const
pure virtual

◆ GetInputSchema()

virtual const char * DekiEditor::CliTool::GetInputSchema ( ) const
pure virtual

JSON Schema of the arguments object, as text.

◆ Run()

virtual bool DekiEditor::CliTool::Run ( const CliToolContext & context,
const std::string & argsJson,
std::string & resultJson,
std::string & error )
pure virtual

Runs with argsJson (an object).

On success fills resultJson with a JSON value and returns true; on failure fills error and returns false.


The documentation for this class was generated from the following file: