CLI

CLI is a tool for deploying a complete dyrector.io stack locally, for demonstration, testing, or development purposes.

Dependencies

Before using the CLI, make sure you have the following dependencies installed on your local machine:

  • Docker installed on your system but Podman works, too.

  • Go (1.20 or higher) to run the go install.

When you use Podman, make sure you have the network_backend set to netavark, if you have an older installation (before 4.0 released) as the old CNI network backend doesn't support name resolutions we use.

You also have to get the aardvark-dns plugin for the same reason.

If you use rootless containers, set your DOCKER_HOST environmental variable correctly, because if it's missing, Docker will assume it's /var/run/docker.sock and you can get misleading errors from it.

Option #1: Go install

Step 1: Execute go install github.com/dyrector-io/dyrectorio/golang/cmd/dyo@main

Step 2: Execute dyo up

Step 3: After you navigated to localhost:8000 (this is the default traefik port) you will see a Login screen

Step 4: Register an account with whatever e-mail address you see fit (doesn't have to be valid one)

Step 5: Navigate to localhost:4436 where you will find your mail as all outgoing e-mails will land here

Step 6: Open your e-mail message and using the link inside you can activate your account

Step 7: Happy deploying! 🎬

Option #2: Run CLI from source

Step 1: By using command line – posix shells, Git Bash or PowerShell –, pull dyrector.io's GitHub repository by executing git pull, if you don't already have the repository on your local machine you have to clone the repository by executing git clone https://github.com/dyrector-io/dyrectorio.git.

Step 2: Open the project folder, and execute make up – alias to go run ./golang/cmd/dyo up – and wait until you get back the command prompt. It should take a few minutes the first time running, as it will pull a few docker images.

Step 3: Enter localhost:8000 in your browser's address bar. You're ready to use the platform.

The command-line interface (CLI) lets you run a complete the platform's development environment locally with the following services: UI Service (crux-ui), Backend Service (crux), PostgreSQL databases, Authentication, Migrations, and SMTP mock mail server. The CLI also runs the migration services. The default container names are listed below:

  • dyo-stable_traefik

  • dyo-stable_crux-postgres

  • dyo-stable_kratos-postgres

  • dyo-stable_kratos

  • dyo-stable_kratos-migrate

  • dyo-stable_crux

  • dyo-stable_crux-migrate

  • dyo-stable_mailslurper

  • dyo-stable_crux-ui

The dyo-stable prefix can be changed in the settings.yaml file of the application.

When you contribute to the project on GitHub, you can turn off crux and crux-ui with the global options listed below or overriding the values in the settings file.

CLI commands

As you seen above you can start the application with the up subcommand, after you finished your work, you can stop and remove the containers with the down subcommand.

Running the stack again without stopping it will result in containers stopped, removed then recreated.

Configuration

The CLI generates a settings.yaml file containing the default configurations if the program doesn't find a configuration on the given path, or a default path if there isn't. Default path is dependant on your OS, you can find these on:

  • Linux: $XDG_CONFIG_HOME/dyo-cli/settings.yaml where the $XDG_CONFIG_HOME usually resolving to $HOME/.config.

  • Mac OSX: $HOME/Library/Application Support/dyo-cli/settings.yaml.

  • Windows: %AppData%/dyo-cli/settings.yaml.

The settings.yaml file contains the following:

Please note, this file stores some state too, in this case passwords and secrets. These have to match to use the installation multiple times as with bad passwords you won't be able to update or use the databases.

Get help

To get usage tips and learn more about available commands from within CLI, run the following as we described above:

If you have additional questions or ideas for new features, you can start an issue or a new discussion on our CLI’s open-source repository. You can also chat with our team on Discord.

We’d love to hear from you!

Last updated