Skip to main content
LangWatch’s prompt management integrates seamlessly with GitHub through the Prompts CLI, enabling you to version control your prompts alongside your code and automatically sync changes with the LangWatch platform.

How It Works

The CLI creates standard YAML files that work perfectly with Git workflows:
  • Local prompts are stored as .prompt.yaml files in your repository
  • Remote prompts are materialized locally but gitignored (fetched fresh on each sync)
  • Dependencies are declared in prompts.json and locked in prompts-lock.json

Setup for GitHub

1. Initialize Prompts in Your Repository

This creates the essential files:

2. Configure .gitignore

Add the materialized directory to your .gitignore:
This ensures remote prompts are fetched fresh and not committed to your repository.

3. Create and Version Your Prompts

Create local prompts that will be versioned with your code:
Commit your prompt files:

GitHub Actions Integration

Automatically sync prompts on every push or pull request using GitHub Actions. Create .github/workflows/langwatch-sync.yml:

Setting Up the API Key

  1. Go to your LangWatch project settings
  2. Create new API credentials
  3. In your GitHub repository, go to SettingsSecrets and variablesActions
  4. Add a new secret named LANGWATCH_API_KEY with your API key value

Learn More

For complete documentation on all CLI commands, advanced workflows, conflict resolution, and detailed usage examples, see the Prompts CLI documentation.