Skip to content

Commit 970b8bb

Browse files
authored
Merge pull request #5 from akihikokuroda/clirefactor
feat: add Maestro cli
2 parents 234fdab + 339767e commit 970b8bb

32 files changed

+4776
-3
lines changed

README.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,3 +1110,165 @@ cli/maestro collection info --vdb "Qiskit_studio_algo" --name "Qiskit_studio_alg
11101110
```
11111111

11121112
**Note**: The semantic chunking strategy uses sentence-transformers for chunking decisions, while the collection's own embedding model is used for search operations.
1113+
1114+
## Agent Management
1115+
1116+
The CLI provides commands for creating and serving AI agents:
1117+
1118+
### Agent Create Command
1119+
1120+
```bash
1121+
# Create agents from YAML configuration
1122+
./maestro agent create agent-config.yaml
1123+
1124+
# Create agents with verbose output
1125+
./maestro agent create agent-config.yaml --verbose
1126+
1127+
# Create agents with dry-run mode
1128+
./maestro agent create agent-config.yaml --dry-run
1129+
```
1130+
1131+
Example agent configuration file:
1132+
```yaml
1133+
apiVersion: maestro/v1alpha1
1134+
kind: Agent
1135+
metadata:
1136+
name: test-agent
1137+
spec:
1138+
framework: fastapi
1139+
description: "Test agent for unit tests"
1140+
model: gpt-4
1141+
tools:
1142+
- name: test-tool
1143+
description: "A test tool"
1144+
```
1145+
1146+
### Agent Serve Command
1147+
1148+
```bash
1149+
# Serve an agent from YAML configuration
1150+
./maestro agent serve agent-config.yaml
1151+
1152+
# Serve an agent with custom port
1153+
./maestro agent serve agent-config.yaml --port=8080
1154+
1155+
# Serve a specific agent from a multi-agent YAML file
1156+
./maestro agent serve agents-config.yaml --agent-name=my-agent
1157+
1158+
# Serve an agent with dry-run mode
1159+
./maestro agent serve agent-config.yaml --dry-run
1160+
```
1161+
1162+
## Workflow Management
1163+
1164+
The CLI provides commands for running, serving, and deploying workflows that coordinate multiple agents:
1165+
1166+
### Workflow Run Command
1167+
1168+
```bash
1169+
# Run a workflow with agents
1170+
./maestro workflow run agent-config.yaml workflow-config.yaml
1171+
1172+
# Run a workflow with interactive prompt
1173+
./maestro workflow run agent-config.yaml workflow-config.yaml --prompt
1174+
1175+
# Run a workflow with dry-run mode
1176+
./maestro workflow run agent-config.yaml workflow-config.yaml --dry-run
1177+
```
1178+
1179+
Example workflow configuration file:
1180+
```yaml
1181+
apiVersion: maestro/v1alpha1
1182+
kind: Workflow
1183+
metadata:
1184+
name: test-workflow
1185+
spec:
1186+
template:
1187+
prompt: "Test prompt"
1188+
steps:
1189+
- name: test-step
1190+
agent: test-agent
1191+
input: "{{ .prompt }}"
1192+
```
1193+
1194+
### Workflow Serve Command
1195+
1196+
```bash
1197+
# Serve a workflow with agents
1198+
./maestro workflow serve agent-config.yaml workflow-config.yaml
1199+
1200+
# Serve a workflow with custom port
1201+
./maestro workflow serve agent-config.yaml workflow-config.yaml --port=8080
1202+
1203+
# Serve a workflow with dry-run mode
1204+
./maestro workflow serve agent-config.yaml workflow-config.yaml --dry-run
1205+
```
1206+
1207+
### Workflow Deploy Command
1208+
1209+
```bash
1210+
# Deploy a workflow
1211+
./maestro workflow deploy agent-config.yaml workflow-config.yaml
1212+
1213+
# Deploy a workflow to Kubernetes
1214+
./maestro workflow deploy agent-config.yaml workflow-config.yaml --kubernetes
1215+
1216+
# Deploy a workflow with Docker
1217+
./maestro workflow deploy agent-config.yaml workflow-config.yaml --docker
1218+
1219+
# Deploy a workflow with dry-run mode
1220+
./maestro workflow deploy agent-config.yaml workflow-config.yaml --dry-run
1221+
```
1222+
1223+
## Custom Resource Management
1224+
1225+
The CLI provides commands for creating Kubernetes custom resources:
1226+
1227+
### CustomResource Create Command
1228+
1229+
```bash
1230+
# Create Kubernetes custom resources from YAML
1231+
./maestro customresource create resource-config.yaml
1232+
1233+
# Create custom resources with dry-run mode
1234+
./maestro customresource create resource-config.yaml --dry-run
1235+
```
1236+
1237+
The command automatically:
1238+
- Sets the API version to `maestro.ai4quantum.com/v1alpha1`
1239+
- Sanitizes resource names for Kubernetes compatibility
1240+
- Processes workflow-specific fields for proper deployment
1241+
1242+
## Mermaid Diagram Generation
1243+
1244+
The CLI provides commands for generating Mermaid diagrams from workflow definitions:
1245+
1246+
### Mermaid Command
1247+
1248+
```bash
1249+
# Generate a sequence diagram from a workflow
1250+
./maestro mermaid workflow-config.yaml --sequenceDiagram
1251+
1252+
# Generate a top-down flowchart from a workflow
1253+
./maestro mermaid workflow-config.yaml --flowchart-td
1254+
1255+
# Generate a left-right flowchart from a workflow
1256+
./maestro mermaid workflow-config.yaml --flowchart-lr
1257+
```
1258+
1259+
Example output:
1260+
```
1261+
sequenceDiagram
1262+
participant User
1263+
participant System
1264+
User->>System: Request
1265+
System->>User: Response
1266+
```
1267+
1268+
or
1269+
1270+
```
1271+
flowchart TD
1272+
A[Start] --> B[Process]
1273+
B --> C[End]
1274+
```

0 commit comments

Comments
 (0)