### Start Infrahub development environment Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/deploy-manage/install-configure/install/community.mdx Starts and initializes Infrahub for local development using Invoke. Ensure uv and Invoke are installed. ```bash uv run invoke demo.start ``` -------------------------------- ### Start Infrahub Backend Demo Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/development/frontend/getting-set-up.mdx Execute this command to start the Infrahub backend demo environment, including loading necessary schemas and data. Ensure the backend is running before proceeding with frontend setup. ```shell invoke demo.destroy demo.start demo.load-infra-schema demo.load-infra-data ``` -------------------------------- ### Install Neo4j with Helm Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/deploy-manage/install-configure/production-deployment/high-availability.mdx Install multiple instances of Neo4j using Helm for a distributed setup. ```bash helm repo add neo4j https://helm.neo4j.com/neo4j/ helm repo update kubectl create secret generic neo4j-user --namespace infrahub --from-literal=NEO4J_AUTH=neo4j/admin helm install database-0 neo4j/neo4j --version 2025.10.1-4 --namespace infrahub --values neo4j-values.yaml helm install database-1 neo4j/neo4j --version 2025.10.1-4 --namespace infrahub --values neo4j-values.yaml helm install database-2 neo4j/neo4j --version 2025.10.1-4 --namespace infrahub --values neo4j-values.yaml ``` -------------------------------- ### Good Repository Organization Example Source: https://github.com/opsmill/infrahub/blob/stable/dev/guidelines/repository-organization.md An example illustrating a well-organized directory structure with clear separation for guidelines, guides, and skills, including domain-specific and category-specific subdirectories. ```text dev/ ├── guidelines/ │ ├── git-workflow.md # Shared guideline │ ├── markdown.md # Shared guideline │ ├── backend/ │ │ └── python.md # Domain-specific │ └── frontend/ │ └── typescript.md # Domain-specific ├── guides/ │ ├── docs/ │ │ ├── writing-a-guide.md # Category-specific │ │ └── writing-a-topic.md # Category-specific │ └── frontend/ │ ├── writing-unit-tests.md # Domain-specific │ └── writing-component-tests.md # Domain-specific └── skills/ └── neo4j-cypher-guide/ ├── SKILL.md └── references/ ├── deprecated-syntax.md ├── subqueries.md └── qpp.md ``` -------------------------------- ### Initialize Submodules and Install Dependencies Source: https://github.com/opsmill/infrahub/blob/stable/frontend/app/AGENTS.md Run this command first to initialize submodules and install all project dependencies. ```bash cd frontend/app && pnpm setup ``` -------------------------------- ### Start Development Server Source: https://github.com/opsmill/infrahub/blob/stable/dev/specs/ifc-2428-filters/quickstart.md Navigate to the frontend application directory and start the development server using pnpm. ```bash cd frontend/app && pnpm dev ``` -------------------------------- ### Setup Script Execution Source: https://github.com/opsmill/infrahub/blob/stable/dev/skills/speckit-plan/SKILL.md Executes the setup script for the planning phase and parses its JSON output. ```bash .specify/scripts/bash/setup-plan.sh --json ``` -------------------------------- ### Start Infrahub environment (Linux) Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/deploy-manage/install-configure/install/community.mdx Starts the Infrahub environment using Docker Compose on Linux. Requires sudo privileges for Docker Compose. Ensure Docker and Docker Compose are installed. ```bash curl https://infrahub.opsmill.io > docker-compose.yml sudo docker compose -p infrahub up -d ``` -------------------------------- ### Install Dependencies and Run Tests Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/development/git-best-practices.mdx Install project dependencies using uv and execute the test suite and linting/formatting checks. ```bash uv sync --all-groups uv run invoke test uv run invoke lint uv run invoke format uv run invoke backend.test ``` -------------------------------- ### Start Infrahub environment (macOS) Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/deploy-manage/install-configure/install/community.mdx Starts the Infrahub environment using Docker Compose on macOS. Ensure Docker and Docker Compose are installed. ```bash curl https://infrahub.opsmill.io > docker-compose.yml docker compose -p infrahub up -d ``` -------------------------------- ### Example Skill Directory Source: https://github.com/opsmill/infrahub/blob/stable/dev/guidelines/repository-organization.md A concrete example of a skill directory named 'neo4j-cypher-guide', showing its internal file structure. ```text skills/ └── neo4j-cypher-guide/ ├── SKILL.md └── references/ ├── deprecated-syntax.md ├── subqueries.md └── qpp.md ``` -------------------------------- ### Good vs. Bad Guide Writing Example 1 Source: https://github.com/opsmill/infrahub/blob/stable/dev/guides/docs/writing-a-guide.md Demonstrates the use of direct and imperative language for instructions. ```markdown Create a new branch by clicking **New Branch** in the sidebar. A branch can be created by clicking on the New Branch button located in the sidebar. ``` -------------------------------- ### Install Minio with Helm Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/deploy-manage/install-configure/production-deployment/high-availability.mdx Install Minio using Helm, specifying version, namespace, and values file. ```bash helm install objectstore oci://registry-1.docker.io/bitnamicharts/minio --version 15.0.5 --namespace infrahub --create-namespace --values minio-values.yaml ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/development/frontend/getting-set-up.mdx Navigate to the frontend application directory and install all necessary project dependencies using npm. ```shell cd frontend/app npm install ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/opsmill/infrahub/blob/stable/AGENTS.md Installs frontend dependencies using pnpm after navigating to the frontend app directory. ```bash cd frontend/app && pnpm install # Install frontend dependencies ``` -------------------------------- ### Start Local Demo Environment Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/development-resources/local-demo-environment.mdx Use this command to initialize the database and start the Infrahub application in a local Docker Compose environment. ```shell invoke demo.start ``` -------------------------------- ### Good vs. Bad Guide Writing Example 2 Source: https://github.com/opsmill/infrahub/blob/stable/dev/guides/docs/writing-a-guide.md Illustrates the preference for active voice and clear action statements. ```markdown Configure the repository URL in your `.infrahub.yml` file. The repository URL configuration is done in the .infrahub.yml file. ``` -------------------------------- ### Install RabbitMQ with Helm Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/deploy-manage/install-configure/production-deployment/high-availability.mdx Install RabbitMQ using Helm, specifying version, namespace, and values file. ```bash helm install messagequeue oci://registry-1.docker.io/bitnamicharts/rabbitmq --version 14.4.1 --namespace infrahub --create-namespace --values rabbitmq-values.yaml ``` -------------------------------- ### Destroy and Start Development Environment Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/development/docs.mdx Use this command to reset and initialize the development environment for taking screenshots. It ensures a consistent starting point by destroying the existing environment, starting a new one, and loading necessary schema and data. ```shell invoke dev.destroy dev.start dev.load-infra-schema dev.load-infra-data dev.infra-git-import dev.infra-git-create ``` -------------------------------- ### Install CloudNativePG with Helm Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/deploy-manage/install-configure/production-deployment/high-availability.mdx Install CloudNativePG using Helm, specifying version and namespace. ```bash helm repo add cnpg https://cloudnative-pg.github.io/charts helm repo update helm install cnpg cnpg/cloudnative-pg --version 0.23.2 --namespace infrahub --create-namespace ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/opsmill/infrahub/blob/stable/docs/README.md Installs all necessary project dependencies using npm. ```shell npm install ``` -------------------------------- ### Install Infrahub Helm Chart Locally Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/deploy-manage/install-configure/install/community.mdx Installs the Infrahub Helm chart from a local directory using a specified values file. ```bash helm install infrahub -f values.yml path/to/infrahub/chart ``` -------------------------------- ### Example Topic: Branches Source: https://github.com/opsmill/infrahub/blob/stable/dev/guides/docs/writing-a-topic.md An example of a documentation topic explaining the concept of branches in Infrahub, including its purpose, how it works, and a comparison to Git. ```markdown ## Branches A branch in Infrahub represents an isolated workspace where you can make and test infrastructure changes without affecting production. ### Why branches matter Infrastructure changes are risky. A misconfigured device or incorrect IP assignment can cause outages. Branches allow you to validate changes in isolation before applying them to your live infrastructure. ### How branches work Infrahub's branching model is inspired by Git but adapted for graph data. When you create a branch, Infrahub creates a copy-on-write view of the database. Changes made in the branch are tracked separately until you merge them back to the main branch. Unlike Git's file-based approach, Infrahub tracks individual nodes and relationships in the graph database. This granular tracking enables features like: - Partial merges of specific changes - Conflict detection at the data level - Diff views showing exactly what changed ### Comparison to Git If you're familiar with Git, you can think of Infrahub branches similarly: - `main` branch is like Git's main/master branch - Feature branches isolate work in progress - Merging integrates changes back However, Infrahub branches differ in important ways: - They track database entities, not files - They support concurrent reads from multiple branches - They enable data-level conflict resolution ### Related concepts - [Merging and conflicts](./merging.mdx) - How to integrate branch changes - [Proposed changes](./proposed-changes.mdx) - Workflow for reviewing changes ``` -------------------------------- ### Start Local Development Server Source: https://github.com/opsmill/infrahub/blob/stable/docs/README.md Starts a local development server for Infrahub. Changes are reflected live without server restart. ```shell npm start ``` -------------------------------- ### Install infrahub-backup CLI Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/deploy-manage/maintain-upgrade/database-backup/backup-and-restore.mdx Installs the infrahub-backup CLI tool using curl. Ensure you have execute permissions for the downloaded script. ```bash curl https://infrahub.opsmill.io/ops/$(uname -s)/$(uname -m)/infrahub-backup -o infrahub-backup chmod +x infrahub-backup ``` -------------------------------- ### Example Infrahub Schema File Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/reference/schema-validation.mdx An example of an Infrahub schema file with the validation modeline and basic node configuration. This demonstrates how to structure a schema file. ```yaml # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json nodes: - name: Test namespace: Infra ``` -------------------------------- ### Install Neo4j Headless Service with Helm Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/deploy-manage/install-configure/production-deployment/high-availability.mdx Install the Neo4j headless service using Helm, specifying version and values file. ```bash helm install database-service neo4j/neo4j-headless-service --version 2025.10.1-4 --namespace infrahub --values service-values.yaml ``` -------------------------------- ### Topic Structure Example Source: https://github.com/opsmill/infrahub/blob/stable/dev/guides/docs/writing-a-topic.md An example illustrating the recommended structure for explaining an architectural component, including overview, responsibilities, interactions, design decisions, and trade-offs. ```markdown ## GraphQL API Layer The GraphQL API is Infrahub's primary interface for querying and mutating infrastructure data. It provides a strongly-typed, flexible alternative to traditional REST APIs. ### Responsibilities - Query infrastructure data across branches - Execute mutations with validation - Handle real-time subscriptions - Enforce authentication and authorization ### Design decisions Infrahub uses GraphQL because: - **Flexible queries**: Clients request exactly the data they need - **Strong typing**: Schema provides compile-time validation - **Branch awareness**: Queries can target specific branches - **Real-time updates**: Subscriptions enable reactive UIs ### Trade-offs **Benefits:** - Reduced over-fetching and under-fetching - Better developer experience with type safety - Efficient data loading with DataLoader **Limitations:** - More complex than simple REST endpoints - Requires understanding of GraphQL concepts - Caching strategies differ from REST ``` -------------------------------- ### Migrate Dev/Demo Instance (Clean Start) Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/release-notes/infrahub/release-1_3_0.mdx Run these commands to perform a clean migration of a demo instance, which will destroy existing data and rebuild the instance. A warning is provided to back up data before execution. ```shell git switch stable git pull invoke demo.destroy demo.build demo.start demo.load-infra-schema demo.load-infra-data ``` -------------------------------- ### Migrate and Start Demo Instance Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/release-notes/infrahub/release-1_1_0.mdx Commands to migrate the demo instance's database and start it after building. These commands are used in the migration process for development or demo environments. ```shell invoke demo.migrate invoke demo.start ``` -------------------------------- ### Build Documentation Source: https://github.com/opsmill/infrahub/blob/stable/dev/skills/migrate-feature-page/SKILL.md Navigate to the docs directory and run the build command. This is a crucial step after making changes to ensure the documentation is correctly generated. ```bash cd docs && npm run build ``` -------------------------------- ### GET /api/config Response Example Source: https://github.com/opsmill/infrahub/blob/stable/dev/specs/infp-389-branch-merge-delete/contracts/rest-config-response.md This JSON snippet shows the structure of the GET /api/config response, including the newly added 'main.delete_branch_after_merge' field. This field is a boolean indicating whether to delete the branch after a merge. ```json { "main": { "delete_branch_after_merge": false } } ``` -------------------------------- ### Example: Sync Infrastructure-Only Branches Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/git-integration/branch-synchronization.mdx Use this rule to synchronize branches that start with 'infra/'. This is useful for teams that prefix all infrastructure-related branches. ```json ["^infra/.*$"] ``` -------------------------------- ### Correct Examples: Testing Requirements Quality Source: https://github.com/opsmill/infrahub/blob/stable/dev/skills/speckit-checklist/SKILL.md These checklist items correctly focus on the quality and clarity of the requirements themselves, not the implementation. Use these as a guide. ```markdown - [ ] CHK001 - Are the number and layout of featured episodes explicitly specified? [Completeness, Spec §FR-001] - [ ] CHK002 - Are hover state requirements consistently defined for all interactive elements? [Consistency, Spec §FR-003] - [ ] CHK003 - Are navigation requirements clear for all clickable brand elements? [Clarity, Spec §FR-010] - [ ] CHK004 - Is the selection criteria for related episodes documented? [Gap, Spec §FR-005] - [ ] CHK005 - Are loading state requirements defined for asynchronous episode data? [Gap] - [ ] CHK006 - Can "visual hierarchy" requirements be objectively measured? [Measurability, Spec §FR-001] ``` -------------------------------- ### Time Navigation Example Source: https://github.com/opsmill/infrahub/blob/stable/dev/specs/2026-01-file-object.md Demonstrates how time navigation works by querying different versions of a FileObject based on their storage IDs at different points in time. ```text Query FileObject at time T1: → Database returns storage_id = "abc123" (old version) → Storage retrieves file from "abc123" Query same FileObject at time T2: → Database returns storage_id = "xyz789" (new version) → Storage retrieves file from "xyz789" ``` -------------------------------- ### Python SDK Method to Get Diff Summary with Timestamps Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/release-notes/infrahub/release-1_5_0.mdx Retrieve a diff summary by specifying start and end timestamps using the `get_diff_summary` method. ```python from infrahub_sdk.diff import get_diff_summary # Example usage: # summary = get_diff_summary(branch_name="main", start_timestamp="2023-01-01T10:00:00Z", end_timestamp="2023-01-01T12:00:00Z") ``` -------------------------------- ### Telemetry Snapshots List Response (JSON) Source: https://github.com/opsmill/infrahub/blob/stable/dev/specs/infp-471-local-telemetry-storage/contracts/rest-api.md Example JSON response for the GET /api/telemetry/snapshots endpoint, showing a list of telemetry snapshots with their metadata and payload. ```json { "count": 90, "snapshots": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2026-02-16T02:15:00+00:00", "kind": "community", "payload_format": "20250318", "deployment_id": "dep-abc123", "infrahub_version": "1.2.3", "data": { "deployment_id": "dep-abc123", "execution_time": 12.5, "infrahub_version": "1.2.3", "infrahub_type": "community", "python_version": "3.12.0", "platform": "x86_64", "workers": {"total": 4, "active": 3}, "branches": {"total": 5}, "features": {"CoreArtifact": 10, "CoreRepository": 2}, "schema_info": {"node_count": 45, "generic_count": 12, "last_update": "2026-02-15T10:00:00"}, "database": { "database_type": "neo4j-enterprise", "relationship_count": {"total": 50000}, "node_count": {"total": 10000}, "servers": [{"name": "core1", "version": "5.28.0"}], "system_info": {"memory_total": 8589934592, "memory_available": 4294967296, "processor_available": 8} }, "prefect": {"events": {}, "automations": {}, "work_pools": []} }, "checksum": "a1b2c3d4e5f6...", "remote_send_status": "sent" } ] } ``` -------------------------------- ### Build Documentation Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/development/docs.mdx Perform a test build of the documentation to ensure all components are correctly generated and linked before publishing. ```shell invoke docs.build ``` -------------------------------- ### REST API Configuration Response Source: https://github.com/opsmill/infrahub/blob/stable/dev/specs/infp-389-branch-merge-delete/data-model.md Example JSON response from the GET /api/config endpoint, including the new fields for controlling branch deletion behavior. ```json { "main": { "delete_branch_after_merge": false }, "git": { "delete_git_branch_after_merge": false } } ``` -------------------------------- ### Merge a Branch with infrahubctl Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/tutorials/getting-started/branches.mdx Use this command to merge a specified branch using the `infrahubctl` CLI. Ensure you have `infrahubctl` accessible, for example, by starting a shell session with `invoke demo.cli-git`. ```shell infrahubctl branch merge cr1234 ``` -------------------------------- ### InfraHub Server Start Command Options Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/reference/infrahub-cli/infrahub-server.mdx Details the options available for the `infrahub server start` command, including listen address, port, and debug mode. ```console --listen TEXT Address used to listen for new request. [default: 127.0.0.1] ``` ```console --port INTEGER Port used to listen for new request. [default: 8000] ``` ```console --debug / --no-debug Enable advanced logging and troubleshooting [default: no-debug] ``` ```console --help Show this message and exit. ``` -------------------------------- ### Execute Infrahub Upgrade Migrations Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/release-notes/infrahub/release-1_8_0.mdx Run the 'infrahub upgrade' command to start necessary migrations after updating Infrahub. This command must be run from within a container where Infrahub is installed. ```shell docker compose exec infrahub-server infrahub upgrade ``` -------------------------------- ### Build Documentation Source: https://github.com/opsmill/infrahub/blob/stable/AGENTS.md Builds the project's documentation using npm. ```bash cd docs && npm run build # Build documentation ``` -------------------------------- ### Configure GraphQL Fragments and Queries in .infrahub.yml Source: https://github.com/opsmill/infrahub/blob/stable/dev/specs/infp-496-graphql-fragment-inlining/quickstart.md Example configuration file for defining GraphQL fragments and queries, specifying their names and file paths. This setup is used by the infrahub system to manage and process GraphQL operations. ```yaml graphql_fragments: - name: interface_fragments file_path: fragments/interfaces.gql - name: device_fragments file_path: fragments/devices.gql graphql_queries: - name: query_two_files file_path: queries/query_two_files.gql - name: query_no_fragments file_path: queries/query_no_fragments.gql - name: query_transitive file_path: queries/query_transitive.gql - name: query_missing_fragment file_path: queries/query_missing_fragment.gql ``` -------------------------------- ### Install Python dependencies with uv Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/deploy-manage/install-configure/install/community.mdx Installs all Python dependencies for Infrahub using uv. Ensure uv is installed. ```bash uv sync --all-groups ``` -------------------------------- ### Frontend Guidelines Example Structure Source: https://github.com/opsmill/infrahub/blob/stable/dev/documentation-architecture.md Demonstrates the recommended linking structure for frontend documentation, emphasizing index-based navigation and avoiding cross-references between individual guidelines. ```markdown # frontend/app/AGENTS.md - Points to: dev/guidelines/frontend/README.md # dev/guidelines/frontend/README.md (Index) - Lists: typescript.md, url-construction.md - Points to: related knowledge, guides, other dev/ files # dev/guidelines/frontend/typescript.md - Header links back to: README.md - Does NOT link to: url-construction.md (use index instead) # dev/guidelines/frontend/url-construction.md - Header links back to: README.md - Does NOT link to: typescript.md (use index instead) ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/opsmill/infrahub/blob/stable/AGENTS.md Installs all Python dependencies for the project using uv. ```bash uv sync --all-groups # Install Python dependencies ``` -------------------------------- ### Example Menu Structure Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/reference/menu.mdx A complete example of a menu definition file, demonstrating nested menu items with names, labels, icons, and kinds. This structure allows for organizing different sections of the Infrahub interface. ```yaml # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/menu/latest.json --- apiversion: infrahub.app/v1 kind: Menu spec: data: - namespace: Location name: Mainmenu label: Location icon: "mingcute:location-line" children: data: - namespace: Location name: Country label: Countries kind: LocationCountry icon: "gis:search-country" - namespace: Location name: Site label: Sites kind: LocationSite icon: "ri:building-line" - namespace: Infrastructure name: Mainmenu label: Infrastructure icon: "mdi:domain" children: data: - namespace: Network name: Device label: Devices kind: NetworkDevice icon: "mdi:router" - namespace: Network name: Interface label: Interface kind: NetworkInterface icon: "mdi:ethernet" ``` -------------------------------- ### Phase 1 Parallel Execution Example Source: https://github.com/opsmill/infrahub/blob/stable/dev/specs/infp-496-graphql-fragment-inlining/tasks.md Demonstrates running tasks T002 and T003 in parallel after T001 is complete. These tasks involve creating fragment and query files for testing. ```bash # Run in parallel after T001: Task T002: Create fragment files in python_sdk/tests/fixtures/repos/fragment_inlining/fragments/ Task T003: Create query files in python_sdk/tests/fixtures/repos/fragment_inlining/queries/ ``` -------------------------------- ### Install Neo4j Headless Service Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/deploy-manage/install-configure/production-deployment/high-availability.mdx Install the Neo4j headless service to manage the Neo4j cluster. ```yaml headlessService: enabled: true service: type: ClusterIP port: 7687 ``` -------------------------------- ### Load Sample Topology Data Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/tutorials/getting-started/schema.mdx Execute this command to load a sample topology of 6 devices into Infrahub, populating the database with data that utilizes the new schema models. ```shell invoke demo.load-infra-data ``` -------------------------------- ### Production Build Source: https://github.com/opsmill/infrahub/blob/stable/frontend/app/AGENTS.md Creates a production-ready build of the frontend application. ```bash cd frontend/app && pnpm build ``` -------------------------------- ### Run Full Test Suite Source: https://github.com/opsmill/infrahub/blob/stable/dev/wip/ifc-2184/phase-6.md Execute the complete unit and integration tests for the backend. Requires `uv` and `invoke` to be installed. ```bash uv run invoke backend.test-unit uv run invoke backend.test-integration ``` -------------------------------- ### Install Redis with Helm Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/deploy-manage/install-configure/production-deployment/high-availability.mdx Install Redis using Helm, specifying version, namespace, and values file. ```bash helm repo add bitnami https://charts.bitnami.com/bitnami helm repo update helm install cache bitnami/redis --version 19.5.2 --namespace infrahub --create-namespace --values redis-values.yaml ``` -------------------------------- ### Setting Up Symlinks Source: https://github.com/opsmill/infrahub/blob/stable/dev/guidelines/repository-organization.md Commands to remove old directories and create new symlinks to the canonical source directories for tool compatibility. ```bash # Remove old directories if they exist rm -rf .claude/commands .claude/skills # Create tool directories mkdir -p .claude # Create symlinks to canonical source ln -s ../dev/commands .claude/commands ``` -------------------------------- ### Migrate Dev/Demo Instance (Preserve Data) Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/release-notes/infrahub/release-1_3_0.mdx Use these invoke commands to stop, pull, migrate, and start a demo instance while preserving existing data. Similar commands exist for the dev environment. ```shell git switch stable git pull invoke demo.stop invoke demo.pull invoke demo.migrate invoke demo.start ``` -------------------------------- ### Serving Documentation Locally Source: https://github.com/opsmill/infrahub/blob/stable/dev/guides/docs/writing-a-guide.md Command to serve the documentation locally for human verification. ```bash uv run invoke docs.serve ``` -------------------------------- ### Related Object Schema Example Source: https://github.com/opsmill/infrahub/blob/stable/dev/specs/2026-01-file-object.md Example showing how a 'Circuit' object can have a relationship to a 'NetworkCircuitContract' file object. ```yaml - name: Circuit namespace: Network attributes: - name: circuit_id kind: Text optional: false relationships: - name: contracts peer: NetworkCircuitContract kind: Generic cardinality: many optional: true ``` -------------------------------- ### Building Documentation Source: https://github.com/opsmill/infrahub/blob/stable/dev/guides/docs/writing-a-guide.md Command to build the documentation to verify changes. ```bash uv run invoke docs.build ``` -------------------------------- ### Global Check Output Example Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/academy/tutorials/build-a-check.mdx Example output when a global check runs and identifies an invalid tag name. ```shell INFO HTTP Request: POST http://localhost:8000/graphql/create-tag-check "HTTP/1.1 200 OK" ERROR tags_check::ColorTagsCheck: FAILED ERROR Invalid tag name: blue. Tag names must follow pattern 'color-[name]' ``` -------------------------------- ### GraphQL Query Response Example Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/academy/tutorials/generators/build-your-first-generator.mdx This is an example of a successful response from the GraphQL query, showing the retrieved data for a widget. ```json { "data": { "TestWidget": { "edges": [ { "node": { "__typename": "TestWidget", "id": "185526eb-2114-ce20-390a-c51aac78460a", "name": { "value": "widget1" }, "count": { "value": 1 } } } ] } } } ``` -------------------------------- ### GraphQL Query: Non-IP Search Example Source: https://github.com/opsmill/infrahub/blob/stable/dev/specs/infp-431-ipam-closest-prefix/contracts/graphql-schema.md Example query for a non-IP/CIDR string to demonstrate the `parent_prefixes` field being null. ```graphql query { InfrahubSearchAnywhere(q: "router-core-01", limit: 4) { count edges { node { id kind } } parent_prefixes { node { id kind } } } } ``` -------------------------------- ### Full QPP Syntax with Node Reference Source: https://github.com/opsmill/infrahub/blob/stable/dev/skills/neo4j-cypher-guide/references/qpp.md Demonstrates the full QPP syntax, including referencing and filtering nodes and relationships within the path pattern. ```cypher // Basic QPP with node reference MATCH (start:Station) ((n)-[r:CONNECTED]->(m) WHERE r.distance < 10){1,5} (end:Station) RETURN start, end, [x IN n | x.name] AS stops ``` -------------------------------- ### Start Infrahub Server Source: https://github.com/opsmill/infrahub/blob/stable/docs/docs/development/backend.mdx Starts the Infrahub backend server in debug mode, enabling hot-reloading on code changes. ```shell infrahub server start --debug ```