# Stategraph > Stategraph is a database for your infrastructure. Plans run on the affected graph. Velocity, orchestration, security, compliance, cost, and inventory flow from one data model. Every documentation page is also available as Markdown by appending `.md` to its URL (e.g. `/docs/cli/transactions.md`). ## Documentation - [Documentation overview](https://stategraph.com/docs.md) ## Get started - [Introduction](https://stategraph.com/docs/getting-started/introduction.md): Stategraph is graph-based state management for Terraform and OpenTofu. Learn what it is, how it works, and what you can do with it. - [Core concepts](https://stategraph.com/docs/getting-started/concepts.md): The core Stategraph concepts — state graph, states, groups, tenants, transactions, blast radius, and resource-level locking — in one place. - [Quickstart](https://stategraph.com/docs/getting-started/quickstart.md): Install the Stategraph CLI, connect to a server, import an existing Terraform state, and explore your infrastructure in about ten minutes. ## Velocity - [Introduction](https://stategraph.com/docs/velocity.md): Parallel plan and apply for Terraform and OpenTofu. Graph-aware execution with resource-level locking and multi-state transaction support. - [Setup](https://stategraph.com/docs/velocity/setup.md): Set up Stategraph Velocity for parallel Terraform execution. Import existing state, configure your project, and start using parallel plan and apply. - [Transactions](https://stategraph.com/docs/velocity/transactions.md): The Velocity transaction lifecycle for Terraform plan and apply: create a transaction, preview changes, check for conflicts, and commit updates. - [Resource-Level Locking](https://stategraph.com/docs/velocity/resource-locking.md): How Velocity uses resource-level conflict detection instead of state-level locks, enabling concurrent operations on the same Terraform state. - [Multi-State Operations](https://stategraph.com/docs/velocity/multi-state.md): How Velocity coordinates plan and apply across multiple Terraform states in a single transaction with cross-state dependency resolution. ## Insights - [Introduction](https://stategraph.com/docs/insights.md): Analysis and exploration tools for your Terraform infrastructure: timeline, search, blast radius, graph visualization, and dependency tracking. - [Timeline](https://stategraph.com/docs/insights/timeline.md): Track transaction history and changes to your Terraform state. Visual timeline of all infrastructure modifications with detailed change tracking. - [Search](https://stategraph.com/docs/insights/search.md): Find and filter resource instances across all your states by type, module, provider, address, and attribute values from the Insights view. - [Blast Radius Analysis](https://stategraph.com/docs/insights/blast-radius.md): Understand the impact of changing resources before making modifications. Analyze dependencies and blast radius to prevent unexpected failures. - [Graph Explorer](https://stategraph.com/docs/insights/graph-explorer.md): Visualize resource dependencies in your Terraform state. Root-centric graph exploration with dependency tracing and blast-radius links. - [Dashboard Metrics](https://stategraph.com/docs/insights/dashboard-metrics.md): Reference for every metric on the Infrastructure Overview dashboard. Detailed explanations of resource counts, state health, and infrastructure statistics. ## Inventory - [Introduction](https://stategraph.com/docs/inventory.md): Infrastructure catalog and CMDB for your Terraform resources. Browse instances, modules, types, run SQL queries, and build custom dashboards. - [Instances](https://stategraph.com/docs/inventory/instances.md): Browse all resource instances across your Terraform states. Search, filter, and inspect detailed resource attributes and metadata. - [Modules](https://stategraph.com/docs/inventory/modules.md): Browse Terraform modules and their resources. View module usage across states, inspect module configurations, and track dependencies. - [Resource Types](https://stategraph.com/docs/inventory/resource-types.md): View resources grouped by type across all states. Browse by provider, filter by category, and access instances of any resource type. - [Query (SQL)](https://stategraph.com/docs/inventory/query.md): Query Terraform infrastructure with SQL. Filter resources by attributes, aggregate counts, and analyze configurations across all states. - [Dashboards](https://stategraph.com/docs/inventory/dashboards.md): Create and save custom views of your infrastructure. Build personalized dashboards with filters, queries, and saved searches for quick access. - [Gap Analysis](https://stategraph.com/docs/inventory/gap-analysis.md): Find cloud resources that aren't managed by Terraform. Discover unmanaged infrastructure, identify drift, and bring it under management. ## Cost Analysis - [Introduction](https://stategraph.com/docs/cost.md): Estimate what your Terraform-managed infrastructure costs — per resource, state, and tenant — with attribution, history, and SQL access. - [Setup](https://stategraph.com/docs/cost/setup.md): Enable Stategraph cost analysis durably on any deployment — turn on the in-image pricing service and let it load and refresh the cloud price book itself. - [State & Resource Cost](https://stategraph.com/docs/cost/state-cost.md): Price a single Terraform state, read the per-resource and per-component cost breakdown, refresh estimates, and inspect coverage gaps. - [Plan-Time Cost](https://stategraph.com/docs/cost/plan-time.md): Preview the cost impact of a Terraform change before you apply it — Stategraph shows a current-vs-planned cost delta inline in stategraph tf plan. - [Cost Attribution](https://stategraph.com/docs/cost/attribution.md): Roll up cost across every managed state, attribute spend by tag (team, environment, owner), and track cost trends over time. - [Querying Cost Data](https://stategraph.com/docs/cost/queries.md): Query Stategraph cost snapshots with SQL — rank resources by cost, break spend down by type or tag, and find coverage gaps. - [Cloud Billing (FOCUS)](https://stategraph.com/docs/cost/billing-sources.md): Ingest your actual cloud spend into Stategraph by connecting a FOCUS billing export from AWS, GCP, or Azure. - [Cost in the Console](https://stategraph.com/docs/cost/console.md): Explore Stategraph cost in the console: per-state cost views, tenant cost aggregation over time, and the Billing Connections page. ## Orchestration - [Introduction](https://stategraph.com/docs/orchestration.md): GitOps for Terraform with PR-based automation, policy enforcement, and drift detection. Automated plans, approvals, and infrastructure delivery. ## AI Agents - [Introduction](https://stategraph.com/docs/ai-agents.md): Drive Stategraph from an LLM. Six SKILL.md files cover query, change, import, refactor, cost, plus a router that dispatches automatically. ## Deployment - [Introduction](https://stategraph.com/docs/deployment.md): Deploy Stategraph using Docker Compose, Kubernetes, AWS ECS, or Google Cloud Run. Choose the deployment method that fits your infrastructure and team size. - [Hosted (Stategraph Cloud)](https://stategraph.com/docs/deployment/hosted.md): Use Stategraph Cloud, the fully managed hosted service. Start a free trial, create an API key, and point the CLI at your hosted instance. - [Docker Compose](https://stategraph.com/docs/deployment/docker-compose.md): Deploy Stategraph using Docker Compose for development and small teams. Quick setup with PostgreSQL and optional authentication configuration. - [Kubernetes](https://stategraph.com/docs/deployment/kubernetes.md): Deploy Stategraph on Kubernetes using the official Helm chart. Complete installation guide with PostgreSQL, ingress, and authentication setup. - [Amazon ECS](https://stategraph.com/docs/deployment/ecs.md): Deploy Stategraph on AWS ECS with Fargate using Terraform. Production-ready setup with RDS PostgreSQL, ALB, and VPC configuration. - [Google Cloud Run](https://stategraph.com/docs/deployment/cloud-run.md): Deploy Stategraph on Google Cloud Run with a managed Cloud SQL PostgreSQL backend, a Cloud SQL Auth Proxy sidecar, and Secret Manager. ## Authentication - [Introduction](https://stategraph.com/docs/authentication.md): Configure authentication for Stategraph using OAuth providers. Support for Google OAuth, generic OIDC, and local email/password authentication. - [Local Authentication](https://stategraph.com/docs/authentication/local-authentication.md): Email and password authentication with user management for Stategraph. Production-ready auth without external OAuth dependencies. - [Google OAuth Setup](https://stategraph.com/docs/authentication/google-oauth.md): Configure Google OAuth for Stategraph authentication. Complete setup guide for Google Workspace integration and user SSO. - [OIDC Configuration](https://stategraph.com/docs/authentication/oidc.md): Configure generic OIDC providers for Stategraph authentication. Compatible with Okta, Auth0, Keycloak, and any OpenID Connect provider. - [Access Tokens & Capabilities](https://stategraph.com/docs/authentication/access-tokens.md): Create capability-scoped Stategraph access tokens from the CLI to grant least-privilege admin, commit, preview, and user-management rights. ## CLI - [Introduction](https://stategraph.com/docs/cli.md): Command-line interface for Stategraph. Manage states, run queries, execute gap analysis, and automate infrastructure operations from the terminal. - [User Commands](https://stategraph.com/docs/cli/user.md): CLI commands for managing user identity and tenant membership. View and manage your Stategraph user profile and organizational access. - [States Commands](https://stategraph.com/docs/cli/states.md): CLI commands for managing Terraform states in Stategraph. List, inspect, and query state files from the command line interface. - [Transactions Commands](https://stategraph.com/docs/cli/transactions.md): CLI commands for managing Stategraph transactions. Track infrastructure changes, view audit trails, and inspect transaction history. - [SQL Commands](https://stategraph.com/docs/cli/sql.md): CLI commands for querying infrastructure with SQL. Execute Structured Query Language queries against your Terraform resources from the terminal. - [Tenant Commands](https://stategraph.com/docs/cli/tenant.md): CLI commands for tenant management and gap analysis. Find unmanaged cloud resources and identify infrastructure drift from the command line. - [Terraform Commands](https://stategraph.com/docs/cli/tf.md): CLI reference for stategraph tf plan, apply, show, and mtx. Plan and apply Terraform changes through Stategraph with plan files and cost previews. - [Refactor](https://stategraph.com/docs/cli/refactor.md): Detect HCL refactors — resource renames and module moves — across plan steps and emit Terraform moved blocks, via a session-based CLI workflow. - [Import Commands](https://stategraph.com/docs/cli/import.md): CLI reference for stategraph import tf. Onboard an existing Terraform state file and its HCL configuration into Stategraph in one step. - [HCL Commands](https://stategraph.com/docs/cli/hcl.md): CLI commands for working with HCL. List resource addresses, evaluate expressions, convert between HCL and JSON, and import HCL into a state. - [Cost Commands](https://stategraph.com/docs/cli/cost.md): CLI commands for Stategraph cost intelligence: manage FOCUS billing sources and query state, tenant, attribution, history, and coverage data. - [Config Commands](https://stategraph.com/docs/cli/config.md): CLI commands for managing stategraph.json. Attach external data file globs to resource addresses per workspace for change detection. - [Utility Commands](https://stategraph.com/docs/cli/utilities.md): CLI utility commands for Stategraph. Get oriented with stategraph info and check client and server versions from the command line. - [Diagnostics](https://stategraph.com/docs/cli/diagnostics.md): Run stategraph diagnostics to trace how Stategraph evaluates your Terraform HCL locally, then send us the output so we can understand your setup. ## Reference - [Introduction](https://stategraph.com/docs/reference.md): Complete reference documentation for Stategraph configuration, environment variables, API endpoints, SQL syntax, and health checks. - [API Reference](https://stategraph.com/docs/reference/api.md): Complete REST API reference for Stategraph. Programmatic access to states, queries, transactions, and infrastructure management operations. - [Architecture](https://stategraph.com/docs/reference/architecture.md): Stategraph architecture overview. How the local CLI, the coordinating Server, and your cloud interact to plan and apply Terraform changes. - [Environment Variables](https://stategraph.com/docs/reference/environment-variables.md): Complete reference of all Stategraph configuration options. Database, authentication, storage, and feature flag environment variables. - [Health Checks](https://stategraph.com/docs/reference/health-checks.md): Configuring liveness and readiness probes for load balancers and container orchestrators. Health endpoints for Kubernetes, ECS, and other platforms. - [SQL Syntax Reference](https://stategraph.com/docs/reference/sql-syntax.md): Complete grammar reference for the SQL query language. Syntax, operators, functions, and query patterns for infrastructure exploration. - [Releases & Downloads](https://stategraph.com/docs/reference/releases.md): Download Stategraph server and CLI binaries. Latest releases, version history, and installation instructions for all platforms. - [Glossary](https://stategraph.com/docs/reference/glossary.md): Definitions of key Stategraph terms and how they map to Terraform concepts. State, tenant, transaction, workspace, and infrastructure terminology. - [Terraform CLI Compatibility](https://stategraph.com/docs/reference/terraform-compatibility.md): How Terraform CLI commands and HCL constructs map to Stategraph — what works directly, what the transaction model subsumes, and what has no analog. - [Troubleshooting](https://stategraph.com/docs/reference/troubleshooting.md): Common issues and solutions for Stategraph. Deployment problems, database errors, authentication issues, and performance troubleshooting.