DOCS
OVERVIEW
Build with CodeCraft
Install the CLI, generate your first change and plug CodeCraft into your workflow — from a five-minute quickstart to the full API reference.
QUICKSTART
From install to first pull request
Four commands take you from a fresh install to a reviewed, tested change in your own repository.
1
Install the CLI
Requires Node.js 18 or later. Works on macOS, Linux and Windows.
$ npm install -g @codecraft/cli
2
Sign in
Opens your browser to connect the CLI to your CodeCraft account.
$ codecraft login
3
Index your project
Run it in your repository root to build the project profile — about 20 seconds for most repos.
$ codecraft init
4
Generate your first change
Describe the change. CodeCraft writes the code and tests, then opens a pull request.
$ codecraft gen add-dark-mode --tests --pr
CORE CONCEPTS
How CodeCraft thinks about your code
Three ideas explain almost everything CodeCraft does. Each links to a deeper write-up on the blog.
REST API
Create a generation
Everything the CLI does is available over a simple REST API. Authenticate with a bearer token from your workspace settings.
POST
/v1/generations
Generates code for a prompt in the context of an indexed project. Returns a summary, test results and an optional pull request.
BODY PARAMETERS
prompt
string
required
What you want CodeCraft to build or change.
project_id
string
required
The indexed project to generate against.
tests
boolean
Write tests alongside the change. Defaults to true.
open_pr
boolean
Open a pull request with the result.
REQUEST
cURL
curl https://api.codecraft.dev/v1/generations
-H "Authorization: Bearer $CODECRAFT_KEY"
-d prompt="Add rate limiting to /api/upload"
-d project_id=prj_8f2a
-d tests=true
RESPONSE
200 OK
{
"id": "gen_4k9x",
"status": "completed",
"files_changed": 3,
"tests": { "passed": 8, "failed": 0 },
"pull_request": null
}
SDKS
Official SDKs
Typed clients for the languages teams integrate with most. All SDKs wrap the same REST API.
HELP & SUPPORT
Still have questions?
Pick the fastest route to an answer.