# hitspec > 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. - [hitspec — Plain text API tests. No magic.](https://hitspec.dev/introduction.md): hitspec is a file-based HTTP API testing tool — write .http tests that look like real HTTP requests, assert, capture, chain, and load-test. No SDK, no GUI. - [Install hitspec — Homebrew, Go, and binary](https://hitspec.dev/installation.md): Install hitspec on macOS, Linux, or Windows via Homebrew, go install, a pre-built binary, or build from source. Get the hitspec CLI running in minutes. - [Write and run your first API test in under a minute](https://hitspec.dev/quickstart.md): Write a plain-text .http file with requests, assertions, and captures, then run it with hitspec. A fast first API test you can read, diff, and commit. - [hitspec studio — a keyboard-first terminal API client](https://hitspec.dev/studio.md): hitspec studio is a keyboard-first terminal UI for .http files — edit, run, and inspect requests with a tabbed viewer, plus stress, mock, record, and history. - [hitspec Studio desktop — a native GUI for .http files](https://hitspec.dev/desktop.md): hitspec Studio is the Electron desktop client for hitspec: file tree, source editor, tabbed response viewer, history, stress, mock, record and imports over your existing .http files. - [Editor Setup](https://hitspec.dev/editor-setup.md): Configure syntax highlighting, snippets, and shell completions for hitspec. - [The .http file format for API tests](https://hitspec.dev/concepts/file-format.md): Anatomy of a hitspec .http file: requests, headers, bodies, variables, assertions, captures, dependencies, and directives — plain text you can diff and commit. - [Variables](https://hitspec.dev/concepts/variables.md): Define variables, use built-in functions, reference environment values, and interpolate captured data. - [Variable Interpolation](https://hitspec.dev/concepts/variable-interpolation.md): Deep-dive into hitspec's {{var}} syntax, $env() references, capture chains, and resolution order. - [Assertions](https://hitspec.dev/concepts/assertions.md): Validate HTTP responses with 26 assertion operators covering equality, strings, types, arrays, schemas, and snapshots. - [Captures](https://hitspec.dev/concepts/captures.md): Extract values from HTTP responses and use them in subsequent requests. - [Dependencies](https://hitspec.dev/concepts/dependencies.md): Control execution order with @depends, topological sorting, and request chaining. - [Environments](https://hitspec.dev/concepts/environments.md): Configure variables for dev, staging, and production with hitspec.yaml, .env files, and system variables. - [Authentication for API tests (@auth)](https://hitspec.dev/features/authentication.md): Configure authentication for API requests with the @auth directive. hitspec supports 8 auth methods: Bearer, Basic, API Key, Digest, AWS Sig v4, and OAuth2. - [Multipart and GraphQL](https://hitspec.dev/features/multipart-graphql.md): Send multipart form data with file uploads and execute GraphQL queries using dedicated block syntax. - [Snapshot testing for API responses](https://hitspec.dev/features/snapshot-testing.md): Capture API response bodies as baselines and automatically detect regressions with snapshot comparison. Update baselines on purposeful changes. - [Load and stress test APIs with hitspec](https://hitspec.dev/features/stress-testing.md): Load test APIs with hitspec — configurable rate, virtual users, ramp-up, and pass/fail thresholds. No separate tool; export metrics to Prometheus or Datadog. - [Database assertions after HTTP requests](https://hitspec.dev/features/database-assertions.md): Verify database state after HTTP requests with SQL queries and assertions. Use >>>db blocks to check side effects in PostgreSQL, MySQL, and SQLite. - [Shell Commands](https://hitspec.dev/features/shell-commands.md): Run shell commands after HTTP requests for post-processing, notifications, and custom validation. - [Hooks](https://hitspec.dev/features/hooks.md): Run setup and teardown scripts before and after HTTP requests using @before and @after annotations. - [Server-Sent Events (SSE)](https://hitspec.dev/features/sse.md): Test Server-Sent Events endpoints with hitspec. - [API Coverage](https://hitspec.dev/features/api-coverage.md): Measure how much of your API is covered by tests using OpenAPI spec comparison and coverage reports. - [Mock server from .http files](https://hitspec.dev/features/mock-server.md): Start a mock HTTP server from your .http test files for frontend development and integration testing — no separate mock tool or fixtures to maintain. - [Contract Testing](https://hitspec.dev/features/contract-testing.md): Verify API contracts against live providers with hitspec's built-in contract testing support. - [Recording Proxy](https://hitspec.dev/features/recording-proxy.md): Capture HTTP traffic and auto-generate hitspec test files using the recording proxy. - [Watch Mode](https://hitspec.dev/features/watch-mode.md): Automatically re-run tests when files change during development. - [Parallel Execution](https://hitspec.dev/features/parallel-execution.md): Run independent API tests concurrently for faster test suites. - [Notifications](https://hitspec.dev/features/notifications.md): Send test results to Slack and Microsoft Teams via webhooks. - [Metrics Export](https://hitspec.dev/features/metrics-export.md): Export test metrics to Prometheus, DataDog, or JSON for monitoring and dashboards. - [hitspec studio](https://hitspec.dev/guides/api-client-manager.md): Use the interactive terminal app to build, run, and debug HTTP requests - [CI/CD Pipeline Integration](https://hitspec.dev/guides/ci-cd-pipeline.md): Set up hitspec in GitHub Actions, GitLab CI, and other CI/CD systems. - [Regression Testing with hitspec diff](https://hitspec.dev/guides/regression-testing.md): Compare test runs to detect performance regressions and behavior changes. - [Database Testing Guide](https://hitspec.dev/guides/database-testing.md): Use database assertions to verify side effects of API calls against PostgreSQL, MySQL, and SQLite. - [Load Testing Guide](https://hitspec.dev/guides/load-testing.md): Run stress tests with hitspec to validate API performance under load. - [Contract Testing Guide](https://hitspec.dev/guides/contract-testing.md): Step-by-step guide to consumer-driven contract testing with hitspec. - [Migrate from Postman to hitspec .http tests](https://hitspec.dev/guides/migrating-from-postman.md): Import Postman collections into hitspec and convert them to plain-text .http files. Covers the import process and the key differences from Postman. - [Troubleshooting](https://hitspec.dev/guides/troubleshooting.md): Common issues and how to resolve them - [Basic CRUD](https://hitspec.dev/examples/basic-crud.md): Walk through a complete CRUD test file that covers GET, POST, PUT, and DELETE operations against a REST API. - [Auth Flow](https://hitspec.dev/examples/auth-flow.md): Login to get a token, capture it, and use it in authenticated requests with @auth bearer and @depends. - [GraphQL](https://hitspec.dev/examples/graphql.md): Query a GraphQL API with variables, test nested response fields, and chain mutations with captures. - [CI/CD Integration](https://hitspec.dev/examples/ci-cd.md): Run hitspec tests in GitHub Actions with JUnit output, environment variables, and pass/fail exit codes. - [Stress Testing](https://hitspec.dev/examples/stress-testing.md): Load test your APIs with configurable rate, virtual users, ramp-up phases, and pass/fail thresholds. - [Database Assertions](https://hitspec.dev/examples/database-assertions.md): Example: Verify API side effects with database queries. - [Contract Testing](https://hitspec.dev/examples/contract-testing.md): Example: Define and verify API contracts between services. - [Mock Server](https://hitspec.dev/examples/mock-server.md): Example: Generate mock servers from your hitspec test files. - [hitspec run](https://hitspec.dev/reference/run.md): Run HTTP API tests from .http and .hitspec files - [hitspec validate & list](https://hitspec.dev/reference/validate-list.md): Validate syntax and list requests in hitspec files - [hitspec init](https://hitspec.dev/reference/init.md): Initialize a new hitspec project with a config file and example test. - [hitspec import & export](https://hitspec.dev/reference/import-export.md): Import from OpenAPI, Postman, curl, and Insomnia; export to curl - [hitspec mock & record](https://hitspec.dev/reference/mock-record.md): Start a mock HTTP server or recording proxy from hitspec files - [hitspec contract & diff](https://hitspec.dev/reference/contract-diff.md): Contract testing against live providers and comparing test results - [hitspec docs, studio & serve](https://hitspec.dev/reference/docs-serve.md): Reference for the docs command, the interactive studio app, and the REST/WebSocket API server. - [Fetch responses](https://hitspec.dev/reference/fetch.md): Fetch one HTTP response as raw bytes, readable text, Markdown, or JSON - [MCP client and server](https://hitspec.dev/reference/mcp.md): Probe and call MCP servers, or expose Hitspec tools over stdio - [REST API](https://hitspec.dev/reference/rest-api.md): Complete reference for the hitspec server HTTP API - [hitspec completion](https://hitspec.dev/reference/completion.md): Generate shell completion scripts for bash, zsh, fish, and PowerShell. - [hitspec version](https://hitspec.dev/reference/version.md): Print the installed hitspec version and build information. - [Exit Codes](https://hitspec.dev/reference/exit-codes.md): Reference for all hitspec CLI exit codes for use in scripts and CI/CD pipelines. - [Configuration Reference](https://hitspec.dev/reference/configuration.md): Complete reference for hitspec.yaml configuration file options with defaults and examples. - [Environment Variables](https://hitspec.dev/reference/environment-variables.md): Complete list of HITSPEC_* environment variables for configuring hitspec without flags. - [Assertion Operators](https://hitspec.dev/reference/assertion-operators.md): Complete reference for all 26 assertion operators in hitspec, with syntax and examples for each. - [Assertion Subjects](https://hitspec.dev/reference/assertion-subjects.md): Reference for all assertion subjects: status, duration, headers, body paths, and percentiles. - [Built-in Functions](https://hitspec.dev/reference/builtin-functions.md): Reference for all 17 built-in functions available in hitspec variable interpolation. - [Authentication Types](https://hitspec.dev/reference/auth-types.md): Reference for all 8 authentication methods supported by hitspec's @auth directive. - [Output Formats](https://hitspec.dev/reference/output-formats.md): Reference for all 5 output formats supported by hitspec: console, JSON, JUnit XML, TAP, and HTML. - [GitHub Actions](https://hitspec.dev/integrations/github-actions.md): Run hitspec API tests in your GitHub Actions CI/CD pipeline with JUnit reporting, caching, and matrix testing. - [Output Formats](https://hitspec.dev/integrations/output-formats.md): hitspec supports five output formats: console, JSON, JUnit XML, TAP, and HTML. Choose the right format for your workflow. - [Prometheus](https://hitspec.dev/integrations/prometheus.md): Export hitspec stress test metrics to Prometheus for monitoring dashboards. - [DataDog](https://hitspec.dev/integrations/datadog.md): Send hitspec stress test metrics directly to DataDog for monitoring. - [Slack & Teams Notifications](https://hitspec.dev/integrations/slack-teams.md): Send hitspec test results to Slack and Microsoft Teams via webhooks. - [Agent artifact workflow](https://hitspec.dev/integrations/agent-artifacts.md): Compose Hitspec with file.cheap, MCPHub, Local Agent, and an external tvault boundary ## Optional - [GitHub](https://github.com/abdul-hamid-achik/hitspec) This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.