The first public SDK release is TypeScript. Python and Go SDKs will follow.
Install
fetch.
Authenticate
Create an API token in Anyshift, then pass it with the project you want to query:https://graph.anyshift.io.
Resolve a Resource
Usegraph.resolve() to find current resources matching a name or fragment before running a resource-scoped helper. Results are ranked deterministically and include enough identity context to distinguish resources with similar names.
id, anyshiftID, name, type, namespace, and cluster. After selecting a candidate, pass its exact name to helpers such as graph.connections(), graph.path(), or graph.blast().
For interactive terminal discovery, use annie graph explore.
Query the Graph
Use typed helpers for common graph questions:Render Topology
Topology queries return graph nodes and edges. Convert them to Mermaid when you want to embed a diagram in a report, pull request, runbook, or incident update:level: "dynamic" to render a sequence diagram. Other topology levels render as flowcharts.
Raw SQL
For advanced use cases, call the Graph API query endpoint directly with Anyshift graph SQL:Capabilities
The SDK covers dependency analysis, operational timelines, topology diagrams, Kubernetes safety, security exposure, observability gaps, service dependencies, and GitOps ownership. See Graph SDK Capabilities for the developer-oriented overview, the Graph Query Language reference for raw query syntax, or the canonicalCAPABILITIES.md matrix in GitHub for every helper, intent, parameter family, and output category.
Error Handling
The SDK throws typed errors for authentication, bad queries, and unexpected API responses:Examples and Source
The SDK source, examples, and OpenAPI contract are available in the public GitHub repository:anyshift-io/anyshift-graph-sdk.
To add the same infrastructure context to a software catalog without building a custom interface, use the Backstage integration.
Troubleshooting
Project not found or no graph data
Project not found or no graph data
Check that
ANYSHIFT_PROJECT_ID points to the project you intend to query and that the project has completed ingestion.The query returns no rows
The query returns no rows
Start with a broader helper such as
graph.events({ since: "24h" }) or graph.connections({ resource: "<service-name>" }), then narrow the query once you confirm the exact service or resource name.