docs / guide / The Cajeta Guide
Chapters — 3. Your first project
- Introduction
- 0. Introduction
- 1. Installation
- 2. Kick the tires
- 3. Your first project
- 4. Running your application
- 5. Debugging
- 6. Keywords
- 7. Comments
- 8. Native types
- 9. Type kinds
- 10. Allocation
- 11. Ownership & borrowing
- 12. Control flow
- 13. Strings & formatting
- 14. Templates & wildcards
- 15. Lambdas & captures
- 16. Operator overloading
- 17. Inheritance
- 18. Annotations & synthesis
- 19. DI & aspects
- 20. Error handling
- 21. Reflection
- 22. Differentiation
- 23. Code coverage
- 23. Profiling
- 24. Notebooks
- 25. Writing XPU Kernels
03 — Your first project
Chapter 02 built and ran hello. Now look at what
init actually created, and what else the toolchain can make.
The layout
hello/
├── cajeta.json # the manifest
├── src/main/cajeta/<package>/*.cajeta # sources, dirs mirror packages
└── build/ # outputs (gitignored)
The manifest
cajeta.json has three parts:
details— name, version, description, license.settings— capabilities (see chapter 04), dependencies, repositories, andsettings.build.entry-method(com.example.basic.Main::main) — the presence of an entry method is what makes this a binary project.tasks— named action pipelines. The archetype shipsbuild,test,clean,lint, andrelease; you add your own.cajeta taskslists them:
$ cajeta tasks
build Local development build
clean Wipe build outputs
lint Run native + plugin lint actions
release Release build + ship
test Unit tests with coverage instrumentation
Project types
cajeta init --list:
| Archetype | What you get |
|---|---|
basic | A binary: entry method, builds to build/exe/<name> |
library | No entry method: builds to a .cja archive other projects depend on |
workspace | A multi-member tree with shared configuration |
multi-binary | One project, several entry points / binaries |
melt | A curated bundle of dependency versions and properties (a BOM) |
A library is the same project minus the entry method:
$ cajeta init library greetlib && cd greetlib
$ cajeta build
# → build/archive/greetlib-0.1.0.cja
cajeta install publishes the .cja into your local repository so sibling
projects can depend on it before it’s ever published remotely.
Every artifact kind
The package action turns build outputs into distributables. Shipped today:
| Format | Output |
|---|---|
obj-tree | Per-source native .o tree |
uber-ir | Single linked LLVM bitcode .bc |
uber-archive | One .cja carrying the project and all transitive deps |
static-lib / shared-lib | Native .a / .so/.dylib/.dll |
tarball / zip | Compressed binary distributions |
container | OCI container image |
Deferred (the build tool rejects these with a “deferred slice” error for now):
deb, rpm, msi, app-bundle, pkg, dmg, appimage, flatpak, snap.
The wider command surface
One binary does everything; unknown subcommands fall through to your
manifest’s tasks (that’s how cajeta run works when a run task exists —
chapter 04).
| Command | What it does |
|---|---|
cajeta build / test / clean | Project tasks |
cajeta add / remove / upgrade / pin | Manage dependencies |
cajeta install / publish | Publish locally / remotely |
cajeta info / show | Inspect the project / a dependency |
cajeta deps | Print the dependency tree (text, JSON, CSV) |
cajeta archive <cmd> | Create, inspect, sign .cja archives |
cajeta doc <root> | Generate API documentation |
cajeta search-skill / list-skills / get-skills | Skill discovery in dependencies |
cajeta coverage / verify / verify-reproducible / trust | Quality and provenance |
cajeta workspace / members / toolchain / which / sandbox-info | Environment |
cajeta ide / dap / jit-run | IDE plugin, debug server, quick runs |
cajeta compiler-mcp | MCP server (stdio) serving those skills to a coding agent |
cajeta --help shows the same list.
Skills, for AI coding agents
The same skills the search-skill / get-skills commands return are also
served over the Model Context Protocol by
cajeta compiler-mcp — a stdio server built into the compiler, exposing
searchSkills, listSkills, and getSkills. Register it with your agent
(this repo ships a .mcp.json doing exactly that) and the agent can look up
authoritative guidance for a class, package, or language topic before it
writes code, instead of guessing.
The corpus is embedded in the binary, so it works with no project, no
lockfile, and no network — more than 180 skills covering the language itself
(cajeta.language), the toolchain (cajeta.toolchain), and every stdlib
package.
Your library ships skills too. Skills are part of the .cja archive
format, not a compiler privilege: write them as skills/*.md at your package
root, and cajeta build validates, indexes, and embeds them beside the
bitcode. Anyone who resolves your dependency gets your guidance offline,
pinned to the version they resolved, discoverable by name.
mylib.cja
├── … compiled bitcode members
├── skills/index.json
├── skills/opening-files.md
└── skills/retry-policy.md
The format is a Markdown body under YAML frontmatter (id, applies-to,
title, description) — see Skills for the
authoring levels and the review checklist, and
CompilerMcp for the server’s tools and
lifecycle.
For the longer walk — dependencies, publishing, uber-archives end to end — see the build tool reference.
Next: Running your application.