Developing locally with the CLI

You can pull any hosted changes locally, and develop them via a UI with our CLI tool.

1

Run the dev command in the root of your repo and navigate to the web url

2

Update via the UI

3

Commit and Push

Commit and push you changes to sync them with the hosted platform + CDN.

Developing locally with Markdown

If you prefer to edit files directly, we support writing prompts directly in Markdown. You can still use our CLI to create the general JSON structure and run/test prompts, but edit your prompts in Markdown.

Documentation coming soon.

Testing your changes via a local CDN

When you want to test your prompt changes with your app code, you can opt to test them locally first. We provide a local CDN which you can run. You’ll need to change the base URL of our SDK to point to it.

Running locally will be slower than the hosted platform, because templates get built by our platform when pushed to Git.

1

Serve your prompts locally

npx
npx @puzzlet/cli@latest serve -p 9004
2

Run Locally
  import { Puzzlet, workflow } from "@puzzlet/sdk";
  import { PromptTemplateRuntime } from "@puzzlet/prompt-template";

  const puzzletClient = new Puzzlet({
    apiKey, // Not used
    appId, // Not used
    baseUrl: "http://localhost:9004"
  });

  async function run () { 
    const json = await client.fetchTemplate("<my_template>.json");
    const promptTemplate = PromptTemplateRuntime.load(json);
    await promptTemplate.runSingle("<my_prompt>");
  }
  await run();

Questions or Feedback?

Have any questions or feature requests? Reach out to us at hello@puzzlet.ai