Command Line Interface
The ainalyn CLI provides commands for validating and compiling agents.
Installation
The CLI is installed automatically with the SDK:
pip install ainalyn-sdkCommands
validate
Validates an agent definition file.
ainalyn validate agent.pyArguments:
file- Path to Python file containing an AgentDefinition
Example:
# agent.py
from ainalyn import AgentBuilder, WorkflowBuilder, NodeBuilder, PromptBuilder
prompt = PromptBuilder("my-prompt").description("Test").template("Hello").build()
workflow = (
WorkflowBuilder("my-workflow")
.description("Test")
.add_node(NodeBuilder("node1").description("Node").uses_prompt("my-prompt").build())
.entry_node("node1")
.build()
)
agent = (
AgentBuilder("my-agent")
.version("1.0.0")
.description("My agent")
.add_prompt(prompt)
.add_workflow(workflow)
.build()
)$ ainalyn validate agent.py
Validation successfulcompile
Compiles an agent definition to YAML.
ainalyn compile agent.py -o output.yamlArguments:
file- Path to Python file-o, --output- Output YAML file path (required)
Example:
$ ainalyn compile agent.py -o my_agent.yaml
Compiled successfully to my_agent.yaml—version
Shows the SDK version.
ainalyn --versionExit Codes
0- Success1- Validation or compilation failed2- File not found or invalid
Common Workflows
Validate before deploying:
ainalyn validate agent.py && echo "Ready to deploy!"Compile multiple agents:
ainalyn compile agent1.py -o agent1.yaml
ainalyn compile agent2.py -o agent2.yaml