Reference for all hitspec CLI exit codes for use in scripts and CI/CD pipelines.
hitspec uses specific exit codes to indicate the result of a test run. These are useful for scripting and CI/CD integration.
Exit Codes
Code
Constant
Description
0
ExitSuccess
All tests passed
1
ExitTestFailure
One or more tests failed or thresholds exceeded
2
ExitParseError
A file could not be loaded: invalid syntax, a duplicate @name, or a circular @depends in a .http / .hitspec file
3
ExitConfigError
Configuration error: a hitspec.yaml (or --config file) that is missing or cannot be parsed, an --env-file that does not exist, a missing or invalid --cacert, --cert, --key or --proxy, an unknown or conflicting reporters entry in hitspec.yaml (or an outputDir that cannot be created), or a port that is already in use (--metrics-port, or the hitspec mock / hitspec record port). These stop the command before any request is sent. validate, studio, serve and contract also exit 3 on a broken hitspec.yaml
4
ExitNetworkError
At least one request got no response because the connection failed: connection refused or unreachable, DNS resolution failure, TLS handshake or certificate error, the request timeout expiring before a connection was established, or the connection reset or closed before a response arrived. This includes an unreachable OAuth2 token endpoint and an unreachable @waitFor target
64
ExitUsageError
Usage error: an unknown flag or command, a flag value the parser rejects (for example --concurrency abc), a missing required flag, the wrong number of arguments, - combined with other files, --watch or --stress, --dry-run combined with --stress, invalid hitspec mcp arguments, or --name / --tags that matched no request in any file. hitspec prints Run 'hitspec <cmd> --help' for usage. for these. Errors a command finds while doing its work keep their own code: a missing file or an unknown export format exits 1
130
ExitInterrupted
The run was stopped with Ctrl+C (SIGINT) or SIGTERM. The results of the requests that finished are printed, --output-file is written, and requests that had not started are marked as cancelled. A second Ctrl+C exits immediately
Precedence
hitspec run always runs every file it can, even when another file fails to load. When several outcomes apply, the exit code follows this order: 2 (a file could not be loaded) over 4 (a request hit a network error) over 1 (a request failed) over 64 (filters matched nothing) over 0. A run with a broken file never exits 0, so a broken file cannot hide behind green results. An interrupted run exits 130 whatever else happened.
Network errors and timeouts
Exit 4 means hitspec could not reach the server, so there is nothing to assert on: use it to tell “the API is down or unreachable” apart from “the API answered wrongly” (1). It applies only to connection-level errors. A request that connects but then exceeds @timeout or --timeout while waiting for the response is an ordinary test failure (1), and so is a response whose body breaks off part-way, because a response did arrive. Requests skipped because a dependency failed do not change the exit code on their own.
Usage in Scripts
hitspec run tests/ --env stagingEXIT_CODE=$?case $EXIT_CODE in 0) echo "All tests passed" ;; 1) echo "Tests failed" ;; 2) echo "Parse error in test files" ;; 3) echo "Configuration error" ;; 4) echo "Network error: the API could not be reached" ;; 64) echo "Invalid CLI usage" ;; 130) echo "Interrupted" ;; *) echo "Unknown exit code: $EXIT_CODE" ;;esac
CI/CD Usage
Most CI systems treat any non-zero exit code as failure. hitspec’s exit codes let you distinguish between test failures and infrastructure issues. A step that accepts only 0 and 1 must also handle 4 (the API could not be reached) and 130 (interrupted):
# GitHub Actions- name: Run API tests run: hitspec run tests/ --output junit --output-file results.xml continue-on-error: true- name: Check results run: | if [ ${{ steps.test.outcome }} == 'failure' ]; then echo "Tests failed - check results.xml" fi
Use --bail to stop on the first failure and exit immediately with that failure’s code (1 for a failed test, 4 for a network error). Without --bail, hitspec runs all tests before exiting.
Last modified on October 19, 2026
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"hitspec","description":"hitspec is a file-based HTTP API testing tool. Write API tests as plain-text .http files, run them with 26 assertion operators, capture and chain requests, stress-test, mock, and verify database state — no SDK, no GUI, no JavaScript.","colors":{"primary":"#88C0D0","light":"#8FBCBB","dark":"#5E81AC"},"logo":{"light":"https://mintcdn.com/fuego-45a05047/A4gbvCUx3th6_k6y/logo/light.svg?fit=max\u0026auto=format\u0026n=A4gbvCUx3th6_k6y\u0026q=85\u0026s=b041ab9cc5b38b53110611b1c3e3435d","dark":"https://mintcdn.com/fuego-45a05047/A4gbvCUx3th6_k6y/logo/dark.svg?fit=max\u0026auto=format\u0026n=A4gbvCUx3th6_k6y\u0026q=85\u0026s=d9a717f6f6d804685a15907aa0d1f27e"},"favicon":"https://mintcdn.com/fuego-45a05047/A4gbvCUx3th6_k6y/favicon.svg?fit=max\u0026auto=format\u0026n=A4gbvCUx3th6_k6y\u0026q=85\u0026s=1f9aa7e4e0e34f5f9afb23c4165d8673","navbar":{"links":[{"href":"https://github.com/abdul-hamid-achik/hitspec","label":"GitHub"},{"href":"https://github.com/abdul-hamid-achik/hitspec/blob/main/CHANGELOG.md","label":"Changelog"}],"primary":{"type":"button","label":"Install","href":"/installation"}},"footer":{"socials":{"github":"https://github.com/abdul-hamid-achik/hitspec"}},"search":{"prompt":"Search the docs, syntax, and CLI…"},"seo":{"metatags":{"og:site_name":"hitspec","og:type":"website","og:locale":"en_US","twitter:card":"summary_large_image","theme-color":"#88C0D0","canonical":"https://hitspec.dev","robots":"index, follow","revisit-after":"7 days","language":"en"},"indexing":"navigable"},"metadata":{"timestamp":true},"styling":{"latex":false},"navigation":{"global":{"tabs":[{"tab":"Documentation","href":"/introduction"},{"tab":"Guides","href":"/guides"},{"tab":"Reference","href":"/reference"},{"tab":"Examples","href":"/examples"}],"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/abdul-hamid-achik/hitspec"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"fuego-45a05047","hasAudioNarration":false,"actualSubdomain":"fuego-45a05047","customDomains":["hitspec.dev"],"gitSource":{"type":"github","owner":"abdul-hamid-achik","repo":"hitspec","deployBranch":"main","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ad6611a7c2363fd57cca63a","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"Features","count":17},{"language":"default","tag":"CLI Reference","count":13},{"language":"default","tag":"Guides","count":9},{"language":"default","tag":"Examples","count":8},{"language":"default","tag":"Core Concepts","count":7},{"language":"default","tag":"Getting Started","count":6},{"language":"default","tag":"Integrations","count":6},{"language":"default","tag":"Assertions Reference","count":2},{"language":"default","tag":"Configuration","count":2},{"language":"default","tag":"Authentication","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"landing.css","content":".hs-hero{position:relative;overflow:hidden;padding:6rem 1.5rem 4rem;background:radial-gradient(1200px 600px at 50% -10%, rgba(136, 192, 208, 0.18), transparent 60%),\n radial-gradient(800px 500px at 85% 10%, rgba(94, 129, 172, 0.16), transparent 55%),\n radial-gradient(700px 500px at 10% 20%, rgba(143, 188, 187, 0.14), transparent 55%)}@media (prefers-color-scheme: dark){.hs-hero{background:radial-gradient(1200px 600px at 50% -10%, rgba(136, 192, 208, 0.16), transparent 60%),\n radial-gradient(800px 500px at 85% 10%, rgba(94, 129, 172, 0.22), transparent 55%),\n radial-gradient(700px 500px at 10% 20%, rgba(143, 188, 187, 0.10), transparent 55%)}}.hs-hero::before{content:\"\";position:absolute;inset:0;background-image:linear-gradient(to right, rgba(136, 192, 208, 0.06) 1px, transparent 1px),\n linear-gradient(to bottom, rgba(136, 192, 208, 0.06) 1px, transparent 1px);background-size:48px 48px;mask-image:radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 80%);-webkit-mask-image:radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 80%);pointer-events:none}.hs-hero-inner{position:relative;max-width:72rem;margin:0 auto}.hs-badge{display:inline-flex;align-items:center;gap:0.5rem;padding:0.3rem 0.9rem;border-radius:999px;font-size:0.8rem;font-weight:500;letter-spacing:0.01em;color:#2e3440;background:rgba(136, 192, 208, 0.16);border:1px solid rgba(136, 192, 208, 0.35);backdrop-filter:blur(6px)}@media (prefers-color-scheme: dark){.hs-badge{color:#e5e9f0;background:rgba(136, 192, 208, 0.10);border:1px solid rgba(136, 192, 208, 0.25)}}.hs-badge-dot{width:0.5rem;height:0.5rem;border-radius:999px;background:#88c0d0;box-shadow:0 0 0 0 rgba(136, 192, 208, 0.7);animation:hs-pulse 2s infinite}@keyframes hs-pulse{0%{box-shadow:0 0 0 0 rgba(136, 192, 208, 0.6)}70%{box-shadow:0 0 0 8px rgba(136, 192, 208, 0)}100%{box-shadow:0 0 0 0 rgba(136, 192, 208, 0)}}.hs-headline{font-size:clamp(2.5rem, 6vw, 4.75rem);line-height:1.05;font-weight:700;letter-spacing:-0.02em;margin:1.25rem 0 0}.hs-gradient-text{background:linear-gradient(110deg, #5e81ac 0%, #88c0d0 45%, #8fbcbb 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}.hs-subhead{font-size:clamp(1.05rem, 2.2vw, 1.35rem);line-height:1.6;max-width:42rem;margin:1.5rem 0 0;color:#4c566a}@media (prefers-color-scheme: dark){.hs-subhead{color:#aeb6c6}}.hs-cta-row{display:flex;flex-wrap:wrap;gap:0.75rem;margin-top:2rem;align-items:center}.hs-btn{display:inline-flex;align-items:center;gap:0.5rem;padding:0.7rem 1.4rem;border-radius:0.75rem;font-weight:600;font-size:0.95rem;text-decoration:none;transition:transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease}.hs-btn-primary{color:#1b1f2a;background:linear-gradient(135deg, #88c0d0 0%, #8fbcbb 100%);box-shadow:0 10px 30px -10px rgba(136, 192, 208, 0.65)}.hs-btn-primary:hover{transform:translateY(-2px);box-shadow:0 16px 38px -12px rgba(136, 192, 208, 0.8)}@media (prefers-color-scheme: dark){.hs-btn-primary{color:#0d1117;background:linear-gradient(135deg, #88c0d0 0%, #a3d3df 100%)}}.hs-btn-ghost{color:#2e3440;background:rgba(46, 52, 64, 0.04);border:1px solid rgba(46, 52, 64, 0.18)}.hs-btn-ghost:hover{transform:translateY(-2px);background:rgba(46, 52, 64, 0.08)}@media (prefers-color-scheme: dark){.hs-btn-ghost{color:#e5e9f0;background:rgba(229, 233, 240, 0.04);border:1px solid rgba(229, 233, 240, 0.18)}.hs-btn-ghost:hover{background:rgba(229, 233, 240, 0.08)}}.hs-install-chip{display:inline-flex;align-items:center;gap:0.6rem;margin-top:1.5rem;padding:0.6rem 1rem;border-radius:0.6rem;font-family:ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, monospace;font-size:0.9rem;color:#2e3440;background:rgba(46, 52, 64, 0.05);border:1px solid rgba(46, 52, 64, 0.12)}@media (prefers-color-scheme: dark){.hs-install-chip{color:#d8dee9;background:rgba(216, 222, 233, 0.05);border:1px solid rgba(216, 222, 233, 0.12)}}.hs-install-chip code{background:transparent;border:none;padding:0;font-size:inherit}.hs-window{margin-top:2.5rem;border-radius:0.9rem;overflow:hidden;border:1px solid rgba(46, 52, 64, 0.14);background:#f6f8fa;box-shadow:0 24px 60px -28px rgba(46, 52, 64, 0.45)}@media (prefers-color-scheme: dark){.hs-window{border-color:rgba(216, 222, 233, 0.12);background:#161a23;box-shadow:0 24px 60px -28px rgba(0, 0, 0, 0.7)}}.hs-window-bar{display:flex;align-items:center;gap:0.45rem;padding:0.65rem 0.9rem;border-bottom:1px solid rgba(46, 52, 64, 0.10);background:rgba(46, 52, 64, 0.03)}@media (prefers-color-scheme: dark){.hs-window-bar{border-bottom-color:rgba(216, 222, 233, 0.10);background:rgba(216, 222, 233, 0.03)}}.hs-dot{width:0.75rem;height:0.75rem;border-radius:999px}.hs-dot-r{background:#ff5f57}.hs-dot-y{background:#febc2e}.hs-dot-g{background:#28c840}.hs-window-title{margin-left:0.5rem;font-size:0.78rem;color:#6b7280;font-family:ui-monospace, SFMono-Regular, Menlo, monospace}@media (prefers-color-scheme: dark){.hs-window-title{color:#8b93a7}}.hs-window pre{margin:0;padding:1.1rem 1.25rem;overflow-x:auto;font-family:ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, monospace;font-size:0.86rem;line-height:1.7;background:transparent!important}.hs-stats{display:grid;grid-template-columns:repeat(2, 1fr);gap:1rem;max-width:72rem;margin:0 auto;padding:0 1.5rem 3rem}@media (min-width: 768px){.hs-stats{grid-template-columns:repeat(4, 1fr)}}.hs-stat{text-align:center;padding:1.25rem 0.5rem;border-radius:0.85rem;border:1px solid rgba(46, 52, 64, 0.10);background:rgba(136, 192, 208, 0.05)}@media (prefers-color-scheme: dark){.hs-stat{border-color:rgba(216, 222, 233, 0.10);background:rgba(136, 192, 208, 0.05)}}.hs-stat-num{font-size:1.9rem;font-weight:700;line-height:1}.hs-stat-label{margin-top:0.4rem;font-size:0.82rem;color:#6b7280}@media (prefers-color-scheme: dark){.hs-stat-label{color:#8b93a7}}.hs-section{max-width:72rem;margin:0 auto;padding:3rem 1.5rem}.hs-eyebrow{text-transform:uppercase;letter-spacing:0.12em;font-size:0.78rem;font-weight:600;color:#5e81ac}.hs-h2{font-size:clamp(1.75rem, 3.5vw, 2.5rem);font-weight:700;letter-spacing:-0.015em;margin:0.5rem 0 0.5rem}.hs-lead{max-width:40rem;color:#4c566a;font-size:1.05rem;line-height:1.6}@media (prefers-color-scheme: dark){.hs-lead{color:#aeb6c6}}.hs-grid{display:grid;gap:1rem;grid-template-columns:1fr}@media (min-width: 640px){.hs-grid{grid-template-columns:repeat(2, 1fr)}}@media (min-width: 1024px){.hs-grid{grid-template-columns:repeat(3, 1fr)}}.hs-feature{display:block;padding:1.4rem;border-radius:0.9rem;border:1px solid rgba(46, 52, 64, 0.10);background:rgba(255, 255, 255, 0.6);text-decoration:none;transition:transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;backdrop-filter:blur(4px)}.hs-feature:hover{transform:translateY(-3px);border-color:rgba(136, 192, 208, 0.55);box-shadow:0 18px 40px -22px rgba(94, 129, 172, 0.45)}@media (prefers-color-scheme: dark){.hs-feature{border-color:rgba(216, 222, 233, 0.10);background:rgba(229, 233, 240, 0.03)}.hs-feature:hover{border-color:rgba(136, 192, 208, 0.55)}}.hs-feature-ico{width:2.5rem;height:2.5rem;display:flex;align-items:center;justify-content:center;border-radius:0.7rem;font-size:1.1rem;background:linear-gradient(135deg, rgba(136, 192, 208, 0.25), rgba(94, 129, 172, 0.18));margin-bottom:0.85rem}.hs-feature-title{font-weight:600;font-size:1.02rem;color:#2e3440;margin:0}@media (prefers-color-scheme: dark){.hs-feature-title{color:#e5e9f0}}.hs-feature-desc{margin-top:0.4rem;font-size:0.9rem;line-height:1.55;color:#6b7280}@media (prefers-color-scheme: dark){.hs-feature-desc{color:#9ba3b3}}.hs-compare{width:100%;border-collapse:separate;border-spacing:0;font-size:0.92rem}.hs-compare th,.hs-compare td{padding:0.7rem 0.9rem;text-align:left;border-bottom:1px solid rgba(46, 52, 64, 0.08)}@media (prefers-color-scheme: dark){.hs-compare th,.hs-compare td{border-bottom-color:rgba(216, 222, 233, 0.08)}}.hs-compare th{font-weight:600;color:#2e3440;background:rgba(136, 192, 208, 0.06)}@media (prefers-color-scheme: dark){.hs-compare th{color:#e5e9f0}}.hs-compare tr:last-child td{border-bottom:none}.hs-yes{color:#28a745;font-weight:600}.hs-no{color:#9ba3b3}.hs-band{position:relative;overflow:hidden;padding:3.5rem 1.5rem;border-radius:1.25rem;max-width:72rem;margin:2rem auto;background:linear-gradient(135deg, rgba(94, 129, 172, 0.10), rgba(136, 192, 208, 0.08)),\n rgba(255, 255, 255, 0.5);border:1px solid rgba(136, 192, 208, 0.25)}@media (prefers-color-scheme: dark){.hs-band{background:linear-gradient(135deg, rgba(94, 129, 172, 0.16), rgba(136, 192, 208, 0.06)),\n rgba(229, 233, 240, 0.03);border-color:rgba(136, 192, 208, 0.20)}}.hs-final{position:relative;overflow:hidden;text-align:center;padding:5rem 1.5rem;max-width:72rem;margin:2rem auto 4rem;border-radius:1.5rem;background:radial-gradient(600px 300px at 50% 0%, rgba(136, 192, 208, 0.30), transparent 70%),\n linear-gradient(135deg, #5e81ac 0%, #88c0d0 100%);color:#fff}@media (prefers-color-scheme: dark){.hs-final{background:radial-gradient(600px 300px at 50% 0%, rgba(136, 192, 208, 0.35), transparent 70%),\n linear-gradient(135deg, #4c5e87 0%, #7fb3c4 100%);color:#0d1117}}.hs-final h2{font-size:clamp(1.8rem, 4vw, 2.75rem);font-weight:700;letter-spacing:-0.015em;margin:0}.hs-final p{margin:1rem auto 0;max-width:36rem;font-size:1.08rem;opacity:0.95}.hs-final .hs-btn-primary{background:#fff;color:#1b1f2a;box-shadow:0 12px 34px -12px rgba(0, 0, 0, 0.45)}.hs-final .hs-btn-primary:hover{background:#f6f8fa}.hs-faq{max-width:48rem;margin:0 auto;padding:1rem 1.5rem 3rem}body:has(.hs-hero) #page-title{display:none}"}],"page":{"pagePath":"reference/exit-codes","slug":"/reference/exit-codes","pageMetadata":{"title":"Exit Codes","description":"Reference for all hitspec CLI exit codes for use in scripts and CI/CD pipelines.","href":"/reference/exit-codes"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Reference for all hitspec CLI exit codes for use in scripts and CI/CD pipelines.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`hitspec uses specific exit codes to indicate the result of a test run. These are useful for scripting and CI/CD integration.`}),`\n`,_jsx(Heading,{level:`2`,id:`exit-codes`,children:`Exit Codes`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Constant`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`ExitSuccess`})}),_jsx(_components.td,{children:`All tests passed`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`1`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`ExitTestFailure`})}),_jsx(_components.td,{children:`One or more tests failed or thresholds exceeded`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`2`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`ExitParseError`})}),_jsxs(_components.td,{children:[`A file could not be loaded: invalid syntax, a duplicate `,_jsx(_components.code,{children:`@name`}),`, or a circular `,_jsx(_components.code,{children:`@depends`}),` in a `,_jsx(_components.code,{children:`.http`}),` / `,_jsx(_components.code,{children:`.hitspec`}),` file`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`3`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`ExitConfigError`})}),_jsxs(_components.td,{children:[`Configuration error: a `,_jsx(_components.code,{children:`hitspec.yaml`}),` (or `,_jsx(_components.code,{children:`--config`}),` file) that is missing or cannot be parsed, an `,_jsx(_components.code,{children:`--env-file`}),` that does not exist, a missing or invalid `,_jsx(_components.code,{children:`--cacert`}),`, `,_jsx(_components.code,{children:`--cert`}),`, `,_jsx(_components.code,{children:`--key`}),` or `,_jsx(_components.code,{children:`--proxy`}),`, an unknown or conflicting `,_jsx(_components.code,{children:`reporters`}),` entry in `,_jsx(_components.code,{children:`hitspec.yaml`}),` (or an `,_jsx(_components.code,{children:`outputDir`}),` that cannot be created), or a port that is already in use (`,_jsx(_components.code,{children:`--metrics-port`}),`, or the `,_jsx(_components.code,{children:`hitspec mock`}),` / `,_jsx(_components.code,{children:`hitspec record`}),` port). These stop the command before any request is sent. `,_jsx(_components.code,{children:`validate`}),`, `,_jsx(_components.code,{children:`studio`}),`, `,_jsx(_components.code,{children:`serve`}),` and `,_jsx(_components.code,{children:`contract`}),` also exit `,_jsx(_components.code,{children:`3`}),` on a broken `,_jsx(_components.code,{children:`hitspec.yaml`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`4`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`ExitNetworkError`})}),_jsxs(_components.td,{children:[`At least one request got no response because the connection failed: connection refused or unreachable, DNS resolution failure, TLS handshake or certificate error, the request timeout expiring before a connection was established, or the connection reset or closed before a response arrived. This includes an unreachable OAuth2 token endpoint and an unreachable `,_jsx(_components.code,{children:`@waitFor`}),` target`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`64`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`ExitUsageError`})}),_jsxs(_components.td,{children:[`Usage error: an unknown flag or command, a flag value the parser rejects (for example `,_jsx(_components.code,{children:`--concurrency abc`}),`), a missing required flag, the wrong number of arguments, `,_jsx(_components.code,{children:`-`}),` combined with other files, `,_jsx(_components.code,{children:`--watch`}),` or `,_jsx(_components.code,{children:`--stress`}),`, `,_jsx(_components.code,{children:`--dry-run`}),` combined with `,_jsx(_components.code,{children:`--stress`}),`, invalid `,_jsx(_components.code,{children:`hitspec mcp`}),` arguments, or `,_jsx(_components.code,{children:`--name`}),` / `,_jsx(_components.code,{children:`--tags`}),` that matched no request in any file. hitspec prints `,_jsx(_components.code,{children:`Run 'hitspec \u003ccmd> --help' for usage.`}),` for these. Errors a command finds while doing its work keep their own code: a missing file or an unknown export format exits `,_jsx(_components.code,{children:`1`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`130`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`ExitInterrupted`})}),_jsxs(_components.td,{children:[`The run was stopped with Ctrl+C (SIGINT) or SIGTERM. The results of the requests that finished are printed, `,_jsx(_components.code,{children:`--output-file`}),` is written, and requests that had not started are marked as cancelled. A second Ctrl+C exits immediately`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`precedence`,children:`Precedence`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`hitspec run`}),` always runs every file it can, even when another file fails to load. When several outcomes apply, the exit code follows this order: `,_jsx(_components.code,{children:`2`}),` (a file could not be loaded) over `,_jsx(_components.code,{children:`4`}),` (a request hit a network error) over `,_jsx(_components.code,{children:`1`}),` (a request failed) over `,_jsx(_components.code,{children:`64`}),` (filters matched nothing) over `,_jsx(_components.code,{children:`0`}),`. A run with a broken file never exits `,_jsx(_components.code,{children:`0`}),`, so a broken file cannot hide behind green results. An interrupted run exits `,_jsx(_components.code,{children:`130`}),` whatever else happened.`]}),`\n`,_jsx(Heading,{level:`3`,id:`network-errors-and-timeouts`,children:`Network errors and timeouts`}),`\n`,_jsxs(_components.p,{children:[`Exit `,_jsx(_components.code,{children:`4`}),` means hitspec could not reach the server, so there is nothing to assert on: use it to tell “the API is down or unreachable” apart from “the API answered wrongly” (`,_jsx(_components.code,{children:`1`}),`). It applies only to connection-level errors. A request that connects but then exceeds `,_jsx(_components.code,{children:`@timeout`}),` or `,_jsx(_components.code,{children:`--timeout`}),` while waiting for the response is an ordinary test failure (`,_jsx(_components.code,{children:`1`}),`), and so is a response whose body breaks off part-way, because a response did arrive. Requests skipped because a dependency failed do not change the exit code on their own.`]}),`\n`,_jsx(Heading,{level:`2`,id:`usage-in-scripts`,children:`Usage in Scripts`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`hitspec`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tests/`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --env`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` staging`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`EXIT_CODE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`$?`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`case`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $EXIT_CODE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` in`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:` 0`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"All tests passed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ;;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:` 1`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Tests failed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ;;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:` 2`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Parse error in test files\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ;;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:` 3`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Configuration error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ;;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:` 4`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Network error: the API could not be reached\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ;;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:` 64`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Invalid CLI usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ;;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:` 130`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Interrupted\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ;;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` *)`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Unknown exit code: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$EXIT_CODE`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ;;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`esac`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`ci/cd-usage`,children:`CI/CD Usage`}),`\n`,_jsxs(_components.p,{children:[`Most CI systems treat any non-zero exit code as failure. hitspec’s exit codes let you distinguish between test failures and infrastructure issues. A step that accepts only `,_jsx(_components.code,{children:`0`}),` and `,_jsx(_components.code,{children:`1`}),` must also handle `,_jsx(_components.code,{children:`4`}),` (the API could not be reached) and `,_jsx(_components.code,{children:`130`}),` (interrupted):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# GitHub Actions`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Run API tests`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`hitspec run tests/ --output junit --output-file results.xml`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` continue-on-error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Check results`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" if [ ${{ steps.test.outcome }} == 'failure' ]; then\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"Tests failed - check results.xml\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` fi`})}),`\n`]})})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`--bail`}),` to stop on the first failure and exit immediately with that failure’s code (`,_jsx(_components.code,{children:`1`}),` for a failed test, `,_jsx(_components.code,{children:`4`}),` for a network error). Without `,_jsx(_components.code,{children:`--bail`}),`, hitspec runs all tests before exiting.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Exit Codes","description":"Reference for all hitspec CLI exit codes for use in scripts and CI/CD pipelines.","href":"/reference/exit-codes"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Exit Codes","slug":"exit-codes","depth":2,"children":[]},{"title":"Precedence","slug":"precedence","depth":2,"children":[{"title":"Network errors and timeouts","slug":"network-errors-and-timeouts","depth":3,"children":[]}]},{"title":"Usage in Scripts","slug":"usage-in-scripts","depth":2,"children":[]},{"title":"CI/CD Usage","slug":"ci/cd-usage","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"fuego-45a05047","siteName":"hitspec","title":"Exit Codes - hitspec","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-19T18:20:45.112Z","gitLastModified":"2026-10-19T18:20:30.000Z","originalFileLocation":"reference/exit-codes.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Reference for all hitspec CLI exit codes for use in scripts and CI/CD pipelines.\">\u003cmeta data-mint-head name=\"application-name\" content=\"hitspec\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Exit Codes - hitspec\">\u003cmeta data-mint-head property=\"og:description\" content=\"Reference for all hitspec CLI exit codes for use in scripts and CI/CD pipelines.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"hitspec\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://hitspec.dev/reference/exit-codes\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://fuego-45a05047.mintlify.site/_mintlify/api/og/v2?division=CLI+Reference\u0026amp;title=Exit+Codes\u0026amp;description=Reference+for+all+hitspec+CLI+exit+codes+for+use+in+scripts+and+CI%2FCD+pipelines.\u0026amp;theme=93275042a6aa6480dea6ccca\u0026amp;signature=259122e2cc9dd78bd239cfaa17a9da3b893a4629c85e84ff70d0111bc36956bb\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Exit Codes - hitspec\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Reference for all hitspec CLI exit codes for use in scripts and CI/CD pipelines.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://fuego-45a05047.mintlify.site/_mintlify/api/og/v2?division=CLI+Reference\u0026amp;title=Exit+Codes\u0026amp;description=Reference+for+all+hitspec+CLI+exit+codes+for+use+in+scripts+and+CI%2FCD+pipelines.\u0026amp;theme=93275042a6aa6480dea6ccca\u0026amp;signature=259122e2cc9dd78bd239cfaa17a9da3b893a4629c85e84ff70d0111bc36956bb\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"hitspec\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#88C0D0\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003cmeta data-mint-head name=\"theme-color\" content=\"#88C0D0\">\u003cmeta data-mint-head name=\"revisit-after\" content=\"7 days\">\u003cmeta data-mint-head name=\"language\" content=\"en\">\u003clink data-mint-head rel=\"canonical\" href=\"https://hitspec.dev/reference/exit-codes\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/reference/exit-codes.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://hitspec.dev/#organization\",\"name\":\"hitspec\",\"url\":\"https://hitspec.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/fuego-45a05047/A4gbvCUx3th6_k6y/logo/light.svg?fit=max\u0026auto=format\u0026n=A4gbvCUx3th6_k6y\u0026q=85\u0026s=b041ab9cc5b38b53110611b1c3e3435d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://hitspec.dev#website\",\"name\":\"hitspec\",\"url\":\"https://hitspec.dev\",\"publisher\":{\"@id\":\"https://hitspec.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://hitspec.dev/reference/exit-codes#webpage\",\"url\":\"https://hitspec.dev/reference/exit-codes\",\"name\":\"Exit Codes\",\"description\":\"Reference for all hitspec CLI exit codes for use in scripts and CI/CD pipelines.\",\"dateModified\":\"2026-10-19T18:20:30.000Z\",\"isPartOf\":{\"@id\":\"https://hitspec.dev#website\"},\"breadcrumb\":{\"@id\":\"https://hitspec.dev/reference/exit-codes#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://hitspec.dev/reference/exit-codes#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"CLI Reference\",\"item\":\"https://hitspec.dev/reference/run\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Exit Codes\",\"item\":\"https://hitspec.dev/reference/exit-codes\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://hitspec.dev/reference/exit-codes#article\",\"headline\":\"Exit Codes\",\"name\":\"Exit Codes\",\"description\":\"Reference for all hitspec CLI exit codes for use in scripts and CI/CD pipelines.\",\"url\":\"https://hitspec.dev/reference/exit-codes\",\"mainEntityOfPage\":{\"@id\":\"https://hitspec.dev/reference/exit-codes#webpage\"},\"dateModified\":\"2026-10-19T18:20:30.000Z\",\"publisher\":{\"@id\":\"https://hitspec.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://hitspec.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"hitspec\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"hitspec\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/reference/exit-codes.md","siteName":"hitspec","nav":{"global":{"tabs":[{"tab":"Documentation","href":"/introduction"},{"tab":"Guides","href":"/guides"},{"tab":"Reference","href":"/reference"},{"tab":"Examples","href":"/examples"}],"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/abdul-hamid-achik/hitspec"}]},"groups":[{"group":"Getting Started","pages":[{"title":"hitspec — Plain text API tests. No magic.","mode":"custom","href":"/introduction"},{"title":"Install hitspec — Homebrew, Go, and binary","href":"/installation"},{"title":"Write and run your first API test in under a minute","href":"/quickstart"},{"title":"hitspec studio — a keyboard-first terminal API client","href":"/studio"},{"title":"hitspec Studio desktop — a native GUI for .http files","href":"/desktop"},{"title":"Editor Setup","href":"/editor-setup"}]},{"group":"Core Concepts","pages":[{"title":"The .http file format for API tests","href":"/concepts/file-format"},{"title":"Variables","href":"/concepts/variables"},{"title":"Variable Interpolation","href":"/concepts/variable-interpolation"},{"title":"Assertions","href":"/concepts/assertions"},{"title":"Captures","href":"/concepts/captures"},{"title":"Dependencies","href":"/concepts/dependencies"},{"title":"Environments","href":"/concepts/environments"}]},{"group":"Features","pages":[{"title":"Authentication for API tests (@auth)","href":"/features/authentication"},{"title":"Multipart and GraphQL","href":"/features/multipart-graphql"},{"title":"TLS, cookies and HTTP options","href":"/features/tls-and-cookies"},{"title":"Snapshot testing for API responses","href":"/features/snapshot-testing"},{"title":"Load and stress test APIs with hitspec","href":"/features/stress-testing"},{"title":"Database assertions after HTTP requests","href":"/features/database-assertions"},{"title":"Shell Commands","href":"/features/shell-commands"},{"title":"Hooks","href":"/features/hooks"},{"title":"Server-Sent Events (SSE)","href":"/features/sse"},{"title":"API Coverage","href":"/features/api-coverage"},{"title":"Mock server from .http files","href":"/features/mock-server"},{"title":"Contract Testing","href":"/features/contract-testing"},{"title":"Recording Proxy","href":"/features/recording-proxy"},{"title":"Watch Mode","href":"/features/watch-mode"},{"title":"Parallel Execution","href":"/features/parallel-execution"},{"title":"Notifications","href":"/features/notifications"},{"title":"Metrics Export","href":"/features/metrics-export"}]},{"group":"Guides","pages":[{"title":"hitspec studio","icon":"terminal","href":"/guides/api-client-manager"},{"title":"CI/CD Pipeline Integration","href":"/guides/ci-cd-pipeline"},{"title":"Regression Testing with hitspec diff","href":"/guides/regression-testing"},{"title":"Database Testing Guide","href":"/guides/database-testing"},{"title":"Load Testing Guide","href":"/guides/load-testing"},{"title":"Contract Testing Guide","href":"/guides/contract-testing"},{"title":"Migrate from Postman to hitspec .http tests","href":"/guides/migrating-from-postman"},{"title":"Upgrading","icon":"arrow-up","href":"/guides/upgrading"},{"title":"Troubleshooting","icon":"wrench","href":"/guides/troubleshooting"}]},{"group":"Examples","pages":[{"title":"Basic CRUD","href":"/examples/basic-crud"},{"title":"Auth Flow","href":"/examples/auth-flow"},{"title":"GraphQL","href":"/examples/graphql"},{"title":"CI/CD Integration","href":"/examples/ci-cd"},{"title":"Stress Testing","href":"/examples/stress-testing"},{"title":"Database Assertions","href":"/examples/database-assertions"},{"title":"Contract Testing","href":"/examples/contract-testing"},{"title":"Mock Server","href":"/examples/mock-server"}]},{"group":"CLI Reference","pages":[{"title":"hitspec run","href":"/reference/run"},{"title":"hitspec validate \u0026 list","href":"/reference/validate-list"},{"title":"hitspec init","href":"/reference/init"},{"title":"hitspec import \u0026 export","href":"/reference/import-export"},{"title":"hitspec mock \u0026 record","href":"/reference/mock-record"},{"title":"hitspec contract \u0026 diff","href":"/reference/contract-diff"},{"title":"hitspec docs, studio \u0026 serve","href":"/reference/docs-serve"},{"title":"Fetch responses","href":"/reference/fetch"},{"title":"MCP client and server","href":"/reference/mcp"},{"title":"REST API","icon":"code","href":"/reference/rest-api"},{"title":"hitspec completion","href":"/reference/completion"},{"title":"hitspec version","description":"Print the installed hitspec version and build information.","href":"/reference/version"},{"title":"Exit Codes","href":"/reference/exit-codes"}]},{"group":"Configuration","pages":[{"title":"Configuration Reference","description":"Complete reference for hitspec.yaml configuration file options with defaults and examples.","href":"/reference/configuration"},{"title":"Environment Variables","href":"/reference/environment-variables"}]},{"group":"Assertions Reference","pages":[{"title":"Assertion Operators","href":"/reference/assertion-operators"},{"title":"Assertion Subjects","href":"/reference/assertion-subjects"}]},{"group":"Built-in Functions","pages":[{"title":"Built-in Functions","href":"/reference/builtin-functions"}]},{"group":"Authentication","pages":[{"title":"Authentication Types","href":"/reference/auth-types"}]},{"group":"Output Formats","pages":[{"title":"Output Formats","href":"/reference/output-formats"}]},{"group":"Integrations","pages":[{"title":"GitHub Actions","href":"/integrations/github-actions"},{"title":"Output Formats","href":"/integrations/output-formats"},{"title":"Prometheus","href":"/integrations/prometheus"},{"title":"DataDog","href":"/integrations/datadog"},{"title":"Slack \u0026 Teams Notifications","href":"/integrations/slack-teams"},{"title":"Agent artifact workflow","href":"/integrations/agent-artifacts"}]}]},"basePath":"","title":"Exit Codes - hitspec","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":[],"chunks":[]}