Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/gendocs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/dacolabs/cli/internal/translate/databrickssql"
"github.com/dacolabs/cli/internal/translate/dqxyaml"
"github.com/dacolabs/cli/internal/translate/gotypes"
"github.com/dacolabs/cli/internal/translate/markdown"
"github.com/dacolabs/cli/internal/translate/protobuf"
"github.com/dacolabs/cli/internal/translate/pydantic"
"github.com/dacolabs/cli/internal/translate/pyspark"
Expand Down Expand Up @@ -52,6 +53,7 @@ func main() {
translators["protobuf"] = &protobuf.Translator{}
translators["spark-sql"] = &sparksql.Translator{}
translators["dqx-yaml"] = &dqxyaml.Translator{}
translators["markdown"] = &markdown.Translator{}

rootCmd := commands.NewRootCmd(translators)
rootCmd.DisableAutoGenTag = true
Expand Down
2 changes: 2 additions & 0 deletions daco.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: 1
path: ./spec
9 changes: 1 addition & 8 deletions docs/cli/daco_connections_describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,12 @@ daco connections describe [CONNECTION_NAME] [flags]

# Show connection details
daco connections describe kafka_prod

# Show as JSON
daco connections describe kafka_prod -o json

# Show as YAML
daco connections describe kafka_prod -o yaml
```

### Options

```
-h, --help help for describe
-o, --output string Output format (text, json, yaml) (default "text")
-h, --help help for describe
```

### SEE ALSO
Expand Down
11 changes: 2 additions & 9 deletions docs/cli/daco_connections_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,14 @@ daco connections list [flags]
### Examples

```
# List connections in table format
# List connections
daco connections list

# List connections as JSON
daco connections list -o json

# List connections as YAML
daco connections list -o yaml
```

### Options

```
-h, --help help for list
-o, --output string Output format (table, json, yaml) (default "table")
-h, --help help for list
```

### SEE ALSO
Expand Down
30 changes: 30 additions & 0 deletions docs/cli/daco_describe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## daco describe

Show data product overview with ports and connections

### Synopsis

Show a summary of the data product including its metadata,
all defined ports, and all defined connections.

```
daco describe [flags]
```

### Examples

```
# Describe the data product
daco describe
```

### Options

```
-h, --help help for describe
```

### SEE ALSO

* [daco](daco.md) - Data product CLI tool

11 changes: 2 additions & 9 deletions docs/cli/daco_ports_describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,14 @@ daco ports describe [PORT_NAME] [flags]
# Interactive selection
daco ports describe

# Show port details in human-readable format
# Show port details
daco ports describe user_events

# Show port details as JSON
daco ports describe user_events -o json

# Show port details as YAML
daco ports describe user_events -o yaml
```

### Options

```
-h, --help help for describe
-o, --output string Output format (text, json, yaml) (default "text")
-h, --help help for describe
```

### SEE ALSO
Expand Down
11 changes: 2 additions & 9 deletions docs/cli/daco_ports_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,14 @@ daco ports list [flags]
### Examples

```
# List ports in table format
# List ports
daco ports list

# List ports as JSON
daco ports list -o json

# List ports as YAML
daco ports list -o yaml
```

### Options

```
-h, --help help for list
-o, --output string Output format (table, json, yaml) (default "table")
-h, --help help for list
```

### SEE ALSO
Expand Down
24 changes: 15 additions & 9 deletions docs/cli/daco_ports_translate.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Translate a port schema to a target format

Translate a port schema to a target format.

Available formats: databricks-pyspark, pydantic, python, databricks-sql, scala, protobuf, pyspark, avro, spark-scala, databricks-scala, spark-sql, gotypes
Available formats: spark-scala, dqx-yaml, pyspark, avro, pydantic, python, databricks-sql, protobuf, gotypes, databricks-pyspark, scala, databricks-scala, spark-sql, markdown

```
daco ports translate [flags]
Expand All @@ -19,20 +19,26 @@ daco ports translate [flags]
daco ports translate

# Translate specific port
daco ports translate --name my-port --format pyspark --output schema.py
daco ports translate --name my-port --format pyspark

# Translate to a custom directory (also sets package name for Go/Protobuf/Scala)
daco ports translate --format gotypes --output-dir models
# Translate multiple ports
daco ports translate --name port-a,port-b --format pyspark

# Translate all ports
daco ports translate --all --format pyspark

# Translate to a custom output directory (also sets package name for Go/Protobuf/Scala)
daco ports translate --all --format gotypes --output models
```

### Options

```
-f, --format string Output format (pyspark, avro, spark-scala, databricks-scala, spark-sql, gotypes, databricks-pyspark, pydantic, python, databricks-sql, scala, protobuf)
-h, --help help for translate
-n, --name string Port name (translates all if not specified)
-o, --output string Output file path (only valid when translating a single port)
-d, --output-dir string Output directory (also used as package name for Go/Protobuf/Scala) (default "schemas")
-a, --all Translate all ports
--format string Output format (spark-scala, dqx-yaml, pyspark, avro, pydantic, python, databricks-sql, protobuf, gotypes, databricks-pyspark, scala, databricks-scala, spark-sql, markdown)
-h, --help help for translate
-n, --name string Port name(s), comma-separated
-o, --output string Output directory (also used as package name for Go/Protobuf/Scala) (default "schemas")
```

### SEE ALSO
Expand Down
21 changes: 21 additions & 0 deletions docs/cli/daco_product.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## daco product

Manage data product metadata

### Synopsis

Manage data product metadata defined in the OpenDPI spec.
Use subcommands to view or upgrade the product version.

### Options

```
-h, --help help for product
```

### SEE ALSO

* [daco](daco.md) - Data product CLI tool
* [daco product upgrade](daco_product_upgrade.md) - Upgrade the data product version
* [daco product version](daco_product_version.md) - Show the data product spec version

34 changes: 34 additions & 0 deletions docs/cli/daco_product_upgrade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## daco product upgrade

Upgrade the data product version

### Synopsis

Upgrade the data product version by bumping major, minor, or patch.
In interactive mode, a form is shown to select the bump type.

```
daco product upgrade [flags]
```

### Examples

```
# Interactive mode
daco product upgrade

# Non-interactive
daco product upgrade --bump minor
```

### Options

```
-b, --bump string Bump type: major, minor, or patch
-h, --help help for upgrade
```

### SEE ALSO

* [daco product](daco_product.md) - Manage data product metadata

29 changes: 29 additions & 0 deletions docs/cli/daco_product_version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## daco product version

Show the data product spec version

### Synopsis

Show the current version of the data product as defined in the OpenDPI spec.

```
daco product version [flags]
```

### Examples

```
# Show the product version
daco product version
```

### Options

```
-h, --help help for version
```

### SEE ALSO

* [daco product](daco_product.md) - Manage data product metadata

5 changes: 4 additions & 1 deletion docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ Avro, Protobuf, Go types, and more.
### SEE ALSO

* [daco connections](daco_connections.md) - Manage data product connections
* [daco describe](daco_describe.md) - Show data product overview with ports and connections
* [daco init](daco_init.md) - Initialize a new daco project
* [daco ports](daco_ports.md) - Manage data product ports
* [daco ports](daco_ports.md) - Manage data product ports
* [daco product](daco_product.md) - Manage data product metadata

39 changes: 39 additions & 0 deletions schemas/myport.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Myport

## Fields

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | string | Yes | |
| `metadata` | [Metadata](#Metadata) | Yes | |
| `spec` | [Spec](#Spec) | Yes | |


---

## Metadata

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `owner` | string | Yes | |
| `environment` | string | No | (enum: `prod`, `staging`, `dev`) |


---

## Fields

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | string | Yes | |
| `type` | string | Yes | (enum: `string`, `integer`, `boolean`, `float`) |


---

## Spec

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `fields` | array([Fields](#Fields)) | No | |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The "Fields" anchor is duplicated, so the Spec link points to the wrong section. Give the Fields type section a unique heading and update the link so readers land on the correct definition.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At schemas/myport.md, line 38:

<comment>The "Fields" anchor is duplicated, so the Spec link points to the wrong section. Give the Fields type section a unique heading and update the link so readers land on the correct definition.</comment>

<file context>
@@ -0,0 +1,39 @@
+
+| Field | Type | Required | Description |
+|-------|------|----------|-------------|
+| `fields` | array([Fields](#Fields)) | No |  |
+
</file context>


10 changes: 10 additions & 0 deletions spec/opendpi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
opendpi: 1.0.0
info:
title: myproduct
version: 1.0.0
connections: {}
ports:
myport:
connections: []
schema:
$ref: schemas/myport.schema.yaml
39 changes: 39 additions & 0 deletions spec/schemas/myport.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
type: object
properties:
name:
type: "string"

# Nested Object: Metadata
metadata:
type: "object"
properties:
owner:
type: "string"
environment:
type: "string"
enum: ["prod", "staging", "dev"]
required:
- "owner"

# Nested Array of Objects: Columns/Fields
spec:
type: "object"
properties:
fields:
type: "array"
items:
type: "object"
properties:
name:
type: "string"
type:
type: "string"
enum: ["string", "integer", "boolean", "float"]
required:
- "name"
- "type"

required:
- "name"
- "metadata"
- "spec"