Getting Started
Relevant source files
The following files were used as context for generating this wiki page:
The Daco CLI is a specialized tool designed for managing data product projects. It operates as a "Swiss army knife" for data engineers and architects, facilitating the definition, translation, and management of data products using the OpenDPI specification.
This guide provides the necessary steps to set up the development environment, install the tool, and understand the core project structure and configuration.
Installation
The Daco CLI can be installed through multiple package managers or built directly from source.
| Method | Command / Source | Platform |
|---|---|---|
| Homebrew | brew install dacolabs/tap/daco | macOS/Linux |
| Scoop | scoop install daco | Windows |
| Go Install | go install github.com/dacolabs/cli/cmd/daco@latest | All (requires Go) |
| Manual | Releases Page | All |
Sources: README.md:9-32
Development Environment Setup
For contributors looking to modify the CLI, the project requires specific tools and a structured initialization process.
Prerequisites
Developers must ensure the following tools are installed:
- Go: Version 1.23.0 or higher.
- golangci-lint: For code quality and linting.
- Make: For build automation.
- GoReleaser: (Optional) For testing local releases.
Sources: CONTRIBUTING.md:28-35
Initializing the Repository
The project uses a Makefile to automate the environment setup, including the configuration of git hooks and project dependencies.
# Clone the repository
git clone git@github.com:dacolabs/cli.git
cd cli
# Run setup to configure git hooks
make setup
# Build the binary
make build
Sources: CONTRIBUTING.md:39-48
Project Architecture
The Daco CLI is organized into clear domains, separating command definitions, configuration management, and the core OpenDPI logic.
This diagram shows the high-level dependency flow from the entry point to the core internal packages.
Sources: CONTRIBUTING.md:52-67
Key Directories
| Directory | Purpose |
|---|---|
cmd/daco/ | Entry point for the application. |
internal/commands/ | Implementation of CLI commands (e.g., init, ports). |
internal/opendpi/ | Parsing and writing of OpenDPI specifications. |
internal/translate/ | Logic for converting JSON schemas to target languages (Python, Go, SQL, etc.). |
internal/config/ | Handling of the daco.yaml configuration file. |
Sources: CONTRIBUTING.md:52-67
Configuration Management
The CLI relies on a configuration file, typically named daco.yaml, to manage project-level settings such as the path to the OpenDPI specification.
The daco.yaml File
The configuration system tracks the version and the location of the data product specification.
| Field | Type | Description |
|---|---|---|
version | Integer | The configuration schema version (currently 1). |
path | String | The filesystem path to the OpenDPI specification file. |
Sources: internal/config/config_test.go:17-21, internal/config/config_test.go:73-77
Specification Handling
The CLI processes OpenDPI specs in either JSON or YAML format. The internal/opendpi package provides the Parser and Writer components for these operations.
The sequence of resolving a data product specification including external file references.
Sources: internal/opendpi/parse.go:33-40, internal/opendpi/parse.go:68-75
Core Development Workflow
The project uses make targets to maintain code quality and build artifacts.
- Testing:
make testruns the suite with race detection enabled. - Linting:
make lintexecutesgolangci-lint. - Formatting:
make formatappliesgofmtandgoimports. - Documentation: The project includes a tool to generate LLM-friendly markdown documentation located in
cmd/gendocs/main.go.
Sources: CONTRIBUTING.md:162-171, cmd/gendocs/main.go:12-16
Summary
Getting started with the Daco CLI involves installing the binary and setting up a project workspace centered around a daco.yaml configuration and an OpenDPI specification. For developers, the project provides a robust Go-based environment with automated testing, linting, and a modular architecture designed to support diverse data schema translations.