Services API Reference
Core service classes that power Burner CLI functionality.
Manages burner projects - listing, retrieving, deleting, and importing.
Constructor
ProjectService(BurnerConfig config)
Creates a new instance of the ProjectService.
Methods
GetAllProjects()
Returns all projects in the burner home directory, sorted by creation date (newest first). Returns: An enumerable of all burner projects.
GetProject(String name)
Gets a project by name. Supports partial name matching (suffix match). Returns: The matching project, or null if not found.
CleanupProjects(Int32? days)
Deletes projects older than the specified days. Uses config default if not provided. Returns: Count of deleted projects.
DeleteProject(String name)
Deletes a project by name. Returns: True if successful, false otherwise.
GetImportDestinationPath(String projectName)
Gets the destination path for an import operation without performing the import. Returns: The destination path, or null if destination already exists.
ImportProject(String sourceDir, String destinationPath, Boolean copy)
Imports a directory to burner home. Moves by default, copies if specified. Returns: A tuple containing success status and the resulting path.
Manages templates - listing, creating projects, and handling built-in/custom templates.
Constructor
TemplateService(BurnerConfig config)
Creates a new instance. Ensures built-in templates exist in the templates directory.
Methods
GetAvailableTemplates()
Returns template names (without file extensions). Returns: An enumerable of available template names.
GetAvailableTemplatesWithDetails()
Returns templates with full details including filename and built-in status. Returns: An enumerable of tuples containing template name, filename, and built-in status.
IsInteractiveTemplate(String template)
Checks if a template requires interactive mode by looking for BURNER_INTERACTIVE marker. Returns: True if the template requires interactive mode.
CreateProject(String template, String name, String targetDirectory, Boolean interactive)
Creates a new project from a template. Returns: True if the project was created successfully.