Skip to content

0.2 CLI #1558

@shykes

Description

@shykes

Overview

This issue tracks the redesign of the dagger CLI for the 0.2 release aka “Europa”.

Status

This is a partially complete design. Implementation has begun (#1648) but design details can still be refined.

Design proposal

Top-level commands

$ dagger help

A modern alternative to Make, by the creators of Docker.

Usage: dagger [options] command ...

Commands:

  help             Show help information
  do               Execute an action
  undo             Undo an action
  project          Manage a project
  diagnostics      Show diagnostics information
  cue             Run the embedded CUE toolchain

Global options:
  -p, --project   PATH|ADDRESS           Specify a project (default: current directory)
  -l, --log-level ...
  --with OVERRIDE            Apply a Cue expression as override.

dagger project

dagger project manages a Dagger project.

A project is a complete Dagger configuration. It defines:

  • Actions
  • Interactions with the client machine
  • The dependency graph connecting all of the above

dagger project init

Initialize a new project

$ dagger project init --help

dagger [OPTIONS] project init ADDRESS [PATH]

Initialize a new project

A project is a cue module containing a Dagger configuration and its dependencies

Global options:
  -p, --project   PATH|ADDRESS           Specify a project (default: current directory)
  -l, --log-level ...

dagger project update [PACKAGE...]

Update a project dependencies. If no package is specified, all dependencies are updated.

dagger do

dagger do executes an action and its dependencies.

Most of the magic happens in do. Note the second half of the help message... :)

$ dagger help do

dagger [OPTIONS] do ACTION

Execute a Dagger action

Global options:
  -p, --project   PATH|ADDRESS           Specify a project (default: current directory)
  -l, --log-level ...
  --with OVERRIDE            Apply a Cue expression as override.

Actions: (loaded from .)

  core-integration      Run core integration tests
  cuefmt                Format all cue files
  cuelint               Lint and format all cue files
  dagger                Build a dev dagger binary
  dagger-debug          Build a debug version of the dev dagger binary
  doc-test              Test docs
  docs                  Generate docs
  docslint              Generate & lint docs
  europa-universe-test  Run Europa universe tests
  golint                Go lint
  help                  Show how to get started & what targets are available
  install               Install a dev dagger binary
  integration           Run all integration tests
  lint                  Lint everything
  shellcheck            Run shellcheck
  test                  Run all tests
  todo                  Find all TODO items
  universe-test         Run universe tests
  web                   Run the website locally

We leverage the familiar help interface to dynamically show what actions can be executed.
Users can learn more on any action by following the command hierarchy. For example:

$ dagger help do docs

dagger [OPTIONS] do docs

Generate documentation for https://docs.dagger.io

Global options:
  -p, --project   PATH|ADDRESS           Specify a project (default: current directory)
  -l, --log-level ...
  --with OVERRIDE            Apply a Cue expression as override.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions