feat: add exec command for interactive container terminal access
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- docker, typescript
Research direction
Start by reading the existing CLI command structure and the API flow named in the issue: project.all, application.one, and docker.getContainersByAppLabel. Review src/commands/exec.ts and the README changes, then verify the documented interactive and command modes across the listed service types. Done means the command resolves the intended running container, maintains terminal input/output, authenticates with x-api-key, and is documented.
Written by the indexing model from the issue text.
Description
Summary
Add an exec command that allows users to open interactive terminal sessions in running Dokploy containers directly from the CLI — similar to heroku run.
Motivation
Currently, the only way to get terminal access to a running container is through the Dokploy web panel's Terminal tab. There's no CLI equivalent, which makes it difficult to:
- Run one-off commands like
rails c,python manage.py shell, or database migrations - Integrate with local development workflows and scripts
- Provide quick terminal access without opening a browser
This is a commonly expected feature for PaaS CLI tools (Heroku, Fly.io, Railway all support it).
Proposed solution
A new hand-authored command (src/commands/exec.ts) that:
- Resolves the service name to a running container via the existing Dokploy API (
project.all→application.one→docker.getContainersByAppLabel) - Connects via WebSocket to the
/docker-container-terminalendpoint (the same protocol the web panel uses) - Pipes raw stdin/stdout for an interactive terminal session
Usage
# Interactive shell
dokploy exec --app Web
# Run a command
dokploy exec --app Web rails c
# Disambiguate across projects/environments
dokploy exec --project "My Project" --env staging --app Web rails c
Supported service types
Works with all Dokploy service types: applications, redis, postgres, mongo, mysql, mariadb, and compose.
Authentication
Uses the existing x-api-key authentication — no SSH access to the server required. Teammates only need a Dokploy API key.
Implementation
I have a working implementation ready to submit as a PR. It adds:
src/commands/exec.ts— the new commandwsdependency — for WebSocket client- Updated README with usage docs
Happy to adjust the implementation based on feedback.
- Dominant language
- TypeScript
- Stars
- 152
- Forks
- 46
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Dokploy/cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 4/5 3-5 days Newbie friendliness 62/100
Similar issues
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100