Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@haystackeditor/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@haystackeditor/cli
Set up Haystack verification for your project. When PRs are opened, an AI agent spins up your app in a sandbox and verifies changes work correctly.
Quick Start
npx @haystackeditor/cli initThis auto-detects your framework, package manager, and ports, then creates:
.haystack.yml- Configuration for the verification agent.agents/skills/haystack.md- Skill file for AI agent discovery
Commands
haystack init
Interactive setup wizard:
npx @haystackeditor/cli init # Interactive wizard
npx @haystackeditor/cli init -y # Accept all defaultshaystack status
Check if your project is configured:
npx @haystackeditor/cli statushaystack login
Authenticate with GitHub (required for secrets management):
npx @haystackeditor/cli loginThis uses GitHub's device flow - you'll get a code to enter at github.com/login/device.
# Log out (removes stored credentials)
npx @haystackeditor/cli logouthaystack secrets
Manage secrets that will be injected into your sandbox environment:
# List all secrets (keys only, values are never shown)
npx @haystackeditor/cli secrets list
# Set a secret
npx @haystackeditor/cli secrets set OPENAI_API_KEY sk-xxx
# Delete a secret
npx @haystackeditor/cli secrets delete OPENAI_API_KEYSecrets are encrypted and stored securely. They're automatically injected as environment variables when the sandbox runs your app.
Scopes: By default, secrets are user-scoped. You can also scope to an org or repo:
# Org-scoped (available to all repos in the org)
npx @haystackeditor/cli secrets set API_KEY xxx --scope org --scope-id myorg
# Repo-scoped (available only to this repo)
npx @haystackeditor/cli secrets set API_KEY xxx --scope repo --scope-id owner/repoConfiguration
The init command creates .haystack.yml:
version: "1"
name: my-app
dev_server:
command: pnpm dev
port: 3000
ready_pattern: "Local:"
env:
SKIP_AUTH: "true"
verification:
commands:
- name: build
run: pnpm build
- name: lint
run: pnpm lintCustomizing After Init
| If your app has... | Add this |
|---|---|
| Login/authentication | Auth bypass env var in dev_server.env |
| Key user journeys | Flows describing what to verify |
| API calls needing auth | Fixtures to mock responses |
See the generated .agents/skills/haystack.md for full documentation on flows, fixtures, and monorepo configuration.
How It Works
- You run
npx @haystackeditor/cli initand commit the config - When a PR is opened, Haystack's AI agent:
- Spins up your app in a Modal sandbox
- Reads the flows to understand what to verify
- Navigates the app autonomously
- Captures screenshots and evidence
- Reports results on the PR
License
MIT