Go wrapper for SimConnect.dll — build Microsoft Flight Simulator 2020/2024 add-ons with type-safe, zero-dependency Go code.
- Full SimConnect DLL binding via syscalls — zero CGo, Windows-only
- Typed message stream via Go channels with callback handlers
- Manual and pre-built dataset definitions across 6 domains (aircraft, environment, facilities, objects, simulator, traffic)
- AI traffic management — create, remove, and control parked, enroute, and non-ATC aircraft with livery selection
- Facility data queries — airports, runways, parking, frequencies, VOR, NDB, waypoints, jetways, helipads, and 14 facility types total
- SimConnect.dll auto-detection via environment variables, SDK paths, and common installation locations
- Automatic connection lifecycle with reconnection and health monitoring
- 60+ SimVar state tracking via SimState — camera, position, speed, weather, VR, environment, realism settings
- Channel-based and callback-based subscriptions with message type filtering
- 12 typed system event handlers — Pause, Sim, Crashed, CrashReset, Sound, View, FlightLoaded, AircraftLoaded, FlightPlanActivated, FlightPlanDeactivated, ObjectAdded, ObjectRemoved
- Great-circle distance (haversine), altitude/distance/speed conversions, ICAO validation, WGS84 coordinate offsets
- Tiered buffer pooling and pre-allocated handler buffers for zero-allocation dispatching
Zero external dependencies — standard library only.
package main
import (
"github.com/mrlm-net/simconnect"
)
func main() {
client := simconnect.NewClient("MyApp", simconnect.ClientWithHeartbeat(simconnect.HEARTBEAT_6HZ))
if err := client.Connect(); err != nil {
panic(err)
}
defer client.Disconnect()
// … interact with the simulator
}All examples include standalone main packages with individual READMEs. Browse the examples folder or run any example directly:
go run ./examples/<name>- Getting Started — basic-connection, await-connection, lifecycle-connection
- Manager Interface — simconnect-manager, simconnect-subscribe, simconnect-state, simconnect-events
- Data Operations — read-messages, read-objects, set-variables, emit-events, subscribe-events, using-datasets
- Facilities & Navigation — subscribe-facilities, read-facility, read-facilities, read-waypoints, all-facilities, airport-details, locate-airport, simconnect-facilities
- AI Traffic — ai-traffic, manage-traffic, monitor-traffic, simconnect-traffic
- Performance — simconnect-benchmark
simvar-cli is a Windows command-line tool for reading, writing, and streaming MSFS SimVars directly from a terminal. It connects to a running simulator via SimConnect and supports JSON, CSV, and table output formats.
# Build from source
cd cmd/simvar-cli
go build -o simvar-cli.exe .
# Read a SimVar
simvar-cli get "PLANE ALTITUDE" feet float64
# Stream continuously as NDJSON
simvar-cli --format json watch "PLANE ALTITUDE" feet float64
# Interactive REPL
simvar-cli replSee cmd/simvar-cli for the full README and docs/simvar-cli.md for the complete reference.
simconnect.mrlm.net — Full documentation website with getting started guide, configuration reference, and usage guides.
- Client Configuration — Engine/Client functional options
- Client API Reference — Complete Engine/Client API
- Manager Configuration — Manager functional options
- Manager Usage — Lifecycle management, subscriptions, state handling
- Request ID Management — ID allocation strategy and conflict prevention
- Event Lifecycle — Event lifecycle reference
simconnect— Main entry point —New()for managed connection,NewClient()for direct engine accesspkg/engine— High-level client, session lifecycle, message dispatchingpkg/manager— Connection manager with auto-reconnect and state trackingpkg/types— Typed data structures, enums, eventspkg/datasets— Pre-built dataset definitions (aircraft, environment, facilities, objects, simulator, traffic)pkg/convert— Unit conversions, ICAO validation, WGS84 coordinate offsetspkg/calc— Calculation helpers (haversine great-circle distance)pkg/registry— Cross-platform typed SimVar metadata catalogue (104 entries, no build tags)cmd/simvar-cli— Interactive CLI tool for reading, writing, and streaming SimVars
go get github.com/mrlm-net/simconnect| Requirement | Version |
|---|---|
| Go | 1.25+ |
| Operating system | Windows |
| Microsoft Flight Simulator | 2020 / 2024 |
| SimConnect SDK | Bundled with MSFS |
Contributions are welcomed and must follow the Code of Conduct and common Contribution guidelines.
If you'd like to report a security issue please follow the security guidelines.
This library is developed and maintained in personal time. Sponsorship helps cover the direct costs of keeping it accurate and active:
- MSFS 2024 license — required to test against the current simulator version
- Windows development environment — the only supported platform; ongoing hardware and OS costs
- Documentation hosting — simconnect.mrlm.net is served from a paid static hosting account
- Development time — research against undocumented SimConnect behaviors, writing typed wrappers, and reviewing contributions
If this library has saved you time, a one-time or recurring contribution via Revolut is appreciated. There is no obligation.
This project is licensed under the terms specified in the LICENSE file.
All rights reserved © Martin Hrášek <@mrlm-xyz> and WANTED.solutions s.r.o. <@wanted-solutions>