CLI API Reference¶
HoloDeck provides a command-line interface for project initialization, agent testing,
interactive chat, HTTP serving, deployment, MCP server management, and configuration.
This section documents the programmatic CLI API -- every public class, function, and
exception exposed by the holodeck.cli package.
Main CLI¶
Entry point for the HoloDeck CLI application using Click.
Registers all seven subcommands and loads .env files on startup.
main(ctx)
¶
HoloDeck - Experimentation platform for AI agents.
Commands
init Initialize a new agent project test Run agent test cases chat Interactive chat session with an agent serve Start an HTTP server exposing an agent deploy Build and deploy agent containers
Initialize and manage AI agent projects with YAML configuration.
Source code in src/holodeck/cli/main.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
_load_dotenv_files()
¶
Load .env files from current directory and user home.
Priority (highest to lowest): 1. Shell environment variables (never overwritten) 2. .env in CWD (project-level config) 3. ~/.holodeck/.env (user-level defaults)
With override=False, the first value set wins. So we load project .env first, then home .env fills any remaining gaps.
Source code in src/holodeck/cli/main.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
CLI Commands¶
Init Command¶
Initialize a new HoloDeck project with bundled templates and an interactive wizard.
init(project_name, template, description, author, force, llm, vectorstore, evals_arg, mcp_arg, non_interactive, verbose, quiet)
¶
Initialize a new HoloDeck agent project.
Creates a new project directory with all required configuration files, example instructions, tools templates, test cases, and data files.
The generated project includes agent.yaml (main configuration), instructions/ (system prompts), tools/ (custom function templates), data/ (sample datasets), and tests/ (evaluation test cases).
TEMPLATES:
conversational - General-purpose conversational agent (default)
research - Research/analysis agent with vector search examples
customer-support - Customer support agent with function tools
INTERACTIVE MODE (default):
When run without --non-interactive, the wizard prompts for:
- Agent name
- LLM provider (Ollama, OpenAI, Azure OpenAI, Anthropic)
- Vector store (ChromaDB, Qdrant, In-Memory)
- Evaluation metrics
- MCP servers
NON-INTERACTIVE MODE:
Use --non-interactive with --name to skip prompts and use defaults:
holodeck init --name my-agent --non-interactive
Or override specific values:
holodeck init --name my-agent --llm openai --vectorstore qdrant
EXAMPLES:
Basic project with interactive wizard:
holodeck init
Quick setup with defaults (no prompts):
holodeck init --name my-agent --non-interactive
Custom LLM and vector store:
holodeck init --name my-agent --llm openai --vectorstore qdrant
Full customization without prompts:
holodeck init --name my-agent --llm anthropic \
--vectorstore chromadb --evals rag-faithfulness,rag-answer_relevancy \
--mcp brave-search,memory --non-interactive
For more information, see: https://useholodeck.ai/docs/getting-started
Source code in src/holodeck/cli/commands/init.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | |
validate_template(ctx, param, value)
¶
Validate template parameter and provide helpful error messages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
Click context |
required |
param
|
Parameter
|
Click parameter |
required |
value
|
str
|
Template name provided by user |
required |
Returns:
| Type | Description |
|---|---|
str
|
The validated template name |
Raises:
| Type | Description |
|---|---|
BadParameter
|
If template is invalid |
Source code in src/holodeck/cli/commands/init.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
_parse_comma_arg(value)
¶
Parse a comma-separated argument into a list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str | None
|
Comma-separated string or None. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
List of stripped, non-empty values. |
Source code in src/holodeck/cli/commands/init.py
61 62 63 64 65 66 67 68 69 70 71 72 | |
Test Command¶
Run tests for a HoloDeck agent with evaluation metrics and report generation.
test()
¶
Execute agent test cases with evaluation metrics.
Default subcommand is run — so holodeck test agent.yaml stays valid
shorthand for holodeck test run agent.yaml. Subcommands:
run Execute test cases (default). view Launch the Dash evaluation dashboard.
Source code in src/holodeck/cli/commands/test.py
100 101 102 103 104 105 106 107 108 109 | |
SpinnerThread(progress)
¶
Bases: Thread
Background thread for spinner animation.
Initialize spinner thread.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
progress
|
ProgressIndicator
|
ProgressIndicator instance |
required |
Source code in src/holodeck/cli/commands/test.py
44 45 46 47 48 49 50 51 52 53 | |
run()
¶
Run spinner animation loop.
Source code in src/holodeck/cli/commands/test.py
55 56 57 58 59 60 61 62 63 64 65 | |
stop()
¶
Stop spinner animation.
Source code in src/holodeck/cli/commands/test.py
67 68 69 70 71 72 73 | |
_save_report(report, output, format)
¶
Save test report to file in specified format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
report
|
TestReport
|
TestReport instance to save |
required |
output
|
str
|
Output file path |
required |
format
|
str | None
|
Report format (json/markdown). If None, auto-detect from extension. |
required |
Source code in src/holodeck/cli/commands/test.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 | |
Chat Command¶
Start an interactive multi-turn chat session with an agent.
chat(agent_config, verbose, quiet, observability, max_messages, force_ingest)
¶
Start an interactive chat session with an agent.
AGENT_CONFIG is the path to the agent.yaml configuration file.
Example:
holodeck chat examples/weather-agent.yaml
holodeck chat examples/assistant.yaml --verbose --max-messages 100
Chat Session Commands:
Type 'exit' or 'quit' to end the session.
Press Ctrl+C to interrupt.
Options:
--verbose / -v Show detailed tool execution parameters and results
--quiet / -q Suppress logging output (enabled by default)
--observability / -o Enable OpenTelemetry tracing for debugging
--max-messages / -m Set max messages before context warning (default: 50)
Source code in src/holodeck/cli/commands/chat.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
ChatSpinnerThread(progress)
¶
Bases: Thread
Background thread for displaying animated spinner during agent execution.
Initialize spinner thread.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
progress
|
ChatProgressIndicator
|
ChatProgressIndicator instance for spinner animation. |
required |
Source code in src/holodeck/cli/commands/chat.py
37 38 39 40 41 42 43 44 45 46 | |
run()
¶
Run spinner animation loop.
Source code in src/holodeck/cli/commands/chat.py
48 49 50 51 52 53 54 55 56 57 | |
stop()
¶
Stop spinner animation and clear spinner line.
Source code in src/holodeck/cli/commands/chat.py
59 60 61 62 63 64 65 | |
_run_chat_session(agent, agent_config_path, verbose, quiet, enable_observability, max_messages, force_ingest=False, llm_timeout=None, observability_enabled=False)
async
¶
Run the interactive chat session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agent
|
Agent
|
Loaded Agent configuration |
required |
agent_config_path
|
Path
|
Path to agent.yaml file |
required |
verbose
|
bool
|
Enable detailed tool execution display |
required |
quiet
|
bool
|
Suppress logging output |
required |
enable_observability
|
bool
|
Enable OpenTelemetry tracing |
required |
max_messages
|
int
|
Maximum messages before warning |
required |
force_ingest
|
bool
|
Force re-ingestion of vector store source files |
False
|
llm_timeout
|
int | None
|
LLM API call timeout in seconds |
None
|
observability_enabled
|
bool
|
Whether OTel tracing is enabled |
False
|
Raises:
| Type | Description |
|---|---|
KeyboardInterrupt
|
When user interrupts (Ctrl+C) |
Source code in src/holodeck/cli/commands/chat.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | |
Config Command¶
Manage HoloDeck global and project configuration files.
config()
¶
Manage HoloDeck configuration.
Source code in src/holodeck/cli/commands/config.py
14 15 16 17 | |
init(global_config, project_config, force, verbose, quiet)
¶
Initialize HoloDeck global or project configuration.
Creates a new configuration file with default settings. By default, this command will prompt you to choose between global (~/.holodeck/config.yaml) or project (config.yaml) configuration initialization.
EXAMPLES:
Initialize global configuration:
holodeck config init -g
Initialize project configuration:
holodeck config init -p
Overwrite existing configuration:
holodeck config init -g --force
For more information, see: https://useholodeck.ai/docs/config
Source code in src/holodeck/cli/commands/config.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
Deploy Command¶
Build container images and deploy agents to cloud providers.
deploy(ctx)
¶
Deploy HoloDeck agents to container registries and cloud providers.
Subcommands:
build Build a container image for the agent
run Deploy a container image to the cloud
status Check deployment status
destroy Destroy a deployment
Example:
holodeck deploy build
holodeck deploy build agent.yaml --dry-run
Source code in src/holodeck/cli/commands/deploy.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
build(agent_config, tag, no_cache, dry_run, verbose, quiet)
¶
Build a container image for the agent.
AGENT_CONFIG is the path to the agent.yaml configuration file.
Generates a Dockerfile from the agent configuration and builds a container image using Docker.
Example:
holodeck deploy build
holodeck deploy build agent.yaml --tag v1.0.0
holodeck deploy build --dry-run
Source code in src/holodeck/cli/commands/deploy.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | |
run(agent_config, dry_run, verbose, quiet)
¶
Deploy an agent image to the configured cloud provider.
Source code in src/holodeck/cli/commands/deploy.py
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
status(agent_config, verbose, quiet)
¶
Check deployment status for an agent.
Source code in src/holodeck/cli/commands/deploy.py
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 | |
destroy(agent_config, force, verbose, quiet)
¶
Destroy a deployed agent.
Source code in src/holodeck/cli/commands/deploy.py
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 | |
handle_deployment_errors()
¶
Context manager for consistent error handling in deployment commands.
Catches and handles ConfigError, DeploymentError, and unexpected exceptions with appropriate logging, user feedback, and exit codes.
Exit codes
2: Configuration error 3: Deployment/execution error
Source code in src/holodeck/cli/commands/deploy.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
_generate_dockerfile_content(agent, deployment_config, version)
¶
Generate Dockerfile content for the agent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agent
|
Agent
|
Loaded Agent configuration model |
required |
deployment_config
|
DeploymentConfig
|
Deployment configuration |
required |
version
|
str
|
Version/tag for OCI labels |
required |
Returns:
| Type | Description |
|---|---|
str
|
Generated Dockerfile content |
Source code in src/holodeck/cli/commands/deploy.py
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 | |
_prepare_build_context(agent, deployment_config, agent_dir, version)
¶
Prepare build context directory with all required files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agent
|
Agent
|
Loaded Agent configuration model |
required |
deployment_config
|
DeploymentConfig
|
Deployment configuration |
required |
agent_dir
|
Path
|
Directory containing agent.yaml |
required |
version
|
str
|
Version for Dockerfile labels |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to temporary build context directory |
Source code in src/holodeck/cli/commands/deploy.py
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 | |
_display_build_success(result, quiet)
¶
Display build success message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
BuildResult
|
Build result with image details |
required |
quiet
|
bool
|
If True, only show minimal output |
required |
Source code in src/holodeck/cli/commands/deploy.py
678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 | |
_load_agent_and_deployment(agent_config)
¶
Source code in src/holodeck/cli/commands/deploy.py
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 | |
_ensure_azure_provider(deployment_config, operation)
¶
Source code in src/holodeck/cli/commands/deploy.py
720 721 722 723 724 725 726 727 728 729 | |
_resolve_image_uri(deployment_config)
¶
Source code in src/holodeck/cli/commands/deploy.py
732 733 734 735 736 737 738 739 740 741 742 | |
MCP Command¶
Manage MCP (Model Context Protocol) servers -- search, add, list, and remove.
mcp()
¶
Manage MCP (Model Context Protocol) servers.
Search the official MCP registry, add servers to your agent configuration, and manage installed servers.
MCP servers extend your agent's capabilities by providing access to external tools and data sources. Use 'holodeck mcp search' to discover available servers, then 'holodeck mcp add' to install them.
EXAMPLES:
Search for filesystem-related servers:
holodeck mcp search filesystem
Add a server to your agent:
holodeck mcp add io.github.modelcontextprotocol/server-filesystem
List installed servers:
holodeck mcp list
Remove a server:
holodeck mcp remove filesystem
For more information, see: https://useholodeck.ai/docs/mcp
Source code in src/holodeck/cli/commands/mcp.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | |
search(query, limit, as_json, verbose, quiet)
¶
Search the MCP registry for available servers.
QUERY is an optional search term to filter servers by name. If not provided, lists all available servers.
EXAMPLES:
Search for filesystem servers:
holodeck mcp search filesystem
List all servers (first page):
holodeck mcp search
Get results as JSON:
holodeck mcp search --json
Source code in src/holodeck/cli/commands/mcp.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | |
list_cmd(agent_file, global_only, show_all, as_json, verbose, quiet)
¶
List installed MCP servers.
By default, shows servers from the agent configuration in the current directory. Use -g to show global servers, or --all for both.
EXAMPLES:
List servers in agent.yaml:
holodeck mcp list
List global servers:
holodeck mcp list -g
List all servers with source labels:
holodeck mcp list --all
Source code in src/holodeck/cli/commands/mcp.py
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 | |
add(server, agent_file, global_install, server_version, transport, custom_name, verbose, quiet)
¶
Add an MCP server to your configuration.
SERVER is the server name from the MCP registry (e.g., io.github.modelcontextprotocol/server-filesystem).
By default, adds to agent.yaml in the current directory. Use -g to add to global configuration (~/.holodeck/config.yaml).
EXAMPLES:
Add filesystem server to agent:
holodeck mcp add io.github.modelcontextprotocol/server-filesystem
Add to global config:
holodeck mcp add io.github.modelcontextprotocol/server-github -g
Add specific version:
holodeck mcp add io.github.example/server --version 1.2.0
Source code in src/holodeck/cli/commands/mcp.py
544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 | |
remove(server, agent_file, global_remove, verbose, quiet)
¶
Remove an MCP server from your configuration.
SERVER is the name of the server to remove (e.g., 'filesystem').
By default, removes from agent.yaml in the current directory. Use -g to remove from global configuration.
EXAMPLES:
Remove from agent config:
holodeck mcp remove filesystem
Remove from global config:
holodeck mcp remove github -g
Source code in src/holodeck/cli/commands/mcp.py
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 | |
MCP Helper Functions¶
_truncate(text, max_len)
¶
Truncate text with ellipsis if too long.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to truncate. |
required |
max_len
|
int
|
Maximum length including ellipsis. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Truncated text with ellipsis if exceeded max_len. |
Source code in src/holodeck/cli/commands/mcp.py
45 46 47 48 49 50 51 52 53 54 55 56 57 | |
_get_transports(server)
¶
Get comma-separated transport types from server packages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server
|
RegistryServer
|
Registry server with package information. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Comma-separated transport types, or "stdio" if none found. |
Source code in src/holodeck/cli/commands/mcp.py
60 61 62 63 64 65 66 67 68 69 70 71 72 | |
_get_transport_list(server)
¶
Get list of transport types for JSON output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server
|
RegistryServer
|
Registry server with package information. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Sorted list of transport types, or ["stdio"] if none found. |
Source code in src/holodeck/cli/commands/mcp.py
75 76 77 78 79 80 81 82 83 84 85 86 87 | |
_get_version_display(server)
¶
Get version display string for table output.
Shows single version if only one, or latest version with count for multiple.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server
|
RegistryServer
|
Registry server with versions. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Version display string (e.g., "1.0.0" or "1.0.0 (+2)"). |
Source code in src/holodeck/cli/commands/mcp.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
_output_table(result)
¶
Format search results as a table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
SearchResult
|
Search result from the MCP registry. |
required |
Source code in src/holodeck/cli/commands/mcp.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
_output_json(result)
¶
Format search results as JSON.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
SearchResult
|
Search result from the MCP registry. |
required |
Source code in src/holodeck/cli/commands/mcp.py
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | |
_format_version_for_json(server)
¶
Format version details for JSON output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server
|
RegistryServer
|
Registry server with versions. |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, object]]
|
List of version detail dictionaries. |
Source code in src/holodeck/cli/commands/mcp.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
_extract_version_from_args(mcp_tool)
¶
Extract version from MCP tool args.
Parses the args list to find version specifiers like: - @modelcontextprotocol/[email protected] -> 1.0.0 - [email protected] -> 2.3.4-beta
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mcp_tool
|
MCPTool
|
MCPTool instance |
required |
Returns:
| Type | Description |
|---|---|
str
|
Version string or "-" if not found |
Source code in src/holodeck/cli/commands/mcp.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | |
_list_output_table(servers, show_source)
¶
Format installed servers list as a table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
servers
|
list[tuple[MCPTool, str]]
|
List of (MCPTool, source) tuples where source is "agent" or "global" |
required |
show_source
|
bool
|
Whether to show SOURCE column (for --all mode) |
required |
Source code in src/holodeck/cli/commands/mcp.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | |
_list_output_json(servers, show_source)
¶
Format installed servers list as JSON.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
servers
|
list[tuple[MCPTool, str]]
|
List of (MCPTool, source) tuples |
required |
show_source
|
bool
|
Whether to include source field |
required |
Source code in src/holodeck/cli/commands/mcp.py
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |
Serve Command¶
Start an HTTP server exposing an agent via AG-UI or REST protocol.
serve(agent_config, port, host, protocol, verbose, quiet, cors_origins)
¶
Start an HTTP server exposing an agent.
AGENT_CONFIG is the path to the agent.yaml configuration file.
Example:
holodeck serve examples/weather-agent.yaml
holodeck serve examples/assistant.yaml --port 9000 --protocol ag-ui
The server exposes the agent via HTTP with the specified protocol.
Protocols:
ag-ui AG-UI protocol (streaming SSE events)
rest REST API (JSON request/response)
Options:
--port / -p Port to listen on (default: 8000)
--host / -h Host to bind to (default: 127.0.0.1)
--protocol Protocol to use: ag-ui or rest (default: ag-ui)
--verbose / -v Enable verbose debug logging
--quiet / -q Suppress INFO logging output
--cors-origins Comma-separated CORS origins (default: *)
Source code in src/holodeck/cli/commands/serve.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
_run_server(agent, host, port, protocol, cors_origins, verbose, execution_config, observability_enabled=False)
async
¶
Run the HTTP server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agent
|
Agent
|
Loaded Agent configuration. |
required |
host
|
str
|
Host to bind to. |
required |
port
|
int
|
Port to listen on. |
required |
protocol
|
ProtocolType
|
Protocol type (AG-UI or REST). |
required |
cors_origins
|
list[str]
|
List of allowed CORS origins. |
required |
verbose
|
bool
|
Enable verbose debug logging. |
required |
execution_config
|
ExecutionConfig
|
Resolved execution configuration. |
required |
observability_enabled
|
bool
|
Enable OpenTelemetry per-request tracing. |
False
|
Source code in src/holodeck/cli/commands/serve.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |
_display_startup_info(agent, protocol, host, port)
¶
Display server startup information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agent
|
Agent
|
Agent configuration. |
required |
protocol
|
ProtocolType
|
Protocol type. |
required |
host
|
str
|
Host the server is bound to. |
required |
port
|
int
|
Port the server is listening on. |
required |
Source code in src/holodeck/cli/commands/serve.py
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | |
CLI Utilities¶
Project Initializer¶
Project initialization and scaffolding logic.
ProjectInitializer()
¶
Handles project initialization logic.
Provides methods to: - Validate user inputs (project name, template, permissions) - Load and validate template manifests - Initialize new agent projects with all required files
Initialize the ProjectInitializer.
Source code in src/holodeck/cli/utils/project_init.py
129 130 131 132 133 | |
validate_inputs(input_data)
¶
Validate user inputs for project initialization.
Checks: - Project name format (alphanumeric, hyphens, underscores, no leading digits) - Project name is not empty and within length limits - Template exists in available templates - Output directory is writable - Project directory doesn't already exist (unless overwrite is True)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_data
|
ProjectInitInput
|
ProjectInitInput with user-provided values |
required |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If any validation checks fail |
Source code in src/holodeck/cli/utils/project_init.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
load_template(template_name)
¶
Load and validate a template manifest.
Loads the manifest.yaml file from a template directory and validates it against the TemplateManifest schema.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
template_name
|
str
|
Name of the template (e.g., 'conversational') |
required |
Returns:
| Name | Type | Description |
|---|---|---|
TemplateManifest |
TemplateManifest
|
Parsed and validated template manifest |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If template or manifest file not found |
InitError
|
If manifest cannot be parsed or validated |
Source code in src/holodeck/cli/utils/project_init.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |
initialize(input_data)
¶
Initialize a new agent project.
Creates a new project directory with all required files and templates. Follows all-or-nothing semantics: either the entire project is created successfully, or no files are created and the directory is cleaned up.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_data
|
ProjectInitInput
|
ProjectInitInput with validated user inputs |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ProjectInitResult |
ProjectInitResult
|
Result of initialization with status and metadata |
Raises:
| Type | Description |
|---|---|
InitError
|
If initialization fails (will attempt cleanup) |
Source code in src/holodeck/cli/utils/project_init.py
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | |
get_model_for_provider(provider)
¶
Get the default model for an LLM provider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
provider
|
str
|
LLM provider identifier (e.g., 'ollama', 'openai'). |
required |
Returns:
| Type | Description |
|---|---|
str
|
Default model name for the provider. |
Source code in src/holodeck/cli/utils/project_init.py
29 30 31 32 33 34 35 36 37 38 39 40 41 | |
get_mcp_server_config(server_id)
¶
Get configuration for an MCP server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server_id
|
str
|
MCP server identifier (e.g., 'brave-search', 'memory'). |
required |
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
Dictionary with server configuration (name, package, command). |
Source code in src/holodeck/cli/utils/project_init.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
get_vectorstore_endpoint(store)
¶
Get the default endpoint for a vector store.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
store
|
str
|
Vector store identifier (e.g., 'chromadb', 'qdrant'). |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Default endpoint URL or None if not applicable. |
Source code in src/holodeck/cli/utils/project_init.py
71 72 73 74 75 76 77 78 79 80 81 82 83 | |
get_provider_api_key_env_var(provider)
¶
Get the API key environment variable name for an LLM provider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
provider
|
str
|
LLM provider identifier (e.g., 'openai', 'azure_openai'). |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Environment variable name for API key, or None if not required. |
Source code in src/holodeck/cli/utils/project_init.py
86 87 88 89 90 91 92 93 94 95 96 97 98 | |
get_provider_endpoint_env_var(provider)
¶
Get the endpoint environment variable name for an LLM provider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
provider
|
str
|
LLM provider identifier (e.g., 'azure_openai'). |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Environment variable name for endpoint, or None if not required. |
Source code in src/holodeck/cli/utils/project_init.py
101 102 103 104 105 106 107 108 109 110 111 112 113 | |
Interactive Wizard¶
Interactive configuration wizard for holodeck init.
run_wizard(skip_agent_name=False, skip_template=False, skip_llm=False, skip_provider_config=False, skip_vectorstore=False, skip_evals=False, skip_mcp=False, agent_name_default=None, template_default='conversational', llm_default='ollama', provider_config_default=None, vectorstore_default='chromadb', evals_defaults=None, mcp_defaults=None)
¶
Run interactive configuration wizard.
Prompts user for agent name, template, LLM provider, provider-specific config, vector store, evaluation metrics, and MCP server selections. Skips prompts for values provided via CLI flags (when skip_* is True).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skip_agent_name
|
bool
|
Skip agent name prompt (use agent_name_default). |
False
|
skip_template
|
bool
|
Skip template prompt (use template_default). |
False
|
skip_llm
|
bool
|
Skip LLM prompt (use llm_default). |
False
|
skip_provider_config
|
bool
|
Skip provider config prompts (use provider_config_default). |
False
|
skip_vectorstore
|
bool
|
Skip vectorstore prompt (use vectorstore_default). |
False
|
skip_evals
|
bool
|
Skip evals prompt (use evals_defaults). |
False
|
skip_mcp
|
bool
|
Skip MCP prompt (use mcp_defaults). |
False
|
agent_name_default
|
str | None
|
Default agent name value. |
None
|
template_default
|
str
|
Default template value (default: "conversational"). |
'conversational'
|
llm_default
|
str
|
Default LLM provider value (default: "ollama"). |
'ollama'
|
provider_config_default
|
ProviderConfig | None
|
Default provider config (endpoint, deployment name). |
None
|
vectorstore_default
|
str
|
Default vector store value (default: "chromadb"). |
'chromadb'
|
evals_defaults
|
list[str] | None
|
Default evaluation metrics list. |
None
|
mcp_defaults
|
list[str] | None
|
Default MCP server list. |
None
|
Returns:
| Type | Description |
|---|---|
WizardResult
|
WizardResult with all validated selections. |
Raises:
| Type | Description |
|---|---|
WizardCancelledError
|
If user cancels with Ctrl+C at any prompt. |
Source code in src/holodeck/cli/utils/wizard.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 | |
is_interactive()
¶
Check if terminal supports interactive prompts.
Checks whether both stdin and stdout are connected to a TTY (terminal). This is used to determine if the wizard can run interactively or should fall back to non-interactive mode.
Returns:
| Type | Description |
|---|---|
bool
|
True if stdin and stdout are both TTYs, False otherwise. |
Source code in src/holodeck/cli/utils/wizard.py
38 39 40 41 42 43 44 45 46 47 48 | |
WizardCancelledError
¶
Bases: Exception
Raised when user cancels the wizard (Ctrl+C).
This exception is raised when the user presses Ctrl+C during any interactive prompt in the wizard flow. The caller should handle this exception to clean up any partial state.
CLI Exceptions¶
CLI-specific exception hierarchy. All exceptions inherit from CLIError.
CLIError
¶
Bases: Exception
Base exception for all CLI errors.
This is the parent class for all exceptions raised by the CLI module. Users can catch this to handle any CLI error generically.
ValidationError
¶
Bases: CLIError
Raised when user input validation fails.
This exception is raised when: - Project name is invalid (special characters, leading digits, etc.) - Template choice doesn't exist - Directory permissions are insufficient - Input constraints are violated
Attributes:
| Name | Type | Description |
|---|---|---|
message |
Description of the validation failure |
InitError
¶
Bases: CLIError
Raised when project initialization fails.
This exception is raised when: - Directory creation fails - File writing fails - Cleanup fails after partial creation - Unexpected errors occur during initialization
Attributes:
| Name | Type | Description |
|---|---|---|
message |
Description of the initialization failure |
TemplateError
¶
Bases: CLIError
Raised when template processing fails.
This exception is raised when: - Template manifest is malformed or missing - Jinja2 rendering fails - Generated YAML doesn't validate against schema - Template variables are missing or invalid
Attributes:
| Name | Type | Description |
|---|---|---|
message |
Description of the template failure |
ChatConfigError(message)
¶
Bases: CLIError
Raised when chat command cannot load agent configuration.
Initialize the error with a human-readable message.
Source code in src/holodeck/cli/exceptions.py
71 72 73 74 | |
ChatAgentInitError(message)
¶
Bases: CLIError
Raised when agent initialization fails for chat sessions.
Initialize the error with a human-readable message.
Source code in src/holodeck/cli/exceptions.py
82 83 84 85 | |
ChatRuntimeError(message, exit_code=None)
¶
Bases: CLIError
Raised for runtime chat failures that should exit the CLI.
Initialize the error with optional exit code override.
Source code in src/holodeck/cli/exceptions.py
93 94 95 96 97 | |
ChatValidationError(message)
¶
Bases: CLIError
Raised for recoverable user input validation errors during chat.
Initialize the error with a human-readable message.
Source code in src/holodeck/cli/exceptions.py
105 106 107 108 | |
Usage from Python¶
You can invoke CLI commands programmatically:
from holodeck.cli.main import main
from click.testing import CliRunner
runner = CliRunner()
# Initialize a new project
result = runner.invoke(main, ['init', '--template', 'conversational', '--name', 'my-agent'])
print(result.output)
# Run tests
result = runner.invoke(main, ['test', 'path/to/agent.yaml'])
print(result.output)
# Start an interactive chat session
result = runner.invoke(main, ['chat', 'agent.yaml'])
print(result.output)
# Start an HTTP server
result = runner.invoke(main, ['serve', 'agent.yaml', '--port', '9000'])
print(result.output)
# Build a container image
result = runner.invoke(main, ['deploy', 'build', 'agent.yaml', '--dry-run'])
print(result.output)
# Deploy to cloud
result = runner.invoke(main, ['deploy', 'run', 'agent.yaml'])
print(result.output)
# Check deployment status
result = runner.invoke(main, ['deploy', 'status', 'agent.yaml'])
print(result.output)
# Destroy a deployment
result = runner.invoke(main, ['deploy', 'destroy', 'agent.yaml', '--force'])
print(result.output)
# Search MCP registry
result = runner.invoke(main, ['mcp', 'search', 'filesystem'])
print(result.output)
# Add an MCP server
result = runner.invoke(main, ['mcp', 'add', 'io.github.modelcontextprotocol/server-filesystem'])
print(result.output)
# List installed MCP servers
result = runner.invoke(main, ['mcp', 'list'])
print(result.output)
# Remove an MCP server
result = runner.invoke(main, ['mcp', 'remove', 'filesystem'])
print(result.output)
# Initialize configuration
result = runner.invoke(main, ['config', 'init', '-g'])
print(result.output)
CLI Entry Point¶
The CLI is registered as the holodeck command via pyproject.toml:
[project.scripts]
holodeck = "holodeck.cli.main:main"
After installation, use from terminal:
# Initialize a new project with interactive wizard
holodeck init
# Quick non-interactive setup
holodeck init --name my-agent --non-interactive
# Run tests (defaults to agent.yaml in current directory)
holodeck test
# Or specify explicit path
holodeck test agent.yaml --verbose --output report.md
# Interactive chat session
holodeck chat agent.yaml
# Start HTTP server with AG-UI protocol
holodeck serve agent.yaml --port 8000 --protocol ag-ui
# Build and deploy containers
holodeck deploy build agent.yaml --tag v1.0.0
holodeck deploy run agent.yaml
holodeck deploy status agent.yaml
holodeck deploy destroy agent.yaml
# MCP server management
holodeck mcp search filesystem
holodeck mcp add io.github.modelcontextprotocol/server-filesystem
holodeck mcp list
holodeck mcp list --all
holodeck mcp remove filesystem
# Configuration management
holodeck config init -g
holodeck config init -p
Related Documentation¶
- Template Models: Template manifest and metadata models
- Configuration Loading: Configuration system
- Test Runner: Test execution