Skip to content

jonykalavera/dokli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dokli

A magical CLI/TUI for interacting with Dokploy.

                                                                    █
                                                                   ████
                                                                    ███████            █
               █████████████████████████                             ████████   ████████
             ███████████████████████████████                          ██████████████████
            ████                        █████████                       ██████████████
            ████          ███               █████████                      ████
            ███           ███                   ██████████               █████
            ███                                      ████████████████████████
            ████████████████                              █████████████████
            ██████████████████████                               ███████
            ████            ██████████                     ██████████          ██████
             ██████               ███████████████████████████████          ████████
               ████████                ████████████████████             ████████
             █     █████████                                        ████████     ███
            █████      █████████                                ████████      ██████
            ████████       ███████████                    ███████████      █████████
            ████ ██████         ████████████████████████████████        ███████ ████
            ████   ███████            ████████████████████           ███████    ████
             █████    ████████                                   ████████    ██████
              ███████     ████████                           █████████     ███████
              █████████      ████████████              ███████████      ██████████
               ████ ██████        ████████████████████████████       ███████ ████
                ████   ██████            ██████████████            ██████   ████
                 █████   ███████                               ████████   █████
                   █████    █████████                      █████████    █████
                    ██████      ████████████████████████████████      ██████
                      ██████         ██████████████████████         ██████
                        ███████                                  ██████
                           ████████                          ████████
                              ███████████               ██████████
                                   ██████████████████████████
                                          ████████████

Installation

pip install git+https://github.com/jonykalavera/dokli.git

Tested with Dokploy versions:

  • 0.6.1

Configuration

Create a dokly.yaml file in the current directory. Example:

connections:
  - name: test-env
    url: https://dokploy.examle.com
    api_key: ****************************************
    notes: "Our test environment. Handle with care!"

CLI

Features

  • Supports all API entities actions/verbs.
  • magical JSON parameters %json:{"projectId": "daspdoada798sda"}
  • magical file parameters %file:foo.redis.json
  • output formats:
    • yaml
    • json
    • python
    • table (experimental)

Usage

$ dokly


 Usage: python -m dokli [OPTIONS] COMMAND [ARGS]...

 Magical Dokploy CLI/TUI.

╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --install-completion          Install completion for the current shell.      │
│ --show-completion             Show completion for the current shell, to copy │
│                               it or customize the installation.              │
│ --help                        Show this message and exit.                    │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ api   API.                                                                   │
│ tui   Text User Interface.                                                   │
╰──────────────────────────────────────────────────────────────────────────────╯


$ dokly api test-env project all
- adminId: ysHDHlhX4a3zOG2fLsske
  applications: []
  compose: []
  createdAt: '2024-08-05T02:45:38.168Z'
  description: null
  mariadb: []
  mongo: []
  mysql: []
  name: Dokli
  postgres: []
  projectId: zuanf1SWHMFO11y6xqpRR
  redis: []

$ dokli api test-env project create -p '%json:{"name": "Dokli"}' --format table
               API Response
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Key         ┃ Value                    ┃
┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ projectId   │ zuanf1SWHMFO11y6xqpRR
│ name        │ Dokli                    │
│ description │ None                     │
│ createdAt   │ 2024-08-05T02:45:38.168Z │
│ adminId     │ ysHDHlhX4a3zOG2fLsske    │
└─────────────┴──────────────────────────┘

$ dokli api test-env project one --format json -p project_id=zuanf1SWHMFO11y6xqpRR
{"projectId": "zuanf1SWHMFO11y6xqpRR", "name": "Dokli", "description": null,
"createdAt": "2024-08-05T02:45:38.168Z", "adminId": "ysHDHlhX4a3zOG2fLsske",
"applications": [], "mariadb": [], "mongo": [], "mysql": [], "postgres": [],
"redis": [], "compose": []}

Known issues

  • Configuration stores API key in plain-text.
  • No way to hide secrets. Passwords are printed in plain-text.

TUI

Still a WIP. Screenshot from 2024-08-04 23-39-14 Screenshot from 2024-08-04 23-39-04 Screenshot from 2024-08-05 00-06-58

http://www.youtube.com/watch?v=IAnHfFV9_jU

Motivation

The CLI is designed to keep up with any changes in the API. The client is autogenerated and integrated through config. I did this because I want to do some test automation and the official CLI seems incomplete at the moment. The TUI is because I am into tools like yazi, lazygit, k9s, dry, etc. I like to keep my terminal open at all times $. Also, it seemed to me like something cool to do this weekend. I learned a bunch about texual, typer and Dokploy.

Buy me a 🌮

I'm Mexican, I prefer tacos. But ☕ is also nice. You can use the 🫶 sponsor button on the top.

Also pretty please and thanks in advance 🥺.

About

Magical Dokploy CLI/TUI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages