template
The template domain has 15 actions. On the meta surface they are all reached through arcane_template; on the individual surface each one is its own tool; on the dynamic surface run them with arcane_execute_action and the canonical ID.
Summary
Section titled “Summary”| Action | Title | Kind |
|---|---|---|
template.content | Get template content | read |
template.create | Create a template | write |
template.default_get | Get default templates | read |
template.default_save | Save default templates | destructive |
template.delete | Delete a template | destructive |
template.download | Download a template | write |
template.get | Get a template | read |
template.list | List templates (paginated) | read |
template.list_all | List all templates | read |
template.registry_create | Create a template registry | write |
template.registry_delete | Delete a template registry | destructive |
template.registry_fetch | Fetch remote registry | read |
template.registry_list | List template registries | read |
template.registry_update | Update a template registry | write |
template.update | Update a template | write |
Actions
Section titled “Actions”template.content
Section titled “template.content”Get template content
Get the compose content for a template with parsed data
- Kind: read
- Required parameters:
id - Meta tool:
arcane_templatewith"action": "content" - Individual tool:
arcane_template_content - Arcane route:
GET /api/templates/{id}/content - Operation ID:
getTemplateContent - Usage: id from template.list or template.list_all, local or remote. For a remote template Arcane fetches the compose (and env) file from its registry URLs now. Returns template, content (compose YAML), envContent, services (service names), envVariables (key/value from the env file) and isFolderTemplate (true when the template lives in a folder of the templates directory, whose name and description template.update keeps): the compose and env text to pass to project.create.
- Related actions:
template.list,template.get,project.create
template.create
Section titled “template.create”Create a template
Create a new compose template
- Kind: write
- Required parameters:
content,description,envContent,name - Meta tool:
arcane_templatewith"action": "create" - Individual tool:
arcane_template_create - Arcane route:
POST /api/templates - Operation ID:
createTemplate - Usage: Saves a custom compose template in Arcane’s database (not as a folder in the templates directory). name and content (compose YAML) are needed and description and envContent must be sent too, as "" when unused. Returns the template with its new id, used by template.get, template.update and template.delete.
- Related actions:
template.get,template.list,template.update,template.default_get
template.default_get
Section titled “template.default_get”Get default templates
Get the default compose and env templates
- Kind: read
- Required parameters: none
- Meta tool:
arcane_templatewith"action": "default_get" - Individual tool:
arcane_template_default_get - Arcane route:
GET /api/templates/default - Operation ID:
getDefaultTemplates - Usage: Returns the starting files Arcane’s UI pre-fills for a new project (composeTemplate, envTemplate) and a new Swarm stack (swarmStackTemplate, swarmStackEnvTemplate), read from the .compose.template, .env.template and .swarm-stack*.template files in the templates directory. Read it before template.default_save, which replaces the compose and env pair.
- Related actions:
template.default_save,template.list
template.default_save
Section titled “template.default_save”Save default templates
Save the default compose and env templates
- Kind: destructive — requires
confirm: true - Required parameters:
composeContent,envContent - Meta tool:
arcane_templatewith"action": "default_save" - Individual tool:
arcane_template_default_save - Arcane route:
POST /api/templates/default - Operation ID:
saveDefaultTemplates - Usage: Overwrites the default new-project files .compose.template and .env.template in the templates directory with composeContent and envContent. Both are written as given, so send envContent too ("" empties it). The Swarm stack defaults are not changed by this action. Fetch the current values with template.default_get first to edit rather than replace.
- Related actions:
template.default_get
template.delete
Section titled “template.delete”Delete a template
Delete a compose template
- Kind: destructive — requires
confirm: true - Required parameters:
id - Meta tool:
arcane_templatewith"action": "delete" - Individual tool:
arcane_template_delete - Arcane route:
DELETE /api/templates/{id} - Operation ID:
deleteTemplate - Usage: id of a local template from template.list. Remote registry templates cannot be deleted (404), so remove their registry with template.registry_delete instead. For a downloaded or folder-imported template (description ‘Imported from <path>’) it also deletes its folder in the templates directory, which is how such templates are removed for good. A template.create template that only shares its name with a folder leaves that folder alone. Projects created from the template are not affected.
- Related actions:
template.list,template.get,template.registry_delete
template.download
Section titled “template.download”Download a template
Download a remote template to local storage
- Kind: write
- Required parameters:
id - Meta tool:
arcane_templatewith"action": "download" - Individual tool:
arcane_template_download - Arcane route:
POST /api/templates/{id}/download - Operation ID:
downloadTemplate - Usage: Copies a remote template (id remote:<registry>:<template>, from template.list_all) into a local custom template, writing its compose and env files to a folder in the templates directory. Downloading it again updates the same local copy. Returns the local template with a new id and its content. It fails if the template’s compose_url cannot be fetched and needs templates:create (it writes a template), not just read access.
- Related actions:
template.list_all,template.get,template.content
template.get
Section titled “template.get”Get a template
Get a compose template by ID
- Kind: read
- Required parameters:
id - Meta tool:
arcane_templatewith"action": "get" - Individual tool:
arcane_template_get - Arcane route:
GET /api/templates/{id} - Operation ID:
getTemplate - Usage: id from template.list or template.list_all. A local template returns its stored content and envContent. A remote one (id remote:…) returns only name, description, registry and metadata (remoteUrl, envUrl, tags) with empty content, so use template.content for the compose text. 404 if the id is unknown.
- Related actions:
template.list,template.content,template.update,template.delete
template.list
Section titled “template.list”List templates (paginated)
Get a paginated list of compose templates
- Kind: read
- Required parameters: none
- Meta tool:
arcane_templatewith"action": "list" - Individual tool:
arcane_template_list - Arcane route:
GET /api/templates - Operation ID:
listTemplatesPaginated - Usage: A page of local and remote templates (id, name, description, isCustom, isRemote, registryId, metadata) plus pagination. Content fields are left empty, so read them with template.get or template.content. search matches name, description and metadata tags. type=false keeps only local templates, type=true only remote registry templates (id remote:<registryId>:<slug>). Sort by name, description or isRemote. Paginate with start and limit (default 20).
- Related actions:
template.list_all,template.get,template.content,template.registry_list
template.list_all
Section titled “template.list_all”List all templates
Get all compose templates without pagination
- Kind: read
- Required parameters: none
- Meta tool:
arcane_templatewith"action": "list_all" - Individual tool:
arcane_template_list_all - Arcane route:
GET /api/templates/all - Operation ID:
getAllTemplates - Usage: Every template in one unpaginated array: local ones (custom, downloaded, and folders found in the templates directory) and the remote templates of all enabled registries (isRemote true, id remote:<registryId>:<slug>), without content. A registry that cannot be fetched is skipped silently, and its error shows as lastFetchError in template.registry_list. Use template.list to search or page.
- Related actions:
template.list,template.content,template.download,template.registry_list
template.registry_create
Section titled “template.registry_create”Create a template registry
Create a new template registry
- Kind: write
- Required parameters:
description,enabled,name,url - Meta tool:
arcane_templatewith"action": "registry_create" - Individual tool:
arcane_template_registry_create - Arcane route:
POST /api/templates/registries - Operation ID:
createTemplateRegistry - Usage: Adds a registry: url of a JSON manifest {name, description, templates:[{id, name, compose_url, env_url, …}]}. name, description and enabled must be sent, and an empty name or description is filled from the manifest (the create then fails if the manifest cannot be fetched). Arcane only fetches public addresses, so a URL resolving to a private or loopback address never yields templates. Its templates then appear in template.list_all as remote templates. Check the URL first with template.registry_fetch.
- Related actions:
template.registry_fetch,template.registry_list,template.list_all
template.registry_delete
Section titled “template.registry_delete”Delete a template registry
- Kind: destructive — requires
confirm: true - Required parameters:
id - Meta tool:
arcane_templatewith"action": "registry_delete" - Individual tool:
arcane_template_registry_delete - Arcane route:
DELETE /api/templates/registries/{id} - Operation ID:
deleteTemplateRegistry - Usage: id from template.registry_list. Removes the registry so its remote templates disappear from template.list_all, and local copies made with template.download are kept. Use template.registry_update with enabled=false to hide it temporarily instead.
- Related actions:
template.registry_list,template.registry_update
template.registry_fetch
Section titled “template.registry_fetch”Fetch remote registry
Fetch templates from a remote registry URL
- Kind: read
- Required parameters:
url - Meta tool:
arcane_templatewith"action": "registry_fetch" - Individual tool:
arcane_template_registry_fetch - Arcane route:
GET /api/templates/fetch - Operation ID:
fetchTemplateRegistry - Usage: Fetches and returns a registry manifest (name, description, version, author, templates with compose_url, env_url, tags) without saving anything, to check a URL before template.registry_create. The URL must resolve to a public address, and any fetch or JSON failure comes back as a bare 502 without the reason.
- Related actions:
template.registry_create,template.registry_list
template.registry_list
Section titled “template.registry_list”List template registries
Get all template registries
- Kind: read
- Required parameters: none
- Meta tool:
arcane_templatewith"action": "registry_list" - Individual tool:
arcane_template_registry_list - Arcane route:
GET /api/templates/registries - Operation ID:
getTemplateRegistries - Usage: Lists the configured template registries (id, name, url, description, enabled). lastFetchError is set when the last attempt to load that registry’s templates failed (for example a private-address URL or invalid JSON). The id is what template.registry_update and template.registry_delete take and what remote template ids embed (remote:<registryId>:<slug>).
- Related actions:
template.registry_create,template.registry_update,template.registry_delete,template.list_all
template.registry_update
Section titled “template.registry_update”Update a template registry
Update an existing template registry
- Kind: write
- Required parameters:
id,description,enabled,name,url - Meta tool:
arcane_templatewith"action": "registry_update" - Individual tool:
arcane_template_registry_update - Arcane route:
PUT /api/templates/registries/{id} - Operation ID:
updateTemplateRegistry - Usage: id from template.registry_list. Replaces name, url, description and enabled together (send all four, enabled=false hides the registry’s templates without deleting it). A blank name or description is refilled from the manifest. Clears the cached remote templates, so template.list_all reloads every registry.
- Related actions:
template.registry_list,template.registry_fetch,template.list_all
template.update
Section titled “template.update”Update a template
Update an existing compose template
- Kind: write
- Required parameters:
id,content,description,envContent,name - Meta tool:
arcane_templatewith"action": "update" - Individual tool:
arcane_template_update - Arcane route:
PUT /api/templates/{id} - Operation ID:
updateTemplate - Usage: id of a local template from template.list (remote ones, id remote:…, return 404). Replaces name, description, content and envContent as a whole: send all four, and envContent "" removes the env file content. For a template backed by a templates-directory folder (downloaded or folder-imported: description ‘Imported from <path>’, isFolderTemplate true in template.content) content and envContent are written to the folder’s files, so the edit lasts, while name and description must be sent unchanged (a changed one fails with 400). A template.create template only changes its database record. Returns the updated template.
- Related actions:
template.get,template.list,template.content,template.create