This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the Synadia Connect CLI and SDK - a NATS-based data pipeline tool for connecting data sources and sinks. The project is written in Go and uses a task-based build system.
task build- Build the connect binary totarget/connecttask test- Run all tests with coverage using Ginkgotask install- Build and install binary to~/.local/bin/connecttask clean- Clean up build artifacts intarget/
Standalone mode allows running connectors locally without NATS services:
connect standalone validate <file>- Validate connector definitionconnect standalone run <file>- Run connector locally using Dockerconnect standalone create <name>- Create new connector definition (creates<name>.connector.yml)connect standalone stop <id>- Stop running connectorconnect standalone logs <id>- Show connector logsconnect standalone list- List running connectors
connect standalone template list- List available templatesconnect standalone template get <name>- Generate template file
connect standalone runtime list- List available runtimesconnect standalone runtime add <id> <registry>- Add new runtime configurationconnect standalone runtime remove <id>- Remove runtime configurationconnect standalone runtime show <id>- Show runtime details
Default runtime: wombat (registry.synadia.io/connect-runtime-wombat)
Runtime versioning: wombat → registry.synadia.io/connect-runtime-wombat:latest, wombat:v1.0.3 → registry.synadia.io/connect-runtime-wombat:v1.0.3
task models:generate- Generate Go models from JSON schemas (requires CONNECT_NODE_LOCATION env var)task models:deps- Install go-jsonschema dependency for model generation
- Tests use Ginkgo/Gomega framework
- Run with:
go run github.com/onsi/ginkgo/v2/ginkgo -r -cover --coverpkg=github.com/synadia-io/connect/... --compilers=4 - All packages include comprehensive test suites (look for
*_test.gofiles)
- CLI Layer (
cli/): Command-line interface with subcommands for connector, library, and logs operations - Client Layer (
client/): HTTP client for communicating with the Connect service - Model Layer (
model/): Generated Go structs from JSON schemas for API communication - Spec Layer (
spec/): Connector specification definitions and builders - Builders (
builders/): Fluent API builders for creating connector configurations - Runtime (
runtime/): Core runtime environment for connector execution
- Builder Pattern: Used extensively in
builders/for creating connector configurations - Generated Code: Models are auto-generated from JSON schemas - never edit directly
- Command Pattern: CLI uses fisk for command structure with separate command files
- Test Suites: Each package has its own test suite using Ginkgo
cmd/connect/: Main entry point and version handlingspec/schemas/: JSON schemas that define the connector specificationdocs/: Documentation including getting started guide and reference docstest/: Shared test utilities and helpersvalidation/: Schema validation for standalone modedocker/: Docker integration for running connectors locallystandalone/: Runtime configuration management for standalone mode
- Models in
model/are generated from JSON schemas - never edit manually - Use
task models:generateto regenerate after schema changes - Requires
CONNECT_NODE_LOCATIONenvironment variable pointing to schema location
- All new code must have comprehensive test coverage
- Use Ginkgo/Gomega testing framework consistently
- Tests must pass before any changes are committed
- Follow standard Go conventions
- Use builder patterns for complex object construction
- Generated code should not be modified directly
- Prefer dependency injection and interfaces for testability
- Standalone mode provides local connector execution without NATS infrastructure
- Uses Docker for connector runtime isolation with configurable runtime management
- Includes built-in validation and template system
- Supports all connector types (source/sink, consumer/producer, transformers)
- Local ConnectFile format follows same schema as managed service
- Runtime configurations stored in
~/.synadia/connect/standalone/runtimes.json - Default runtimes automatically created on first use