CLI API Reference¶
HoloDeck provides a command-line interface for project initialization, agent testing, and configuration management. This section documents the programmatic CLI API.
Main CLI¶
Entry point for the HoloDeck CLI application using Click.
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
Initialize and manage AI agent projects with YAML configuration.
Source code in src/holodeck/cli/main.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
CLI Commands¶
Init Command¶
Initialize a new HoloDeck project with bundled templates.
init(project_name, template, description, author, force, llm, vectorstore, evals_arg, mcp_arg, non_interactive)
¶
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
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 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 | |
Test Command¶
Run tests for a HoloDeck agent with evaluation and reporting.
test(agent_config, output, format, verbose, quiet, timeout, force_ingest)
¶
Execute agent test cases with evaluation metrics.
Runs test cases defined in the agent configuration file and displays pass/fail status with evaluation metric scores.
AGENT_CONFIG is the path to the agent.yaml configuration file.
Source code in src/holodeck/cli/commands/test.py
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 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 | |
CLI Utilities¶
Project initialization and scaffolding utilities.
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 | |
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 | |
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 | |
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 | |
CLI Exceptions¶
CLI-specific exception handling.
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 |
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)
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:
holodeck init --template conversational --name my-agent
holodeck test agent.yaml
Related Documentation¶
- Project Templates: Available templates
- Configuration Loading: Configuration system
- Test Runner: Test execution