Fundamentals for the
codefly.aiecosystem.
core is the shared library that every codefly agent, the CLI, and user
services depend on. It defines:
- Resource model —
Workspace,Module,Service,Endpoint,Agent,Environment(resources/) - Architecture — DAG-based dependency resolution (
architecture/,graph/) - Network model — port allocation, DNS, native/container/public access
modes (
network/) - Configuration flow — typed configs passed between services as env
vars (
configurations/) - Agent system — gRPC-based agent lifecycle: Builder, Runtime, Code
(
agents/) - Runners — Native, Docker, and Nix execution environments with
consistent process supervision (
runners/) - Companions — sidecar containers for proto, Go, Python, Node tooling
(
companions/) - Telemetry — structured logging via
wool(wool/)
go get github.com/codefly-dev/corecore is self-contained — no replace directives, no internal codefly
imports beyond its own module.
import (
"context""github.com/codefly-dev/core/resources""github.com/codefly-dev/core/wool"
)
ctx:=context.Background()
w:=wool.Get(ctx).In("Example")
ws, err:=resources.LoadWorkspaceFromDir(ctx, "/path/to/workspace")
iferr!=nil {
returnw.Wrapf(err, "load workspace")
}
w.Info("loaded", wool.Field("modules", len(ws.Modules)))# All tests
go test ./...
# Single package
go test ./resources/ -v
# With race detector
go test -race ./...Tests gracefully skip when external prerequisites (Docker, Nix flakes ≥ 2.18) are unavailable.
MIT — see LICENSE.
