hack.foo
Reference

MCP fields and results

This field inventory was audited against the 5.0.0-next.5 source and has not been requalified against later prereleases. The generated command reference and the pinned runtime guides take precedence where they differ.

Exact tool inputs for v5 (next.5). Start with Agent integrations for setup. These are MCP JSON input names, not CLI flag spellings.

Registration does not establish backend compatibility. In particular, the native candidate has a narrower admission contract; a retained Compose tool is not an alternative native lifecycle API. A successful command result is not application health or readiness.

Input rules

Schema-optional selectors can still have conditional requirements. hack.project.init requires path or repoRoot. Do not provide conflicting selectors. service and services, compose and loki, profiles and runtime selection interact through the command handler. The schema does not promise every combination succeeds.

Run timeout defaults to 120000 ms. Init uses a 180000 ms child timeout and exposes no timeout input. Log tail collection defaults to 200 events and 5000 ms. These are handler fallbacks, not schema defaults. An omitted log tail can be forwarded to the CLI, which has its own default.

hack.project.exec requires a nonempty cmd array (at least one entry); run allows cmd to be omitted. Exec also defaults to 120000 ms. Positive-integer limits are tail/maxEvents ≤10000, maxMs ≤60000, timeoutMs ≤600000. Identifier helpers impose a 253-character maximum and distinct service/profile, branch and env-key patterns. The MCP env-key grammar is broader than CLI uppercase keys; later CLI refusal is possible. See MCP tools for exact validation and typed pre-spawn failures.

hack.projects.list

source

InputPresenceType / validationMeaning
filterOptionalstringFilter by project name
includeGlobalOptionalbooleanInclude global infra projects
includeUnregisteredOptionalbooleanInclude unregistered compose projects

hack.project.status

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstring; identifier rulesSee identifier and input rules.
profilesOptionalstring; identifier rulesCompose profile names

hack.project.up

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstring; identifier rulesSee identifier and input rules.
profilesOptionalstring; identifier rulesCompose profile names

hack.project.down

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstring; identifier rulesSee identifier and input rules.
profilesOptionalstring; identifier rulesCompose profile names

hack.project.restart

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstring; identifier rulesSee identifier and input rules.
profilesOptionalstring; identifier rulesCompose profile names

hack.project.run

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstring; identifier rulesSee identifier and input rules.
profilesOptionalstring; identifier rulesCompose profile names
serviceRequiredstring; identifier rulesSee identifier and input rules.
cmdOptionalstring[]Command arguments
workdirOptionalstringWorking directory inside container
timeoutMsOptionalpositive integer; ceiling in input rulesSee identifier and input rules.

Tool-specific emitted data fields:

FieldTypePresence
data.limitsobjectPresent in source shape
data.limits.timeoutMsnumberPresent in source shape

hack.project.logs.snapshot

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstring; identifier rulesSee identifier and input rules.
profilesOptionalstring; identifier rulesCompose profile names
serviceOptionalstring; identifier rulesSee identifier and input rules.
servicesOptionalstring; identifier rulesMultiple service names
queryOptionalstringRaw LogQL selector/query
lokiOptionalbooleanForce Loki backend
composeOptionalbooleanForce docker compose backend
tailOptionalpositive integer; ceiling in input rulesSee identifier and input rules.
sinceOptionalstringStart time (RFC3339 or duration)
untilOptionalstringEnd time (RFC3339 or duration)

Tool-specific emitted data fields:

FieldTypePresence
data.eventsLogStreamEvent[]Present in source shape
data.countnumberPresent in source shape
data.cutoffnull or {bound, limit}Present in source shape
data.limitsobjectPresent in source shape
data.limits.tailnumber or nullPresent in source shape

hack.project.logs.tail

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstring; identifier rulesSee identifier and input rules.
profilesOptionalstring; identifier rulesCompose profile names
serviceOptionalstring; identifier rulesSee identifier and input rules.
servicesOptionalstring; identifier rulesMultiple service names
queryOptionalstringRaw LogQL selector/query
lokiOptionalbooleanForce Loki backend
composeOptionalbooleanForce docker compose backend
tailOptionalpositive integer; ceiling in input rulesSee identifier and input rules.
sinceOptionalstringStart time (RFC3339 or duration)
untilOptionalstringEnd time (RFC3339 or duration)
maxEventsOptionalpositive integer; ceiling in input rulesSee identifier and input rules.
maxMsOptionalpositive integer; ceiling in input rulesSee identifier and input rules.

Tool-specific emitted data fields:

FieldTypePresence
data.eventsLogStreamEvent[]Present in source shape
data.countnumberPresent in source shape
data.cutoffnull or {bound, limit}Present in source shape
data.stop_reasonstring (collector stop reason)Present in source shape
data.duration_msnumberPresent in source shape
data.limitsobjectPresent in source shape
data.limits.tailnumber or nullPresent in source shape
data.limits.maxEventsnumberPresent in source shape
data.limits.maxMsnumberPresent in source shape

hack.project.open

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstring; identifier rulesSee identifier and input rules.
targetOptionalstring; identifier rulesSee identifier and input rules.

hack.project.init

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
nameOptionalstringProject slug
devHostOptionalstringDEV_HOST override
oauthOptionalbooleanEnable OAuth alias host
oauthTldOptionalstringOAuth alias TLD
manualOptionalbooleanSkip discovery and generate a minimal compose
noDiscoveryOptionalbooleanSkip discovery even if available

hack.project.exec

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstring; identifier rulesSee identifier and input rules.
profilesOptionalstring; identifier rulesCompose profile names
serviceRequiredstring; identifier rulesSee identifier and input rules.
cmdRequiredstringCommand and arguments (at least one entry)
workdirOptionalstringWorking directory inside container
timeoutMsOptionalpositive integer; ceiling in input rulesSee identifier and input rules.

Tool-specific emitted data fields:

FieldTypePresence
data.limitsobjectPresent in source shape
data.limits.timeoutMsnumberPresent in source shape
data.limits.outputBytesnumberPresent in source shape

hack.project.doctor

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstring; identifier rulesSee identifier and input rules.

hack.project.env.explain

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
envOptionalstring; identifier rulesSee identifier and input rules.
serviceOptionalstring; identifier rulesSee identifier and input rules.
keyRequiredstring; env-key rulesSee identifier and input rules.
targetOptional"host" or "compose"Env view: host (default) or compose

hack.project.env.keys

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
envOptionalstring; identifier rulesSee identifier and input rules.
serviceOptionalstring; identifier rulesSee identifier and input rules.

hack.project.instances

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)

Prompt arguments

hack-init is a prompt, separate from hack.project.init. Mode defaults to existing-project. Prompt hints do not become init tool inputs.

A supplied repoRoot triggers inventory and replaces the mode/projectName/devHost hints.

ArgumentPresenceDeclaration
arguments.repoRootOptionalstring
arguments.modeOptionalstring
arguments.projectNameOptionalstring
arguments.devHostOptionalstring

Common result

The emitted MCP transport subset is content[] with type/text, structuredContent, and isError on failure. The table describes the common structured payload, not every SDK extension. When present, the error object contains required string code/reason/message fields. Optional data is declared unknown; it is not a machine-validated closed nested schema.

FieldTypePresence
structuredContent.okbooleanRequired
structuredContent.outputTruncatedbooleanOptional
structuredContent.commandstringRequired
structuredContent.exitCodenumberRequired
structuredContent.stdoutstringRequired
structuredContent.stderrstringRequired
structuredContent.dataunknownOptional
structuredContent.spawnedliteral falseOptional
structuredContent.errorobjectOptional

Up/down/restart/init do not return a typed data status or readiness object. Open returns data.url without launching a browser. Status forwards the selected command JSON; a Compose result has project/branch/composeProject/items, and engine-specific item fields are open. Projects list forwards public CLI inventory JSON; consumers must tolerate version/runtime-specific metadata.

Run returns data.limits.timeoutMs; exec additionally reports an 8 MiB shared capture budget through outputBytes. Snapshot adds events/count/cutoff/limits.tail. Tail adds stop_reason/duration_ms and limits.maxEvents/maxMs. Omitted tail is echoed as null, not the child CLI default. Cutoff is null or {bound,limit} with bound events/bytes/time. A deliberate collection cutoff is distinct from backend failure. Tail counts only type:log events against maxEvents; start/heartbeat/error/end do not spend that counter.

McpEnvExplainData

FieldTypePresence
key`string \null`
available`boolean \null`
secret`boolean \null`
format`string \null`
environment`string \null`
requested_scope`string \null`
effective_scope`string \null`
target`string \null`
delivered_to`readonly string[] \null`
source`string \null`
precedence`readonly string[] \null`

McpEnvKeyEntry

FieldTypePresence
keystringRequired; null only if the type includes null
secretbooleanRequired; null only if the type includes null
required`boolean \null`
source`string \null`
resolved_from`string \null`
services`readonly string[] \null`

McpEnvKeysData

FieldTypePresence
format`string \null`
environment`string \null`
selected_scope`string \null`
scopes`readonly string[] \null`
keysreadonly McpEnvKeyEntry[]Required; null only if the type includes null
missing_requiredreadonly string[]Required; null only if the type includes null

McpInstanceService

FieldTypePresence
servicestringRequired; null only if the type includes null
containersnumberRequired; null only if the type includes null
runningnumberRequired; null only if the type includes null

McpProjectInstance

FieldTypePresence
branch`string \null`
compose_project`string \null`
working_dir`string \null`
servicesreadonly McpInstanceService[]Required; null only if the type includes null

McpInstancesData

FieldTypePresence
projectstringRequired; null only if the type includes null
foundbooleanRequired; null only if the type includes null
runtime_ok`boolean \null`
instancesreadonly McpProjectInstance[]Required; null only if the type includes null

The env projections withhold values, ciphertext and raw backend output. Projection null is different from a missing key. Instances describe discovered containers, not all configured branches. Doctor can return a nested CLI report under data.data; specialized engine and diagnostic subobjects remain open and are not exhaustively typed here.

Log event fields

These are source types, not a closed validator for every parsed JSON line. Event type is start/log/heartbeat/error/end. Labels and fields are application-owned string maps. Do not enumerate application log keys as Hack API fields.

FieldTypePresence
data.events[].typeLogStreamEventTypeRequired in declared source type
data.events[].tsstringRequired in declared source type
data.events[].projectstringOptional
data.events[].backendLogStreamBackendOptional
data.events[].branchstringOptional
data.events[].servicesreadonly string[]Optional
data.events[].followbooleanOptional
data.events[].sincestringOptional
data.events[].untilstringOptional
data.events[].entryLogJsonEntryOptional
data.events[].messagestringOptional
data.events[].reasonstringOptional
data.events[].entry.source`"compose" \"loki"`
data.events[].entry.messagestringRequired in declared source type
data.events[].entry.rawstringRequired in declared source type
data.events[].entry.stream`"stdout" \"stderr"`
data.events[].entry.projectstringOptional
data.events[].entry.servicestringOptional
data.events[].entry.instancestringOptional
data.events[].entry.labelsRecord<string, string>Optional
data.events[].entry.timestampstringOptional
data.events[].entry.timestamp_nsstringOptional
data.events[].entry.levelLogLevelOptional
data.events[].entry.fieldsRecord<string, string>Optional

Contract boundaries

Nested engine/project/diagnostic variants and arbitrary application data remain open. Inspect the pinned public command source when handling a new variant; do not depend on private daemon/guest/compiler protocols. This field reference is source-reviewed and does not claim client-loading or cloud execution qualification.


Source: next.5 field audit · docs/reference/cli.md.

On this page