Command-line interface for the Open Concept Lab (OCL) API.
cd /Users/jonathanpayne/projects/ocl/ocl-cli
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"src/ocl_cli/api_client.py— Sync HTTP client with all high-level API methods. Business logic lives here (not in Click commands) so it can be reused by a future MCP server wrapper.src/ocl_cli/config.py— Server registry and auth token resolution. Config stored at~/.ocl/config.json.src/ocl_cli/output.py— JSON and human-readable table formatters.src/ocl_cli/main.py— Click root group, global options, command registration.src/ocl_cli/commands/— Thin Click command wrappers that parse args → call client → format output.
- Click commands are thin wrappers. All API logic goes in
api_client.py. - Default
owner_typeis"orgs"for targeted operations,"all"for search/list. - Default
repo_typeis"all"for search/list, required for targeted operations. --json/-jglobal flag outputs raw API JSON (unmodified) for agent consumption.--debug/-dglobal flag shows HTTP requests on stderr.--show-requestglobal flag shows server URL and API request paths on stderr (cleaner than--debug).--verboseper-command flag on search/list commands passes?verbose=trueto the OCL API, which returns full details (names, descriptions, extras) instead of summary. Default is summary (no verbose).- Version parameters are type-specific:
--repo-versionfor sources/repos,--collection-versionfor collections,--concept-versionfor concept versions. Never use a bare--versionfor these. - Exit codes: 0=success, 1=client error (4xx), 2=server error (5xx), 3=auth error.
- When changing command arguments or flags, always update
README.mdanddocs/demos/to match.
ocl --help
ocl whoami --token YOUR_TOKEN
ocl concept search malaria --owner CIEL --source CIELpytestocl-mcp— MCP server for AI assistants (async, different interface)ocl-docs— API documentation at docs.openconceptlab.orgoclapi2— The OCL API backend
- Issues for
ocl-cliare tracked at https://gitea.lab.jpayne.md/ocl/ocl-cli. UseteaCLI by default, and direct API access to Gitea is also available. Note: this repo will transition to the OCL GitHub in the future.