Getting Started
Cohesive Code is an AI-enabled code generation CLI. It runs TypeScript processes from a workspace, renders Gonja templates, parses JSON and OpenAPI documents, and tracks generated artifacts that need human or agent adjustment.
Experimental stage: Cohesive Code is not recommended for use yet. The project is unstable, changing constantly, and may introduce breaking changes to interfaces, generated support files, accelerator state behavior, and CLI commands without notice.
Install
Section titled “Install”Install the wrapper script to ~/.local/bin/ccode:
curl -fsSL https://raw.githubusercontent.com/cohesivestack/ccode/master/installer/install.sh | bashFrom a repository clone, you can run the installer directly:
bash installer/install.shThe wrapper resolves the binary version for each workspace and caches release binaries under ~/.cache/ccode/releases.
Initialize a workspace
Section titled “Initialize a workspace”Create the project support files with an explicit version:
ccode init ccode --version v0.1.0The default layout is:
ccode.yamlccode/ tsconfig.json .ccode/ .gitignore accelerators/ build/ lib/ context.ts openapi.tsccode init writes the configuration file when it is missing, refreshes generated support files under .ccode/lib/, preserves an existing tsconfig.json, clears .ccode/build/, and leaves accelerator state untouched.
Create a process
Section titled “Create a process”Create a TypeScript process under ccode_path. The process must export a default function with one Context parameter.
import type { Context } from "@ccode/context";
export default function main(ctx: Context) { const model = { name: "Cohesive Code" };
const preview = ctx.renderTemplate("templates/greeting.tpl", model); ctx.println(preview); ctx.generate("templates/greeting.tpl", "generated/greeting.txt", model);}Create the template:
Hello {{ data.name }}!Recommended layout:
ccode/ hello/ generate.ts templates/ greeting.tplRun it
Section titled “Run it”Invoke the process without the .ts extension:
ccode run hello/generateThe runtime compiles the TypeScript process, executes it inside the Go runner, prints the rendered preview, and writes generated/greeting.txt under output_path.
Next steps
Section titled “Next steps”- Read Project Layout before building a real workspace.
- Read Processes for the TypeScript process contract.
- Read Accelerators before generating files that should be adjusted by a person or agent.
- Read AI Skill Index if you are preparing a skill or agent workflow.