|
1 | 1 | # Dokploy CLI |
2 | 2 |
|
3 | | -<!--  --> |
4 | | - |
5 | | -Dokploy CLI is a powerful and versatile command-line tool designed to remotely manage your Dokploy server. It simplifies the process of creating, deploying, and managing applications and databases. |
6 | | - |
7 | | -<!-- [](https://oclif.io) |
8 | | -[](https://npmjs.org/package/dokploy) |
9 | | -[](https://npmjs.org/package/dokploy) |
10 | | -[](https://github.com/yourusername/dokploy/blob/master/package.json) --> |
11 | | - |
12 | | -## Table of Contents |
13 | | - |
14 | | -- [Installation](#installation) |
15 | | -- [Usage](#usage) |
16 | | -- [Commands](#commands) |
17 | | - - [Authentication](#authentication) |
18 | | - - [Project Management](#project-management) |
19 | | - - [Application Management](#application-management) |
20 | | - - [Environment Management](#environment-management) |
21 | | - - [Database Management](#database-management) |
22 | | -- [Contributing](#contributing) |
23 | | -- [Support](#support) |
24 | | -- [License](#license) |
| 3 | +Dokploy CLI is a command-line tool to manage your Dokploy server remotely. It provides **449 commands** auto-generated from the Dokploy OpenAPI spec, covering every API endpoint. |
25 | 4 |
|
26 | 5 | ## Installation |
27 | 6 |
|
28 | | -```sh-session |
29 | | -$ npm install -g @dokploy/cli |
| 7 | +```bash |
| 8 | +npm install -g @dokploy/cli |
30 | 9 | ``` |
31 | 10 |
|
32 | | -## Usage |
33 | | - |
34 | | -```sh-session |
35 | | -$ dokploy COMMAND |
36 | | -running command... |
| 11 | +## Authentication |
37 | 12 |
|
38 | | -$ dokploy --version |
39 | | -dokploy/0.0.0 darwin-arm64 node-v18.18.0 |
| 13 | +### Option 1: Using the `auth` command |
40 | 14 |
|
41 | | -$ dokploy --help [COMMAND] |
42 | | -USAGE |
43 | | - $ dokploy COMMAND |
44 | | -... |
| 15 | +```bash |
| 16 | +dokploy auth -u https://panel.dokploy.com -t YOUR_API_KEY |
45 | 17 | ``` |
46 | 18 |
|
47 | | -## Commands |
| 19 | +### Option 2: Environment variables |
48 | 20 |
|
49 | | -### Authentication |
50 | | - |
51 | | -- `dokploy authenticate`: Authenticate with the Dokploy server. |
52 | | -- `dokploy verify`: Verify current authentication. |
| 21 | +```bash |
| 22 | +export DOKPLOY_URL="https://panel.dokploy.com" |
| 23 | +export DOKPLOY_API_KEY="YOUR_API_KEY" |
| 24 | +``` |
53 | 25 |
|
54 | | -### Project Management |
| 26 | +### Option 3: `.env` file |
55 | 27 |
|
56 | | -- `dokploy project:create`: Create a new project. |
57 | | -- `dokploy project:info`: Get information about an existing project. |
58 | | -- `dokploy project:list`: List all projects. |
| 28 | +Create a `.env` file in your working directory: |
59 | 29 |
|
60 | | -### Environment Management |
| 30 | +```env |
| 31 | +DOKPLOY_URL="https://panel.dokploy.com" |
| 32 | +DOKPLOY_API_KEY="YOUR_API_KEY" |
| 33 | +``` |
61 | 34 |
|
62 | | -- `dokploy environment:create`: Create a new environment. |
63 | | -- `dokploy environment:delete`: Delete an existing environment. |
| 35 | +The CLI loads it automatically. Shell environment variables take priority over the `.env` file. |
64 | 36 |
|
65 | | -### Application Management |
| 37 | +## Usage |
66 | 38 |
|
67 | | -- `dokploy app:create`: Create a new application. |
68 | | -- `dokploy app:delete`: Delete an existing application. |
69 | | -- `dokploy app:deploy`: Deploy an application. |
70 | | -- `dokploy app:stop`: Stop a running application. |
| 39 | +```bash |
| 40 | +dokploy <group> <action> [options] |
| 41 | +``` |
71 | 42 |
|
72 | | -### Enviroment Management |
| 43 | +### Examples |
73 | 44 |
|
74 | | -- `dokploy env pull <file>`: Pull environment variables from Dokploy in a <file>. |
75 | | -- `dokploy env push <file>`: Push environment variables to Dokploy from a <file>. |
| 45 | +```bash |
| 46 | +# List all projects |
| 47 | +dokploy project all |
76 | 48 |
|
77 | | -### Database Management |
| 49 | +# Get a specific project |
| 50 | +dokploy project one --projectId abc123 |
78 | 51 |
|
79 | | -Dokploy supports various types of databases: |
| 52 | +# Create an application |
| 53 | +dokploy application create --name "my-app" --environmentId env123 |
80 | 54 |
|
81 | | -#### MariaDB |
| 55 | +# Deploy an application |
| 56 | +dokploy application deploy --applicationId app123 |
82 | 57 |
|
83 | | -- `dokploy database:mariadb:create` |
84 | | -- `dokploy database:mariadb:delete` |
85 | | -- `dokploy database:mariadb:deploy` |
86 | | -- `dokploy database:mariadb:stop` |
| 58 | +# Create a postgres database |
| 59 | +dokploy postgres create --name "my-db" --environmentId env123 |
87 | 60 |
|
88 | | -#### MongoDB |
| 61 | +# Stop a database |
| 62 | +dokploy postgres stop --postgresId pg123 |
89 | 63 |
|
90 | | -- `dokploy database:mongo:create` |
91 | | -- `dokploy database:mongo:delete` |
92 | | -- `dokploy database:mongo:deploy` |
93 | | -- `dokploy database:mongo:stop` |
| 64 | +# Get raw JSON output |
| 65 | +dokploy project all --json |
| 66 | +``` |
94 | 67 |
|
95 | | -#### MySQL |
| 68 | +### Getting help |
96 | 69 |
|
97 | | -- `dokploy database:mysql:create` |
98 | | -- `dokploy database:mysql:delete` |
99 | | -- `dokploy database:mysql:deploy` |
100 | | -- `dokploy database:mysql:stop` |
| 70 | +```bash |
| 71 | +# List all groups |
| 72 | +dokploy --help |
101 | 73 |
|
102 | | -#### PostgreSQL |
| 74 | +# List actions in a group |
| 75 | +dokploy application --help |
103 | 76 |
|
104 | | -- `dokploy database:postgres:create` |
105 | | -- `dokploy database:postgres:delete` |
106 | | -- `dokploy database:postgres:deploy` |
107 | | -- `dokploy database:postgres:stop` |
| 77 | +# See options for a specific action |
| 78 | +dokploy application deploy --help |
| 79 | +``` |
108 | 80 |
|
109 | | -#### Redis |
| 81 | +## Available command groups |
| 82 | + |
| 83 | +| Group | Commands | Group | Commands | |
| 84 | +|---|---|---|---| |
| 85 | +| `admin` | 1 | `notification` | 38 | |
| 86 | +| `ai` | 9 | `organization` | 10 | |
| 87 | +| `application` | 29 | `patch` | 12 | |
| 88 | +| `backup` | 11 | `port` | 4 | |
| 89 | +| `bitbucket` | 7 | `postgres` | 14 | |
| 90 | +| `certificates` | 4 | `preview-deployment` | 4 | |
| 91 | +| `cluster` | 4 | `project` | 8 | |
| 92 | +| `compose` | 28 | `redirects` | 4 | |
| 93 | +| `deployment` | 8 | `redis` | 14 | |
| 94 | +| `destination` | 6 | `registry` | 7 | |
| 95 | +| `docker` | 7 | `rollback` | 2 | |
| 96 | +| `domain` | 9 | `schedule` | 6 | |
| 97 | +| `environment` | 7 | `security` | 4 | |
| 98 | +| `gitea` | 8 | `server` | 16 | |
| 99 | +| `github` | 6 | `settings` | 49 | |
| 100 | +| `gitlab` | 7 | `ssh-key` | 6 | |
| 101 | +| `git-provider` | 2 | `sso` | 10 | |
| 102 | +| `license-key` | 6 | `stripe` | 7 | |
| 103 | +| `mariadb` | 14 | `swarm` | 3 | |
| 104 | +| `mongo` | 14 | `user` | 18 | |
| 105 | +| `mounts` | 6 | `volume-backups` | 6 | |
| 106 | +| `mysql` | 14 | | | |
| 107 | + |
| 108 | +## Development |
| 109 | + |
| 110 | +```bash |
| 111 | +# Install dependencies |
| 112 | +pnpm install |
| 113 | + |
| 114 | +# Run in dev mode |
| 115 | +pnpm run dev -- project all |
| 116 | + |
| 117 | +# Regenerate commands from OpenAPI spec |
| 118 | +pnpm run generate |
| 119 | + |
| 120 | +# Build |
| 121 | +pnpm run build |
| 122 | + |
| 123 | +# Lint & format |
| 124 | +pnpm run lint |
| 125 | +``` |
110 | 126 |
|
111 | | -- `dokploy database:redis:create` |
112 | | -- `dokploy database:redis:delete` |
113 | | -- `dokploy database:redis:deploy` |
114 | | -- `dokploy database:redis:stop` |
| 127 | +### Updating commands |
115 | 128 |
|
116 | | -For more information about a specific command, use: |
| 129 | +Commands are auto-generated from `openapi.json`. To update: |
117 | 130 |
|
118 | | -```sh-session |
119 | | -$ dokploy [COMMAND] --help |
120 | | -``` |
| 131 | +1. Replace `openapi.json` with the latest spec from the [Dokploy repo](https://github.com/Dokploy/dokploy) |
| 132 | +2. Run `pnpm run generate` |
| 133 | +3. Build with `pnpm run build` |
121 | 134 |
|
122 | 135 | ## Contributing |
123 | 136 |
|
124 | 137 | If you want to contribute to Dokploy CLI, please check out our [Contributing Guide](https://github.com/Dokploy/cli/blob/main/CONTRIBUTING.md). |
125 | 138 |
|
126 | 139 | ## Support |
127 | 140 |
|
128 | | -If you encounter any issues or have any questions, please [open an issue](https://github.com/yourusername/dokploy/issues) in our GitHub repository. |
| 141 | +If you encounter any issues or have any questions, please [open an issue](https://github.com/Dokploy/cli/issues) in our GitHub repository. |
129 | 142 |
|
130 | 143 | ## License |
131 | 144 |
|
|
0 commit comments