Skip to content

Conversation

@obrera
Copy link
Collaborator

@obrera obrera commented Feb 9, 2026

Enables oclif's built-in enableJsonFlag on all commands. When --json is passed, human-readable output (chalk colors, tables) is suppressed and the command returns structured JSON instead.

Changes

  • Add static enableJsonFlag = true to all command classes
  • Replace console.log with this.log (required for oclif's json suppression to work)
  • Return data from run() methods for json serialization
  • Fix missing environmentId in redis create flags destructuring (pre-existing bug)

Usage

# Human-readable (unchanged)
dokploy project list

# JSON output
dokploy project list --json
dokploy project info -p <projectId> --json
dokploy app create -p <id> -e <id> -n myapp --appName myapp -y --json

Why

The CLI is currently unusable for scripting and automation — all output is chalk-colored human text with no structured alternative. This is the foundation for making the CLI scriptable.

Enable oclif's built-in enableJsonFlag on all commands. When --json is
passed, human-readable output is suppressed and the command returns
structured JSON instead.

Changes:
- Add static enableJsonFlag = true to all command classes
- Replace console.log with this.log (required for json suppression)
- Return data from run() methods for json serialization
- Fix missing environmentId in redis create flags destructuring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant