Docs
Get started

Quickstart

From sign-up to a working prompt call in five minutes.

This walkthrough gets you from zero to a typed prompt call in your code. We'll create a workspace, publish a tiny prompt, install the CLI, generate code, and call the prompt.

1. Sign up and create a workspace

Head to sufleur.com, register an account, and create a workspace. Your workspace name becomes the prefix for every prompt you publish: a workspace called acme produces prompts like @acme/welcome-message.

2. Generate an API key

Open your workspace settings and create an API key. Keep it somewhere safe — you'll feed it to the CLI through an environment variable in the next step.

3. Author and publish a prompt

In the web app, create a new prompt called welcome-message. Add a single entrypoint file (for example userPrompt) with this template:

text
Hi {{user.name}}{{@type string}}{{@doc User's first name}}, welcome aboard!

Save the draft, then publish version 0.1.0.

4. Install the CLI

Pick the wrapper that matches your project. Both ship the same Go binary.

text
pnpm add -D @sufleur/cli
# or: npm i -D @sufleur/cli
# or: yarn add -D @sufleur/cli

5. Initialize your project

From the root of your project, run:

text
sufleur init

You'll be prompted for your workspace name, the env var that holds your API key, the output language, and where to write the generated file. The result is a sufleur.yaml like this:

text
api_keys:
  acme: ${ACME_API_KEY}
 
prompts: {}
 
output:
  language: typescript
  file: ./generated/prompts.ts

Set ACME_API_KEY in your environment or in a local .env file (the CLI loads .env automatically).

6. Add the prompt and generate code

text
sufleur add @acme/welcome-message
sufleur generate

add validates the prompt exists, writes it to sufleur.yaml, resolves the latest matching version, and caches it under .sufleur/. generate reads the lockfile and writes typed code to the path in output.file.

7. Call the prompt from your code

text
import { getPrompt } from './generated/prompts'
 
const welcome = getPrompt('@acme/welcome-message')
 
const { prompt } = welcome.render('userPrompt', {
  user: { name: 'Ada' },
})
 
// `prompt` is the rendered string — pass it to your LLM client of choice.
console.log(prompt)

The user.name argument is required and typed — your editor knows the shape because the CLI inferred it from the Mustache template plus the {{@type string}} annotation.

What's next

  • Add an output schema so parseOutput() returns a validated object.
  • Read the CLI reference for update, --frozen (CI mode), and aliases.
  • Open the SDK page for your language to see the full surface of the generated code.