Script Management lets you discover, read, write, organize, and inspect executable scripts and their magic-comment metadata. Use these endpoints to browse exec IDs, list and traverse script directories, read or modify script content, move or delete files, and manage magic-comment directives used by the runtime.
Returns the IDs of all available exec scopes (SDK and custom) along with a summary count.
This endpoint takes no parameters.
curl -X GET https://api.hoody.com/v1/exec/list \
-H " Authorization: Bearer <token> "
const { data } = await client . exec . ids . list ();
"id" : " exec_a1b2c3d4e5f6 " ,
"source_url" : " https://github.com/hoody/scripts.git " ,
"id" : " exec_custom_9z8y7x " ,
"error" : " VALIDATION_ERROR " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"reason" : " Malformed payload "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"error" : " Internal server error " ,
"timestamp" : " 2025-01-15T10:30:00.000Z "
Magic comments are parsed directives embedded at the top of a script that control runtime behavior, logging, CORS, AI features, and metadata. The endpoints below let you read them, inspect their schema, and update them.
Parses and returns the magic-comment directives found at the top of a script file. Tokens are redacted in the response.
Name In Type Required Description pathquery string Yes Path query parameter
curl -X GET " https://api.hoody.com/v1/exec/magic-comments/read?path=scripts/translate.ts " \
-H " Authorization: Bearer <token> "
const { data } = await client . exec . magic . read ( { path: " scripts/translate.ts " } );
"path" : " scripts/translate.ts " ,
"error" : " VALIDATION_ERROR " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"reason" : " Path is required "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"reason" : " Insufficient permissions "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"path" : " scripts/missing.ts "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
"error" : " Internal server error " ,
"timestamp" : " 2025-01-15T10:30:00.000Z "
Returns the canonical schema describing every supported magic-comment directive, including categories, default values, and accepted ranges.
This endpoint takes no parameters.
curl -X GET https://api.hoody.com/v1/exec/magic-comments/schema \
-H " Authorization: Bearer <token> "
const { data } = await client . exec . magic . getSchema ();
"schema_version" : " 1.0.0 " ,
"parse_window_lines" : 50 ,
"unknown_keys_behavior" : " warn " ,
"when_omitted" : " fallback " ,
"sdk_import" : " @hoody/runtime "
"interface" : " MagicComment " ,
"parser" : " scripts/parser.ts " ,
"runtime_defaults" : " runtime/defaults.ts " ,
"sdk_import_defaults" : " @hoody/runtime/defaults "
"execution" : [ " runtime " , " timeout " , " memory " ],
"logging" : [ " level " , " redact " ],
"ai" : [ " model " , " temperature " ],
"metadata" : [ " name " , " owner " ]
"error" : " VALIDATION_ERROR " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"error" : " Internal server error " ,
"timestamp" : " 2025-01-15T10:30:00.000Z "
Applies or previews a batch of magic-comment changes across every script in a directory. Supports dry_run to preview the diff before writing.
This endpoint takes no path, query, or header parameters.
Name Type Required Default Description directorystring No — Target directory to scan execIdstring No — Execution scope for path resolution commentsstring No — New magic-comment block to apply extensionstring No ".ts"File extension filter recursiveboolean No trueRecurse into subdirectories dry_runboolean No falseWhen true, returns a preview without writing
curl -X POST https://api.hoody.com/v1/exec/magic-comments/bulk-update \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
"comments": "// @hoody.comtime node22\n// @hoody.timeout 30000",
const { data } = await client . exec . magic . bulkUpdate ( {
comments: " // @hoody.comtime node22 \n // @hoody.timeout 30000 " ,
"execId" : " exec_a1b2c3d4e5f6 " ,
"file" : " scripts/translate.ts " ,
"current" : { "runtime" : " node20 " },
"proposed" : { "runtime" : " node22 " , "timeout" : 30000 },
"changes" : [ " runtime " , " timeout " ]
"file" : " scripts/summarize.ts " ,
"proposed" : { "runtime" : " node22 " , "timeout" : 30000 },
"changes" : [ " runtime " , " timeout " ]
"message" : " Preview only - set dry_run=false to apply changes "
"error" : " VALIDATION_ERROR " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"reason" : " Directory does not exist "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"timestamp" : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"directory" : " scripts/missing "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
"error" : " Internal server error " ,
"timestamp" : " 2025-01-15T10:30:00.000Z "
Updates the magic comments of a single script file. Supports dry_run to preview changes before applying them.
This endpoint takes no path, query, or header parameters.
Name Type Required Default Description pathstring Yes — Path of the script to update commentsstring No — New magic-comment block dry_runboolean No falseWhen true, returns a preview without writing
curl -X PUT https://api.hoody.com/v1/exec/magic-comments/update \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
"path": "scripts/translate.ts",
"comments": "// @hoody.comtime node22",
const { data } = await client . exec . magic . updateHandler ( {
path: " scripts/translate.ts " ,
comments: " // @hoody.comtime node22 " ,
"path" : " scripts/translate.ts " ,
"current" : { "runtime" : " node20 " },
"proposed" : { "runtime" : " node22 " },
"message" : " Preview only - set dry_run=false to apply changes "
"error" : " VALIDATION_ERROR " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"reason" : " Path is required "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"timestamp" : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"path" : " scripts/missing.ts "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
"error" : " Internal server error " ,
"timestamp" : " 2025-01-15T10:30:00.000Z "
These endpoints operate on script files within an exec scope: listing, reading, writing, moving, traversing, and deleting.
Lists scripts and directories within a target folder, with optional filters for label, tags, mode, enabled state, and WebSocket usage.
Name In Type Required Description dirquery string No Dir query parameter filterquery string No Filter query parameter metadataquery string No Metadata query parameter labelquery string No Label query parameter tagsquery string No Tags query parameter modequery string No Mode query parameter enabledquery string No Enabled query parameter websocketquery string No Websocket query parameter recursivequery string No Recursive query parameter include_commentsquery string No Include_comments query parameter execIdquery string No Optional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body. exec_idquery string No Alias for execId (snake_case). subdomainquery string No Optional subdomain namespace used with execId for path resolution.
curl -X GET " https://api.hoody.com/v1/exec/scripts/list?dir=scripts&recursive=true&label=ai " \
-H " Authorization: Bearer <token> "
const { data } = await client . exec . scripts . list ( {
"path" : " scripts/translate.ts " ,
"path" : " scripts/summarize.ts " ,
"path" : " scripts/agents " ,
"error" : " VALIDATION_ERROR " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"reason" : " Invalid directory path "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"timestamp" : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"directory" : " scripts/missing "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
"error" : " Internal server error " ,
"timestamp" : " 2025-01-15T10:30:00.000Z "
Reads the raw content of a script, its parsed magic comments, and file metadata.
Name In Type Required Description pathquery string Yes Path query parameter execIdquery string No Optional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body. exec_idquery string No Alias for execId (snake_case). subdomainquery string No Optional subdomain namespace used with execId for path resolution.
curl -X GET " https://api.hoody.com/v1/exec/scripts/read?path=scripts/translate.ts " \
-H " Authorization: Bearer <token> "
const { data } = await client . exec . scripts . read ( { path: " scripts/translate.ts " } );
"path" : " scripts/translate.ts " ,
"resolvedPath" : " /exec/exec_a1b2c3d4e5f6/scripts/translate.ts " ,
"content" : " // @hoody.comtime node22 \n import { translate } from '@hoody/runtime'; \n\n export default translate; \n " ,
"created" : " 2025-01-10T08:21:00.000Z " ,
"modified" : " 2025-01-12T14:05:00.000Z " ,
"error" : " VALIDATION_ERROR " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"reason" : " Path is required "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"timestamp" : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"path" : " scripts/missing.ts "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
"error" : " Internal server error " ,
"timestamp" : " 2025-01-15T10:30:00.000Z "
Creates or overwrites a script file. Optionally validates the content and creates intermediate directories.
Name In Type Required Description execIdquery string No Optional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body. exec_idquery string No Alias for execId (snake_case). subdomainquery string No Optional subdomain namespace used with execId for path resolution.
Name Type Required Default Description pathstring Yes — Target path for the script contentstring Yes — Full script content to write createDirsboolean No trueCreate intermediate directories if missing validateboolean No trueValidate the script before persisting execIdstring No — Optional execution scope in request body. Query execId/exec_id takes precedence when both are provided. exec_idstring No — Alias for execId (snake_case). subdomainstring No — Optional subdomain namespace used with execId for path resolution.
curl -X POST https://api.hoody.com/v1/exec/scripts/write \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
"path": "scripts/translate.ts",
"content": "// @hoody.comtime node22\nexport default async () => \"ok\";\n",
const { data } = await client . exec . scripts . write ( {
path: " scripts/translate.ts " ,
content: " // @hoody.comtime node22 \n export default async () => \" ok \" ; \n " ,
"path" : " scripts/translate.ts " ,
"resolvedPath" : " /exec/exec_a1b2c3d4e5f6/scripts/translate.ts " ,
"modified" : " 2025-01-15T10:30:00.000Z " ,
"reason" : " No scheduling directives declared "
"error" : " VALIDATION_ERROR " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"reason" : " Content failed validation "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"timestamp" : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
"error" : " Internal server error " ,
"timestamp" : " 2025-01-15T10:30:00.000Z "
Renames or relocates a script within an exec scope. Returns a 409 Conflict when the destination already exists and overwrite is false.
Name In Type Required Description execIdquery string No Optional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body. exec_idquery string No Alias for execId (snake_case). subdomainquery string No Optional subdomain namespace used with execId for path resolution.
Name Type Required Default Description fromstring Yes — Source path of the script tostring Yes — Destination path overwriteboolean No falseAllow replacing an existing destination execIdstring No — Optional execution scope in request body. Query execId/exec_id takes precedence when both are provided. exec_idstring No — Alias for execId (snake_case). subdomainstring No — Optional subdomain namespace used with execId for path resolution.
curl -X POST https://api.hoody.com/v1/exec/scripts/move \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
"from": "scripts/draft/translate.ts",
"to": "scripts/translate.ts",
const { data } = await client . exec . scripts . move ( {
from: " scripts/draft/translate.ts " ,
to: " scripts/translate.ts " ,
"from" : " scripts/draft/translate.ts " ,
"to" : " scripts/translate.ts " ,
"resolvedFrom" : " /exec/exec_a1b2c3d4e5f6/scripts/draft/translate.ts " ,
"resolvedTo" : " /exec/exec_a1b2c3d4e5f6/scripts/translate.ts " ,
"error" : " VALIDATION_ERROR " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"reason" : " Source path is required "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"timestamp" : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"path" : " scripts/draft/missing.ts "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"reason" : " Destination already exists " ,
"path" : " scripts/translate.ts "
Error Code Title Description Resolution CONFLICTResource conflict Operation conflicts with existing resource state Check resource state and retry
"error" : " Internal server error " ,
"timestamp" : " 2025-01-15T10:30:00.000Z "
Returns a hierarchical tree of scripts and folders rooted at the requested base directory.
Name In Type Required Description execIdquery string No Optional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body. exec_idquery string No Alias for execId (snake_case). subdomainquery string No Optional subdomain namespace used with execId for path resolution.
Name Type Required Default Description baseDirstring No ""Root directory to traverse maxDepthinteger No 10Maximum tree depth includeMetadataboolean No falseAttach metadata to each node execIdstring No — Optional execution scope in request body. Query execId/exec_id takes precedence when both are provided. exec_idstring No — Alias for execId (snake_case). subdomainstring No — Optional subdomain namespace used with execId for path resolution.
curl -X POST https://api.hoody.com/v1/exec/scripts/tree \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
const { data } = await client . exec . scripts . getTree ( {
"path" : " scripts/translate.ts "
"path" : " scripts/agents/router.ts "
"error" : " VALIDATION_ERROR " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"reason" : " maxDepth must be a positive integer "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"timestamp" : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"directory" : " scripts/missing "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
"error" : " Internal server error " ,
"timestamp" : " 2025-01-15T10:30:00.000Z "
Permanently removes a script file. A confirm token is recommended to guard against accidental deletion.
Name In Type Required Description pathquery string Yes Path query parameter confirmquery string No Confirm query parameter execIdquery string No Optional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body. exec_idquery string No Alias for execId (snake_case). subdomainquery string No Optional subdomain namespace used with execId for path resolution.
curl -X DELETE " https://api.hoody.com/v1/exec/scripts/delete?path=scripts/translate.ts&confirm=true " \
-H " Authorization: Bearer <token> "
const { data } = await client . exec . scripts . delete ( {
path: " scripts/translate.ts " ,
"path" : " scripts/translate.ts " ,
"resolvedPath" : " /exec/exec_a1b2c3d4e5f6/scripts/translate.ts " ,
"error" : " VALIDATION_ERROR " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"reason" : " Path is required "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"timestamp" : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
"timestamp" : " 2025-01-15T10:30:00.000Z " ,
"path" : " scripts/missing.ts "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
"error" : " Internal server error " ,
"timestamp" : " 2025-01-15T10:30:00.000Z "