Files
markitect-tool/docs/cli-reference.md
2026-05-04 21:56:19 +02:00

20 KiB

Markitect CLI Reference

Generated from the Click command tree.

mkt

Markdown-native toolkit for structured knowledge artifacts.

mkt [OPTIONS] COMMAND [ARGS]...

Parameters:

  • --version - Show the version and exit.

mkt ast

Inspect parsed Markdown ASTs and parser summaries.

ast [OPTIONS] COMMAND [ARGS]...

mkt ast show

Show a parsed Markdown AST without requiring a cache.

show [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --format -

mkt ast stats

Summarize parsed Markdown AST shape and token distribution.

stats [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --format -

mkt backend

Inspect optional backend manifests and snapshot identities.

backend [OPTIONS] COMMAND [ARGS]...

mkt backend inspect

Inspect one backend manifest and optional compatibility check.

inspect [OPTIONS] BACKEND_ID

Parameters:

  • BACKEND_ID - Required.
  • --path - Backend manifest file or directory. Defaults to .markitect/backends and .markitect/backend.yaml.
  • --require - Required capability to check. May be repeated.
  • --format -

mkt backend list

List registered optional backend manifests.

list [OPTIONS]

Parameters:

  • --path - Backend manifest file or directory. Defaults to .markitect/backends and .markitect/backend.yaml.
  • --capability - Only show backends that declare this capability.
  • --format -

mkt backend refresh-plan

Plan cheap-first snapshot and index refresh work.

refresh-plan [OPTIONS] PATHS...

Parameters:

  • PATHS - Required.
  • --root - Root used for relative source paths.
  • --state - YAML/JSON snapshot state file from a previous backend run.
  • --no-recursive - Do not recurse into directories.
  • --verify-hashes - Hash metadata-changed files to avoid unnecessary parse/index work.
  • --parse-option - Parse option included in the identity comparison.
  • --contract-hash - Optional contract hash included in identity comparison.
  • --format -

mkt backend snapshot-id

Compute a read-only content-addressed snapshot identity for a file.

snapshot-id [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --parse-option - Parse option included in the snapshot identity hash.
  • --contract-hash - Optional contract hash included in the snapshot identity.
  • --format -

mkt cache

Fingerprint Markdown files and detect changed inputs.

cache [OPTIONS] COMMAND [ARGS]...

mkt cache build

Build or refresh a lightweight Markdown cache manifest.

build [OPTIONS] PATHS...

Parameters:

  • PATHS - Required.
  • --root - Root used for relative cache paths.
  • --cache-path - Cache manifest path. Defaults to .markitect/cache/manifest.json under root.
  • --no-recursive - Do not recurse into directories.
  • --dry-run - Report manifest without writing it.
  • --format -

mkt cache fingerprint

Fingerprint one Markdown file.

fingerprint [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --root - Root used for relative cache paths.
  • --format -

mkt cache index

Build or refresh the local SQLite snapshot/index store.

index [OPTIONS] PATHS...

Parameters:

  • PATHS - Required.
  • --root - Root used for relative index paths.
  • --index-path - SQLite index path. Defaults to .markitect/cache/index.sqlite3 under root.
  • --no-recursive - Do not recurse into directories.
  • --no-verify-hashes - Do not hash metadata-changed files before parsing.
  • --parse-option - Parse option included in the snapshot identity hash.
  • --contract-hash - Optional contract hash included in snapshot identity.
  • --format -

mkt cache init

Initialize the local SQLite snapshot/index store.

init [OPTIONS]

Parameters:

  • --root - Root used for the default local index path.
  • --index-path - SQLite index path. Defaults to .markitect/cache/index.sqlite3 under root.
  • --format -

mkt cache query

Run a selector or JSONPath query over indexed document snapshots.

query [OPTIONS] SELECTOR

Parameters:

  • SELECTOR - Required.
  • --root - Root used for the default local index path.
  • --index-path - SQLite index path. Defaults to .markitect/cache/index.sqlite3 under root.
  • --path - Restrict query to one or more indexed relative paths.
  • --policy - Local label policy file used to filter results.
  • --subject - Policy subject id.
  • --policy-mode - Override policy mode for this query.
  • --engine - Query engine to use.
  • --format -

mkt cache status

Report changed, new, unchanged, and deleted Markdown files.

status [OPTIONS] PATHS...

Parameters:

  • PATHS - Required.
  • --root - Root used for relative cache paths.
  • --cache-path - Cache manifest path. Defaults to .markitect/cache/manifest.json under root.
  • --no-recursive - Do not recurse into directories.
  • --format -

mkt class

Resolve deterministic content classes.

class [OPTIONS] COMMAND [ARGS]...

mkt class resolve

Resolve content class inheritance and merged slots.

resolve [OPTIONS] CLASS_FILE CLASS_NAME

Parameters:

  • CLASS_FILE - Required.
  • CLASS_NAME - Required.
  • --format -

mkt completion

Generate shell completion for Bash, Zsh, or Fish.

completion [OPTIONS] {bash|zsh|fish}

Parameters:

  • SHELL - Required.
  • --program-name - Installed executable name used by the shell completion script.
  • --instructions - Print installation instructions instead of the completion script.

mkt compose

Compose multiple Markdown files into one document.

compose [OPTIONS] FILES...

Parameters:

  • FILES - Required.
  • --title - Add a top-level title before composed files.
  • --heading-delta - Shift heading levels in each input before composing.
  • --include-frontmatter - Keep each input file's frontmatter in the composed body.
  • --output - Write composed Markdown to a file.
  • --format -

mkt context

Pack and activate agent working-memory context.

context [OPTIONS] COMMAND [ARGS]...

mkt context activate

Activate a saved context package as Markdown working memory.

activate [OPTIONS] PACKAGE

Parameters:

  • PACKAGE - Required.
  • --root - Root used for the local context registry.
  • --target - Thread/workspace activation target.
  • --max-items - Maximum context items to activate.
  • --max-tokens - Approximate maximum activation tokens.
  • --reserve-tokens - Token reserve inside max tokens.
  • --policy - Local label policy file used to re-check items before activation.
  • --subject - Policy subject id.
  • --policy-mode - Override policy mode while activating.
  • --action - Policy action used while activating.
  • --format -

mkt context deactivate

Deactivate a recorded context activation.

deactivate [OPTIONS] ACTIVATION_ID

Parameters:

  • ACTIVATION_ID - Required.
  • --root - Root used for the local context registry.
  • --format -

mkt context explain

Explain context package contents, retrieval, budget, and policy metadata.

explain [OPTIONS] PACKAGE

Parameters:

  • PACKAGE - Required.
  • --root - Root used for the local context registry.
  • --format -

mkt context list

List locally saved context packages.

list [OPTIONS]

Parameters:

  • --root - Root used for the local context registry.
  • --format -

mkt context pack

Create an inspectable context package from a query, search, or manifest.

pack [OPTIONS] QUERY_OR_MANIFEST

Parameters:

  • QUERY_OR_MANIFEST - Required.
  • --source - Markdown source file to query directly. May be repeated.
  • --root - Root used for relative paths and the local context registry.
  • --index-path - SQLite index path. Defaults to .markitect/cache/index.sqlite3 under root.
  • --search - Treat the argument as an FTS search query.
  • --path - Restrict indexed query/search to relative paths.
  • --engine - Query engine for selector packages.
  • --limit - Maximum FTS search matches.
  • --title - Package title.
  • --intent - Package intent statement.
  • --project - Project namespace.
  • --user - User namespace.
  • --agent - Agent namespace.
  • --thread - Thread namespace.
  • --task - Task namespace.
  • --namespace - Custom namespace key.
  • --max-items - Maximum context items to include.
  • --max-tokens - Approximate maximum package tokens.
  • --reserve-tokens - Token reserve inside max tokens.
  • --policy - Local label policy file used to filter package items.
  • --subject - Policy subject id.
  • --policy-mode - Override policy mode while packing.
  • --action - Policy action used while packing.
  • --output - Write package to this file.
  • --no-save - Do not save to the local context registry.
  • --format -

mkt context refresh

Refresh a package by re-running its retrieval recipes.

refresh [OPTIONS] PACKAGE

Parameters:

  • PACKAGE - Required.
  • --root - Root used for the local context registry.
  • --policy - Local label policy file used to filter refreshed package items.
  • --subject - Policy subject id.
  • --policy-mode - Override policy mode while refreshing.
  • --action - Policy action used while refreshing.
  • --no-save - Do not save the refreshed package.
  • --format -

mkt contract

Work with Markdown document contracts.

contract [OPTIONS] COMMAND [ARGS]...

mkt contract check

Check a Markdown file against a Markdown document contract.

check [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --contract - Required.
  • --format -
  • --context - YAML or JSON runtime context used for field prefill and dynamic rules.

mkt contract form-state

Evaluate UI-neutral form state for a document contract.

form-state [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --contract - Required.
  • --context - YAML or JSON runtime context used for field prefill and dynamic rules.
  • --format -

mkt contract validate

Validate that a Markdown contract file is well formed.

validate [OPTIONS] CONTRACT_FILE

Parameters:

  • CONTRACT_FILE - Required.
  • --format -

mkt docs

Generate CLI and API reference documentation.

docs [OPTIONS] COMMAND [ARGS]...

mkt docs api

Generate a compact Markdown API reference from public exports.

api [OPTIONS]

Parameters:

  • --output - Write generated Markdown reference to this file.

mkt docs cli

Generate a Markdown command reference from the Click command tree.

cli [OPTIONS]

Parameters:

  • --output - Write generated Markdown reference to this file.

mkt explode

Explode a Markdown file into reversible section files.

explode [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --output-dir - Directory to write exploded Markdown files and manifest into. Required.
  • --variant -
  • --force - Allow writing into a non-empty output directory.
  • --format -

mkt extension

Inspect built-in extension descriptors and CLI affordances.

extension [OPTIONS] COMMAND [ARGS]...

mkt extension commands

List CLI commands declared by built-in extension descriptors.

commands [OPTIONS]

Parameters:

  • --format -

mkt extension inspect

Inspect one built-in extension descriptor.

inspect [OPTIONS] EXTENSION_ID

Parameters:

  • EXTENSION_ID - Required.
  • --format -

mkt extension list

List built-in extension descriptors.

list [OPTIONS]

Parameters:

  • --kind - Only show extensions of this kind.
  • --format -

mkt extract

Extract text or Markdown content from structured Markdown.

extract [OPTIONS] FILE SELECTOR

Parameters:

  • FILE - Required.
  • SELECTOR - Required.
  • --engine - Query engine to use.
  • --format -

mkt function

Inspect and execute deterministic document functions.

function [OPTIONS] COMMAND [ARGS]...

mkt function check

Validate document function calls without rendering.

check [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --allow - Only allow this function id. May be repeated.
  • --forbid - Forbid this function id. May be repeated.
  • --format -

mkt function list

List registered document functions.

list [OPTIONS]

Parameters:

  • --namespace - Only list functions in one namespace.
  • --format -

mkt function render

Render deterministic document function calls in a Markdown file.

render [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --format -

mkt generate

Generate Markdown from contracts, rules, or external hooks.

generate [OPTIONS] COMMAND [ARGS]...

mkt generate rules

Run a Markdown/YAML generation plan.

rules [OPTIONS] RULES_FILE

Parameters:

  • RULES_FILE - Required.
  • --output-dir - Directory used for relative output paths in the plan.
  • --dry-run - Render without writing output files.
  • --format -

mkt generate stub

Generate a Markdown stub from a document contract.

stub [OPTIONS]

Parameters:

  • --contract - Markdown document contract to generate from. Required.
  • --data - Optional JSON/YAML data for frontmatter values.
  • --set - Set generation data. Dot paths create nested mappings.
  • --include-optional - Include optional contract sections.
  • --output - Write generated Markdown to a file.
  • --format -

mkt implode

Implode a Markdown directory created by mkt explode.

implode [OPTIONS] DIRECTORY

Parameters:

  • DIRECTORY - Required.
  • --manifest - Manifest path. Defaults to markitect-explode.yaml in the input directory.
  • --output - Write imploded Markdown to a file.
  • --format -

mkt include

Resolve Markdown include markers in a document.

include [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --base-dir - Directory includes must stay within. Defaults to the input file directory.
  • --max-depth - Maximum recursive include depth.
  • --output - Write resolved Markdown to a file.
  • --format -

mkt metrics

Report practical size and complexity metrics for a Markdown file.

metrics [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --format -

mkt parse

Parse a Markdown file into a structured representation.

parse [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --format -

mkt policy

Check local access policy decisions.

policy [OPTIONS] COMMAND [ARGS]...

mkt policy check

Authorize one subject/action/object tuple with local label policy.

check [OPTIONS] SUBJECT ACTION OBJECT_ID

Parameters:

  • SUBJECT - Required.
  • ACTION - Required.
  • OBJECT_ID - Required.
  • --policy - Local label policy file.
  • --label - Object policy label. May be repeated.
  • --path - Object path for path ACL and path-label rules.
  • --trust-zone - Object trust zone.
  • --policy-mode - Override policy mode for this check.
  • --format -

mkt policy resource-manifest

Inspect a Markitect flex-auth resource registration manifest.

resource-manifest [OPTIONS] MANIFEST_FILE

Parameters:

  • MANIFEST_FILE - Required.
  • --format -

mkt policy subject

Map enterprise identity claims into a Markitect policy subject.

subject [OPTIONS] CLAIMS_FILE

Parameters:

  • CLAIMS_FILE - Required.
  • --policy-map - Enterprise policy map file. Required.
  • --group - Additional resolved group. May be repeated.
  • --environment - Validation environment for issuer safety checks.
  • --format -

mkt process

Run deterministic fenced-block processors in a Markdown file.

process [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --root - Root used for relative processor references.
  • --format -

mkt query

Query structured Markdown content with a small selector.

query [OPTIONS] FILE SELECTOR

Parameters:

  • FILE - Required.
  • SELECTOR - Required.
  • --engine - Query engine to use.
  • --format -

mkt ref

Resolve namespaced Markdown content references.

ref [OPTIONS] COMMAND [ARGS]...

mkt ref resolve

Resolve a content reference using a Markdown document as context.

resolve [OPTIONS] CONTEXT_FILE REFERENCE

Parameters:

  • CONTEXT_FILE - Required.
  • REFERENCE - Required.
  • --root - Root that relative paths and namespaces must stay within.
  • --format -

mkt schema

Work with Markdown schema files.

schema [OPTIONS] COMMAND [ARGS]...

mkt schema validate

Validate that a Markdown schema contains a well-formed JSON Schema.

validate [OPTIONS] SCHEMA_FILE

Parameters:

  • SCHEMA_FILE - Required.
  • --format -

Search the local SQLite index with FTS5.

search [OPTIONS] TEXT

Parameters:

  • TEXT - Required.
  • --root - Root used for the default local index path.
  • --index-path - SQLite index path. Defaults to .markitect/cache/index.sqlite3 under root.
  • --limit -
  • --policy - Local label policy file used to filter results.
  • --subject - Policy subject id.
  • --policy-mode - Override policy mode for this search.
  • --format -

mkt tangle

Tangle named Markdown code chunks into target files.

tangle [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --output-dir - Write tangled files under this directory. Omit for dry JSON/YAML/text output.
  • --format -

mkt template

Render and inspect deterministic Markdown templates.

template [OPTIONS] COMMAND [ARGS]...

mkt template inspect

Inspect variables required by a template.

inspect [OPTIONS] TEMPLATE_FILE

Parameters:

  • TEMPLATE_FILE - Required.
  • --format -

mkt template render

Render a Markdown template with structured data.

render [OPTIONS] TEMPLATE_FILE

Parameters:

  • TEMPLATE_FILE - Required.
  • --data - JSON, YAML, or CSV data file. CSV must contain one record for render.
  • --set - Set a template data value. Dot paths create nested mappings.
  • --lenient - Keep unresolved placeholders instead of failing.
  • --output - Write rendered Markdown to a file.
  • --format -

mkt transform

Apply deterministic transforms to a Markdown file.

transform [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --strip-frontmatter - Remove YAML frontmatter.
  • --set - Set a frontmatter value. Dot paths create nested mappings.
  • --heading-delta - Shift ATX heading levels, clamped to 1..6.
  • --extract - Replace content with selector output.
  • --output - Write transformed Markdown to a file.
  • --format -

mkt validate

Validate a Markdown file against a Markdown schema file.

validate [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --schema - Required.
  • --format -

mkt weave

Weave Markdown documentation with a deterministic chunk index.

weave [OPTIONS] FILE

Parameters:

  • FILE - Required.
  • --output - Write woven Markdown to a file.
  • --format -

mkt workflow

Inspect, plan, and run declarative Markdown workflows.

workflow [OPTIONS] COMMAND [ARGS]...

mkt workflow inspect

Inspect a workflow definition without executing steps.

inspect [OPTIONS] WORKFLOW_FILE

Parameters:

  • WORKFLOW_FILE - Required.
  • --format -

mkt workflow plan

Run a workflow in dry-run mode and report planned outputs.

plan [OPTIONS] WORKFLOW_FILE

Parameters:

  • WORKFLOW_FILE - Required.
  • --output-dir - Output root for path-safety checks. No files are written in plan mode.
  • --format -

mkt workflow run

Run a deterministic Markdown workflow.

run [OPTIONS] WORKFLOW_FILE

Parameters:

  • WORKFLOW_FILE - Required.
  • --output-dir - Output root for workflow outputs. Defaults to the workflow directory.
  • --dry-run - Execute without writing output files.
  • --format -