Skip to content

Language-Specific Commands

Most EAC commands are language-agnostic and work across all supported languages. However, some commands are specific to certain languages.

Go-Specific Commands

Command Purpose Why Go-Only?
validate-go-tidy Validates Go module dependencies are tidy Runs go mod tidy and checks for changes
validate-dependencies Checks go.mod against module contracts Parses go.mod files to build dependency graph

These commands specifically interact with Go's module system (go.mod) and toolchain.


Language-Agnostic Commands

All other commands work across languages via capability-based dispatch. Commands check module capabilities and delegate to appropriate language-specific handlers.

Build Commands

Dispatch to language-specific handlers:

Module Type Handler Builds
go GoHandler Go libraries and executables with cross-compilation
typescript NpmHandler npm packages via npm install and tsc
container BuildxHandler Docker images with multi-platform support
docs MkdocsHandler Documentation sites and PDFs
static NoneHandler or ScriptsHandler No build or custom scripts

Commands:


Test Commands

Dispatch to language-specific runners:

Module Type Test Types Runners
go gotest, godog GoRunner - Runs go test and godog
typescript mocha, cucumber-js MochaRunner, TsCucumberRunner

Commands:


Validation Commands

Work on contracts, specifications, and code quality regardless of language:


Security Commands

Scan any codebase with language-aware tools:

Security tools detect languages automatically.


Release Management

Version control and changelog generation work across all module types:


Module Management

Introspection and discovery commands work with all module types:


AI Workflows

AI commands generate language-appropriate outputs:

AI providers adapt output to module context.


Workspace Management

Git worktree operations work regardless of module language:


Documentation

Documentation generation supports multiple formats:


How Capability-Based Dispatch Works

EAC uses a capability matching system to route commands to appropriate handlers:

1. Modules Declare Capabilities

In .r2r/eac/repository.yml:

- moniker: my-service
  type: go
  capabilities: [go_module, cross_compile]

2. Handlers Register Capabilities

In handler implementation:

type GoHandler struct {
    Capabilities []string
}

func (h *GoHandler) GetCapabilities() []string {
    return []string{"go_module", "cross_compile"}
}

3. Commands Dispatch to Matching Handler

handler := GetHandlerForModule(module)
err := handler.Build(ctx, module)

4. Handler Executes Language-Specific Logic

The handler runs the appropriate build tools (go build, npm install, docker buildx, etc.).


Adding Language Support

To add support for a new language:

  1. Create a handler - Implement the Builder or Runner interface
  2. Register capabilities - Define what the handler can do
  3. Define module type - Create default file patterns and settings
  4. Register handler - Add to handler registry in init()

See Module Types Reference for detailed instructions.


Language Support Summary

Language Native Support Build Test Notes
Go ✅ Yes ✅ Full ✅ gotest, godog Complete toolchain integration
TypeScript ✅ Yes ✅ Full ✅ mocha, cucumber-js npm and tsc support
JavaScript ✅ Yes ✅ npm ✅ mocha, cucumber-js Via TypeScript module type
Docker ✅ Yes ✅ buildx - Language-agnostic containerization
Python ⚠️ Container ⚠️ Custom ⚠️ Custom Use container type with Dockerfile
Rust ⚠️ Container ⚠️ Custom ⚠️ Custom Use container type with Dockerfile
Java ⚠️ Container ⚠️ Custom ⚠️ Custom Use container type with Dockerfile

Legend:

  • Full - Native handler with comprehensive support
  • ⚠️ Custom - Requires Dockerfile or custom scripts
  • - - Not applicable or not supported


Tutorials | How-to Guides | Explanation | Reference

You are here: Reference — information-oriented technical descriptions of the system.