Skip to main content
There are two ways to deploy your AgentMark project to the platform: the deployment pipeline (recommended) and CLI deploy (file sync only). Connect a Git repository to your app in the AgentMark dashboard. When you push, the platform runs a two-step pipeline that syncs your files and deploys your handler code.

Setup

  1. Push your project to a Git repository (GitHub or GitLab).
  2. In the dashboard, navigate to your app’s Settings.
  3. Under “Repository”, connect your repository and select a branch.

How the pipeline works

Every push to your connected branch triggers a two-step deployment:
  1. File sync — The platform syncs your prompt templates (.prompt.mdx), components (.mdx, .md), and datasets (.jsonl) between your repository and the platform.
  2. Code deploy — If a handler file is detected, the platform bundles your code and deploys it to a managed machine. Your handler executes prompts when triggered from the dashboard, API, or experiments.
A handler is the entry point for prompt execution on the platform. It receives prompt requests and runs them using your adapter and models. Projects scaffolded with npm create agentmark@latest include a handler.ts file automatically.
Code deployment currently supports TypeScript only. Python support is coming soon. Python projects can still use file sync and run prompts via Connect.
If no handler is detected, the pipeline completes after file sync and skips the code deploy step. You can still run prompts via Connect in this case.
Only one deployment runs at a time per app. If you push while a deployment is in progress, the new push is skipped. Push again after the current deployment completes.

Handler detection

The platform determines your handler file using this order:
  1. handler key in agentmark.json — If your config includes a handler field, the platform uses that path.
agentmark.json
{
  "version": "2.0.0",
  "agentmarkPath": "/",
  "handler": "src/handler.ts"
}
  1. Fallback: handler.ts in the repository root — If no handler key is set, the platform checks for a handler.ts file at the root of your repository.
If neither is found, the code deploy step is skipped and the deployment completes after file sync only.

Re-triggering deployments

After your first successful deployment, you can re-trigger individual steps from the deployment card in the dashboard:
  • Re-sync — Pull the latest files from your repository without rebuilding code. Use this when you only changed prompt templates or datasets.
  • Rebuild — Re-bundle and redeploy your handler code without re-syncing files. Use this when you need to pick up new environment variables.
  • Full deploy — Run both file sync and code deploy.

Environment variables

Configure environment variables for your deployed handler in the dashboard under Settings > Environment Variables. These variables are injected during the build step and available to your handler at runtime.
Variables prefixed with AGENTMARK_ are reserved and managed by the platform. You cannot override them.
Add your AI provider keys (such as OPENAI_API_KEY or ANTHROPIC_API_KEY) and any other secrets your handler needs. Changes to environment variables take effect on the next deployment — trigger a Rebuild to apply them immediately.

CLI deploy

For projects that don’t use Git — or for CI/CD pipelines that need programmatic control — use agentmark deploy to upload files directly.
agentmark deploy
The command collects all .prompt.mdx, .mdx, .md, and .jsonl files from your AgentMark directory and uploads them to the platform.
CLI deploy syncs files only. It does not bundle or deploy handler code. If you need managed code deployment, use the deployment pipeline instead.
# Preview what would be uploaded
agentmark deploy --dry-run

# Deploy with explicit credentials
agentmark deploy --api-key am_live_xxxxx --app-id app_xxxxx
See the CLI reference for all options, authentication resolution, and exit codes.
CLI deploy and the deployment pipeline are mutually exclusive per app. If your app is connected to a Git repository, disconnect it in Settings before using agentmark deploy.

Have Questions?

We’re here to help! Choose the best way to reach us: