If the hub API is unavailable, use `curl` against `http://127.0.0.1:8000/docs`.
---
## Development Commands
All commands assume the `markitect-venv` virtual environment is active (`source ~/.venvs/markitect-venv/bin/activate` or equivalent). The package is installed in editable mode.
```bash
# Run the core test suite
pytest
# Run a single test file
pytest tests/test_issue_17_batch_processing.py
# Run tests by marker
pytest -m unit
pytest -m "not slow"
# Run with coverage
pytest --cov=markitect
# Run only fast unit tests (TDD inner loop)
pytest tests/unit/
# CLI entry point
markitect --help
# Infospace subcommands (primary active development area)
markitect infospace --help
markitect infospace eval-summary --update-metrics
# LLM helper commands
markitect llm-helper "<question>"
markitect llm-catalog
markitect llm-check
markitect llm-default
markitect llm-preference
# Install / reinstall in dev mode
pip install -e ".[analysis]"
```
## Architecture
MarkiTect is a CLI-driven markdown engine that treats documents as structured, queryable information spaces. Entry point: `markitect/cli.py` → `main()` (Click group). All subcommand groups are registered at the bottom of `cli.py`.
3. User preference (`[llm.preference]` in `~/.config/markitect/config.toml`)
4. Directory preference (`[llm.preference]` in `.markitect.toml`)
5. Directory default (`[llm.default]` in `.markitect.toml`)
6. User default (`[llm.default]` in `~/.config/markitect/config.toml`)
7. Hardcoded fallback: `gemini/gemini-2.5-flash`
Canonical models: `markitect/llm/models.py` (`RunConfig`, `LLMResponse`) and `markitect/llm/adapter.py` (`LLMAdapter`). These are mirrored in the standalone `/home/worsch/llm-connect/` package (`llm_connect`), which is installed as a local path dependency. `markitect/prompts/execution/{models,llm_adapter}.py` are re-export shims for backward compatibility.
**Gotcha:** The `OPENROUTER_API_KEY` env var may hold a stale key — `unset OPENROUTER_API_KEY` before running LLM commands if you get auth errors. `claude-code` provider fails inside Claude Code sessions (nested session restriction).
### Infospace (`markitect/infospace/`)
An infospace is a directory-based collection of typed entities governed by an `infospace.yaml` config. Key files:
Tests live in `tests/`. Many test files are named `test_issue_NNN_*.py` (TDD by issue). Layered tests follow `test_l{N}_*.py` naming. The `tests/unit/` subtree has the cleanest structure and covers `prompts/`, `spaces/`, `llm/`, `infospace/`, `analysis/`.