https://github.com/jonykalavera/dokli
Magical Dokploy CLI/TUI.
https://github.com/jonykalavera/dokli
cli dokploy tui
Last synced: 5 months ago
JSON representation
Magical Dokploy CLI/TUI.
- Host: GitHub
- URL: https://github.com/jonykalavera/dokli
- Owner: jonykalavera
- Created: 2024-08-05T04:05:30.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-11T22:11:10.000Z (about 1 year ago)
- Last Synced: 2025-12-13T06:53:46.949Z (6 months ago)
- Topics: cli, dokploy, tui
- Language: Python
- Homepage:
- Size: 320 KB
- Stars: 55
- Watchers: 2
- Forks: 4
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Dokli
[](https://github.com/jonykalavera/dokli/actions/workflows/python-package.yml)
A magical CLI/TUI for interacting with [Dokploy](https://github.com/Dokploy/dokploy).
```txt
█
████
███████ █
█████████████████████████ ████████ ████████
███████████████████████████████ ██████████████████
████ █████████ ██████████████
████ ███ █████████ ████
███ ███ ██████████ █████
███ ████████████████████████
████████████████ █████████████████
██████████████████████ ███████
████ ██████████ ██████████ ██████
██████ ███████████████████████████████ ████████
████████ ████████████████████ ████████
█ █████████ ████████ ███
█████ █████████ ████████ ██████
████████ ███████████ ███████████ █████████
████ ██████ ████████████████████████████████ ███████ ████
████ ███████ ████████████████████ ███████ ████
█████ ████████ ████████ ██████
███████ ████████ █████████ ███████
█████████ ████████████ ███████████ ██████████
████ ██████ ████████████████████████████ ███████ ████
████ ██████ ██████████████ ██████ ████
█████ ███████ ████████ █████
█████ █████████ █████████ █████
██████ ████████████████████████████████ ██████
██████ ██████████████████████ ██████
███████ ██████
████████ ████████
███████████ ██████████
██████████████████████████
████████████
```
## Installation
```bash
pip install git+https://github.com/jonykalavera/dokli.git
# with TUI support
pip install git+https://github.com/jonykalavera/dokli.git#egg=dokli[tui]
```
Tested with Dokploy versions:
- 0.6.1
- 0.18.1
## Configuration
Create the configuration file at `~/.config/dokli/dokli.yaml`. Example:
```yaml
connections:
- name: test-env
url: https://test.example.com
api_key: ****************************************
notes: "Our test environment. Handle with care!"
- name: prod-env
url: https://prod.example.com
api_key_cmd: "secret-tool lookup dokli prodEnvApikey"
notes: "Our prod environment. Handle with even more care!"
```
You can use `api_key_cmd` to load the API key from a command such as [secret-tool](https://manpages.org/secret-tool) instead of entering it in the config file. This is highly recommended for security reasons.
Configuration uses [pydantic-settings](https://docs.pydantic.dev/latest/concepts/pydantic_settings/) which means it can also be set via [environment variables](https://docs.pydantic.dev/latest/concepts/pydantic_settings/#parsing-environment-variable-values) using the `DOKLI_` prefix.
## CLI
### Features
- Commands are inferred from the OpenAPI spec, which allows:
- support for multiple Dokploy API versions.
- support for all API entities actions/verbs.
- magical JSON parameters `%json:{"projectId": "daspdoada798sda"}`
- magical file parameters `%file:/path/to/data/foo.redis.json`
- output formats:
- yaml
- json
- python
- table (experimental)
## Usage
```bash
$ dokly
Usage: 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 commands. │
│ 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 --body '%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 zuanf1SWHMFO11y6xqpRR
{"projectId": "zuanf1SWHMFO11y6xqpRR", "name": "Dokli", "description": null,
"createdAt": "2024-08-05T02:45:38.168Z", "adminId": "ysHDHlhX4a3zOG2fLsske",
"applications": [], "mariadb": [], "mongo": [], "mysql": [], "postgres": [],
"redis": [], "compose": []}
```
## TUI
Still a WIP. Basic functionality will be implemented at 0.2.0 release.



[http://www.youtube.com/watch?v=IAnHfFV9_jU](http://www.youtube.com/watch?v=IAnHfFV9_jU)
## Motivation
The CLI is designed to keep up with any changes in the API. Commands are dynamically inferred from the OpenAPI spec.
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](https://yazi-rs.github.io/), [lazygit](https://github.com/jesseduffield/lazygit), [k9s](https://k9scli.io/), [dry](https://github.com/moncho/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](https://textual.textualize.io/), [typer](https://github.com/tiangolo/typer) and [Dokploy](https://github.com/Dokploy/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 🥺.