--- name: makima-chain description: Chain commands for makima multi-contract orchestration. Use when running chains of contracts defined in YAML, checking chain status, or managing contract dependencies. --- # Makima Chain Commands Chains are DAGs (directed acyclic graphs) of contracts that work together. Contracts can depend on each other and run in parallel when no dependencies exist. Environment variables (`MAKIMA_API_URL`, `MAKIMA_API_KEY`) must be set. ## Running Chains ### Run chain from YAML ```bash makima chain run ``` Parses the chain definition, validates the DAG, and creates contracts. Options: - `--dry-run` - Validate and preview without creating ### Validate chain YAML ```bash makima chain validate ``` Checks syntax and validates DAG structure (no cycles). ### Preview chain ```bash makima chain preview ``` Shows execution order and contract details without creating. ## Chain Status ### Get chain status ```bash makima chain status ``` ### List all chains ```bash makima chain list ``` Options: - `--status ` - Filter by status - `--limit ` - Limit results (default: 50) ### List contracts in chain ```bash makima chain contracts ``` ### Display ASCII DAG visualization ```bash makima chain graph ``` Options: - `--with-status` - Show contract status in visualization ## Chain Management ### Archive chain ```bash makima chain archive ``` Marks chain as archived (does not delete contracts). ## Chain YAML Format ```yaml name: my-chain description: Optional description repository_url: https://github.com/org/repo contracts: - name: setup contract_type: implementation description: Initial setup work - name: feature-a contract_type: implementation depends_on: [setup] description: Implement feature A - name: feature-b contract_type: implementation depends_on: [setup] description: Implement feature B (parallel with A) - name: integration contract_type: review depends_on: [feature-a, feature-b] description: Integrate and test ``` ## Output Format All commands output JSON to stdout. Example workflow: ```bash # Validate before running makima chain validate my-chain.yaml # Preview execution makima chain preview my-chain.yaml # Run the chain chain_id=$(makima chain run my-chain.yaml | jq -r '.chainId') # Monitor progress makima chain status "$chain_id" makima chain graph "$chain_id" --with-status ```