cocode is a Rust terminal UI for running an agent-driven coding workflow with local or external backends.
- Terminal-first chat and coding workflow.
- Slash command system (
/help,/spec,/review,/rewind,/resume,/model,/safety,/todos, etc.). - Spec/orchestrator flow with step planning, status tracking, and session lifecycle updates.
- Rewind and conversation persistence (
~/.config/.nite/nite.confand saved conversation data). - Optional CUDA/Flash-Attention/CuDNN acceleration through feature flags.
src/main.rs: composition root and startup wiring.src/app/: application modules (commands, init, input, orchestrator, persistence, render, runtime, state).crates/: internal crates used by the binary (agent_core,edtui,sessionizer, etc.).tests/: integration and boundary regression tests.
- Rust toolchain with Cargo (edition 2024 compatible toolchain).
- Git submodules initialized (this repo depends on external submodules).
- Linux terminal environment (project currently tuned for Linux workflows).
For GPU builds:
- CUDA Toolkit 12.9
- CuDNN libraries
- GCC/G++ 14 toolchain (host compiler for NVCC)
git clone <your-repo-url> tui
cd tui
git submodule update --init --recursivecargo run --release -- --workspace-root ~/rust/todoUse the environment setup you shared before compilation:
export PATH=/usr/local/cuda-12.9/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-12.9/targets/x86_64-linux/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/cuda-12.9/lib64:$LD_LIBRARY_PATH
export CPATH=/usr/local/cuda-12.9/targets/x86_64-linux/include:$CPATH
export CUDA_HOME=/usr/local/cuda-12.9
export CUDNN_PATH=/usr/lib64
export CC=/usr/bin/gcc-14
export CXX=/usr/bin/g++-14
export NVCC_CCBIN=/usr/bin/g++-14
export CUDAHOSTCXX=/usr/bin/g++-14
cargo run --release --features "cuda flash-attn cudnn" -- --workspace-root ~/rust/todo--workspace-root <path>: set workspace root used by the app/agent.--spec <path>: preload a spec file at startup.
Config file path:
~/.config/.nite/nite.conf
Common keys:
backend(local,external,http)http-base-urlhttp-api-keyhttp-completions-pathgoogle-user-projectmodelvim-keybindauto-summarize-thresholdauto-summarize-threshold-version
Notes:
- Comments and blank lines in
nite.confare preserved on config updates. - Unknown keys are ignored by runtime logic.
Run the full test suite:
cargo test -p cocodeRun all crate tests and integration targets:
cargo test -p cocode --all-targets- If CUDA builds fail, re-check
PATH,LD_LIBRARY_PATH,CUDA_HOME, and GCC/NVCC host compiler env vars. - If submodule code appears missing, run:
git submodule update --init --recursive- If backend startup fails, verify
backend,http-base-url, andhttp-api-keyvalues innite.conf.