Skip to main content
Cognis is a Cargo workspace. If you’ve worked in Rust before, this should feel familiar. If not, the steps below are everything you need.

Prerequisites

  • Rust 1.75 or newer. Install via rustup.
  • A Unix-like shell. Most commands assume bash/zsh; PowerShell works for the cargo bits.
  • Optional: cargo-watch for cargo watch -x test during iteration.
  • Optional: cargo-expand when working on macros.

Clone and build

The first build takes a few minutes — reqwest, sqlx, and tokio aren’t small. Subsequent builds are incremental.

Build with all providers

Most provider-specific code is feature-gated. To compile everything:
CI builds a matrix of feature combinations; matching that locally before pushing saves cycles.

Run a single test

Run an example

Examples live in examples/ and are registered in crates/examples/Cargo.toml. Run by registered name:
See Examples for the full list.

Worktrees

For non-trivial changes (multi-day work, parallel branches), a worktree gives you an isolated checkout without leaving your primary tree:
The .worktrees/ directory is project-local and globally gitignored.

Pre-push checklist

Before opening a PR, run these in order. They match what CI runs:
If you have access to Cubic, also run a code review pass:
Fix any issues Cubic flags before pushing.

Working on docs

The docs site lives under docs/mintlify/ and is built with Mintlify. Preview locally if you have the Mintlify CLI:
Otherwise, write Markdown and check it in mintlify’s preview environment when you open the PR.

Working on macros

Macros live in crates/cognis-macros. To inspect what a derive expands to:
Output should be readable Rust. Macros that produce unreadable code are a smell — keep generated code transparent.

Clean rebuild

If the build gets confused after large dependency churn:
cargo clean is heavy; reach for it after upgrading Rust or changing many features at once, not as a daily habit.

See also

Architecture

Crate boundaries and design rules.

PR guidelines

What to include in your PR description.

Adding a provider

Step-by-step for a new LLM client.