Skip to content

The Package Management API provides programmatic access to the package.json lifecycle within an Exec project. Use these endpoints to read, initialize, update, compare, install, and pin dependency versions, enabling automation of dependency management without manual file editing.


Reads the current package.json file, returning its raw content along with parsed dependencies, devDependencies, and scripts blocks and their respective counts.

This endpoint takes no parameters.

Terminal window
curl -X GET https://api.hoody.com/api/v1/exec/package/read \
-H "Authorization: Bearer <token>"

Initializes a new package.json in the current Exec project directory. By default, the file is created with sensible Hoody Exec defaults. Set force: true to overwrite an existing package.json.

This endpoint takes no parameters.

Request Body

NameTypeRequiredDefaultDescription
namestringNo"hoody-exec-project"Name of the package
versionstringNo"1.0.0"Initial version string
descriptionstringNo"Hoody Exec project"Human-readable description
forcebooleanNofalseOverwrite an existing package.json if present
Terminal window
curl -X POST https://api.hoody.com/api/v1/exec/package/init \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "my-hoody-app",
"version": "0.1.0",
"description": "My Hoody Exec application",
"force": false
}'

Updates an existing package.json by merging in new dependencies, scripts, and metadata, or by removing keys. The response lists the changes that were applied.

This endpoint takes no parameters.

Request Body

NameTypeRequiredDefaultDescription
dependenciesstringNoJSON-encoded string of dependencies to merge into the dependencies block
scriptsstringNoJSON-encoded string of npm scripts to merge into the scripts block
metadataobjectNoAdditional top-level metadata fields to merge (e.g. author, license)
removestringNoComma-separated list of top-level keys or dependency names to remove
Terminal window
curl -X POST https://api.hoody.com/api/v1/exec/package/update \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"dependencies": "{\"hono\":\"^4.0.0\",\"zod\":\"^3.22.0\"}",
"scripts": "{\"dev\":\"bun --watch src/index.ts\"}",
"metadata": {"author": "Hoody Team", "license": "MIT"},
"remove": "old-dep,old-dep2"
}'

Compares the dependencies declared in package.json against the packages actually installed in node_modules. The response includes a summary, lists of missing / outdated / extra packages, and aggregate boolean flags.

This endpoint takes no parameters.

Request Body

This endpoint accepts an optional JSON payload. No specific fields are required or documented.

Terminal window
curl -X POST https://api.hoody.com/api/v1/exec/package/compare \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{}'

Queues an asynchronous install of dependencies. By default, all dependencies listed in package.json are installed. Pass an explicit packages array to install a subset, and use dev: true to install into devDependencies instead. The endpoint returns 202 Accepted with the underlying install command.

This endpoint takes no parameters.

Request Body

NameTypeRequiredDefaultDescription
packagesarrayNoSpecific package names to install; omit to install all declared dependencies
devbooleanNofalseInstall the packages as devDependencies
savebooleanNotruePersist the installed packages to package.json
forcebooleanNofalseForce a clean reinstall, removing the existing node_modules first
Terminal window
curl -X POST https://api.hoody.com/api/v1/exec/package/install \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"packages": ["hono", "zod"],
"dev": false,
"save": true,
"force": false
}'

Rewrites all declared dependencies in package.json to their exact installed versions, removing range operators such as ^ or ~. If packages is provided, only those packages are pinned; otherwise every dependency is processed.

This endpoint takes no parameters.

Request Body

NameTypeRequiredDefaultDescription
packagesarrayNoSubset of package names to pin; omit to pin every dependency
Terminal window
curl -X POST https://api.hoody.com/api/v1/exec/package/pin \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"packages": ["hono", "zod"]
}'