Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DOKPLOY_URL=""
DOKPLOY_API_KEY=""
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

52 changes: 29 additions & 23 deletions .github/workflows/onPushToMain.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,62 @@
# test
name: version, tag and github release
name: release and publish

on:
push:
branches: [main]

env:
COREPACK_ENABLE_STRICT: 0

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}

- uses: pnpm/action-setup@v6
with:
version: latest

- uses: actions/setup-node@v4
with:
node-version: latest
cache: pnpm
registry-url: https://registry.npmjs.org

- run: pnpm install --ignore-scripts
- run: pnpm run build

- name: Check if version already exists
id: version-check
run: |
package_version=$(node -p "require('./package.json').version")
exists=$(gh api repos/${{ github.repository }}/releases/tags/v$package_version >/dev/null 2>&1 && echo "true" || echo "")

if [ -n "$exists" ];
then
if [ -n "$exists" ]; then
echo "Version v$package_version already exists"
echo "::warning file=package.json,line=1::Version v$package_version already exists - no release will be created. If you want to create a new release, please update the version in package.json and push again."
echo "skipped=true" >> $GITHUB_OUTPUT
else
echo "Version v$package_version does not exist. Creating release..."
echo "Version v$package_version does not exist"
echo "skipped=false" >> $GITHUB_OUTPUT
echo "tag=v$package_version" >> $GITHUB_OUTPUT
fi
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Setup git
if: ${{ steps.version-check.outputs.skipped == 'false' }}
run: |
git config --global user.email ${{ secrets.GH_EMAIL }}
git config --global user.name ${{ secrets.GH_USERNAME }}
- name: Generate oclif README
if: ${{ steps.version-check.outputs.skipped == 'false' }}
id: oclif-readme
run: |
pnpm install
pnpm exec oclif readme
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -am "chore: update README.md"
git push -u origin ${{ github.ref_name }}
fi

- name: Create Github Release
if: steps.version-check.outputs.skipped == 'false'
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5
if: ${{ steps.version-check.outputs.skipped == 'false' }}
with:
name: ${{ steps.version-check.outputs.tag }}
tag: ${{ steps.version-check.outputs.tag }}
commit: ${{ github.ref_name }}
token: ${{ secrets.GH_TOKEN }}
skipIfReleaseExists: true

- name: Publish to npm
if: steps.version-check.outputs.skipped == 'false'
run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
18 changes: 0 additions & 18 deletions .github/workflows/onRelease.yml

This file was deleted.

16 changes: 12 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
name: tests

on:
push:
branches-ignore: [main]
workflow_dispatch:

env:
COREPACK_ENABLE_STRICT: 0

jobs:
unit-tests:
test:
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
node_version: [lts/-1, lts/*, latest]
os: [ubuntu-latest, windows-latest]
node_version: [lts/*, latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v6
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: pnpm
- run: pnpm install
- run: pnpm install --ignore-scripts
- run: pnpm run build
- run: pnpm run test
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ oclif.manifest.json

yarn.lock
package-lock.json


.env
15 changes: 0 additions & 15 deletions .mocharc.json

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignore-build-scripts=false
1 change: 0 additions & 1 deletion .prettierrc.json

This file was deleted.

114 changes: 32 additions & 82 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,113 +1,63 @@


# Contributing

Hey, thanks for your interest in contributing to Dokploy CLI! We appreciate your help and taking your time to contribute.


Before you start, please first discuss the feature/bug you want to add with the owners and comunity via github issues.

We have a few guidelines to follow when contributing to this project:

- [Commit Convention](#commit-convention)
- [Setup](#setup)
- [Development](#development)
- [Build](#build)
- [Pull Request](#pull-request)

## Commit Convention

Before you craete a Pull Request, please make sure your commit message follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.

### Commit Message Format
```
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
```

#### Type
Must be one of the following:

* **feat**: A new feature
* **fix**: A bug fix
* **docs**: Documentation only changes
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **perf**: A code change that improves performance
* **test**: Adding missing tests or correcting existing tests
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
* **chore**: Other changes that don't modify `src` or `test` files
* **revert**: Reverts a previous commit

Example:
```
feat: add new feature
```


Thanks for your interest in contributing to Dokploy CLI!

Before you start, please discuss the feature/bug via [GitHub issues](https://github.com/Dokploy/cli/issues).

## Setup

Before you start, please make the clone based on the `main` branch.

```bash
git clone https://github.com/Dokploy/cli.git
cd cli
pnpm install
```

## Development
Create a `.env` file with your credentials:

First step is to authenticate, you can connect to a dokploy localhost or a remote dokploy server.
```env
DOKPLOY_URL="https://your-server.dokploy.com"
DOKPLOY_API_KEY="YOUR_API_KEY"
```

Authenticate
## Development

```bash
./bin/dev.js authenticate
```
# Run in dev mode
pnpm run dev -- project all

Let's take the example to create a new command for application called `start`.
# Regenerate commands from OpenAPI spec
pnpm run generate

You can use the generators from OCLIF to create a new command.
# Build
pnpm run build

```bash
oclif generate command application:start
# Lint & format
pnpm run lint
```

To run the command, you can use the following command:
### Updating commands

```bash
./bin/dev.js application:start or ./bin/dev.js start
```
Commands in `src/generated/commands.ts` are auto-generated from `openapi.json`. Never edit that file manually. To update:

## Build
1. Replace `openapi.json` with the latest spec from the [Dokploy repo](https://github.com/Dokploy/dokploy)
2. Run `pnpm run generate`

```bash
pnpm run build
```
## Commit convention

## Publish
Follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/):

```bash
pnpm run publish
```
feat: add new feature
fix: resolve bug
docs: update readme
chore: bump version
```

## Pull requests

## Pull Request

- The `main` branch is the source of truth and should always reflect the latest stable release.
- Create a new branch for each feature or bug fix.
- Make sure to add tests for your changes.
- Make sure to update the documentation for any changes Go to the [docs.dokploy.com](https://docs.dokploy.com) website to see the changes.
- When creating a pull request, please provide a clear and concise description of the changes made.
- If you include a video or screenshot, would be awesome so we can see the changes in action.
- If your pull request fixes an open issue, please reference the issue in the pull request description.
- Once your pull request is merged, you will be automatically added as a contributor to the project.
- Branch from `main`
- Provide a clear description of your changes
- Reference any related issues
- Include a screenshot/video if applicable

Thank you for your contribution!

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Mauricio Siu
Copyright (c) 2026 Dokploy Technologies, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 0 additions & 3 deletions bin/dev.cmd

This file was deleted.

6 changes: 0 additions & 6 deletions bin/dev.js

This file was deleted.

3 changes: 0 additions & 3 deletions bin/run.cmd

This file was deleted.

4 changes: 1 addition & 3 deletions bin/run.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env node

import {execute} from '@oclif/core'

await execute({dir: import.meta.url})
import "../dist/index.js";
42 changes: 42 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true,
"includes": ["**", "!**/dist", "!node_modules/**", "!src/generated/**"],
"maxSize": 2097152
},
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"linter": {
"rules": {
"complexity": {
"noUselessCatch": "off"
},
"correctness": {
"noUnusedImports": "error",
"noUnusedFunctionParameters": "error",
"noUnusedVariables": "off"
},
"style": {
"noNonNullAssertion": "off",
"noParameterAssign": "error",
"useAsConstAssertion": "error",
"useDefaultParameterLast": "error",
"useSelfClosingElements": "error",
"useSingleVarDeclarator": "error",
"noUnusedTemplateLiteral": "error",
"useNumberNamespace": "error",
"noInferrableTypes": "error",
"noUselessElse": "error"
},
"suspicious": {
"noExplicitAny": "off",
"noRedeclare": "off"
}
}
}
}
Loading
Loading