TL;DR: We open-sourced dtctl, a CLI for Dynatrace that brings terminal-native workflows and AI agent integration to the platform. Manage workflows, dashboards, SLOs, and 20+ resource types from your terminal or let your AI coding assistant do it. Install it with brew install dynatrace-oss/tap/dtctl.
When you’re scripting a deployment pipeline, managing configurations across environments, or letting an AI agent operate your observability stack -- you want a CLI.
What is dtctl?
dtctl is a CLI that gives you a consistent interface to the Dynatrace platform. Single binary, zero dependencies, runs on Linux, macOS, and Windows. One grammar, one tool, all resources:
dtctl get workflows <span class="hljs-comment"># list all workflows</span>
dtctl describe dashboard my-dashboard <span class="hljs-comment"># inspect a dashboard by name</span>
dtctl apply -f slo.yaml <span class="hljs-comment"># create or update -- idempotently</span>
dtctl query <span class="hljs-string">"fetch logs | limit 10"</span> <span class="hljs-comment"># run DQL right from your terminal</span>
dtctl <span class="hljs-built_in">exec</span> copilot <span class="hljs-string">"What caused the spike?"</span> <span class="hljs-comment"># ask Davis CoPilot</span>
If you’ve used tools like kubectl or gh, the pattern will feel familiar: verb first, resource second, done.
The project is open source under Apache 2.0 and available on GitHub: dynatrace-oss/dtctl.
What It Gives You
You automate everything else -- why not your observability platform?
Here’s what dtctl gives you over raw API calls:
- OAuth login.
dtctl auth loginopens your browser for SSO authentication -- no more copying API tokens around. Tokens are stored in your OS keyring and refreshed automatically. - Multi-environment management. Switch between dev, staging, and prod with
dtctl config use-context prod. - Idempotent apply.
dtctl apply -f workflow.yamlcreates if new, updates if it exists. No more manual GET-then-POST-or-PUT dances. - Flexible output formats. Switch between table, JSON, YAML, and CSV with
-o json,-o yaml, etc. Pipe it intojq, feed it to another script, or just read a table. - Name resolution. Use human-readable names instead of UUIDs. When names collide, dtctl asks which one you mean.
--minefilter. Scope any listing to resources you own withdtctl get workflows --mine. Handy in shared environments.- DQL templates. Parameterize queries with
--set env=prod --set host=h-123and reuse them across environments. - Safety guardrails. Set your production context to
readonlyand sleep well at night. Context-based safety levels prevent accidental mutations before they hit the wire (client side enforcement). - Shell completions. Tab-complete commands, resource types, and flags in bash, zsh, fish, and PowerShell.
- Watch mode.
dtctl get workflows --watchgives you a live-updating terminal view with color-coded change indicators.
Built for AI Agents
CLI tools are a natural fit for AI coding agents -- they’re already running in a terminal, and a well-structured command with predictable output is exactly the kind of interface an LLM can use reliably. dtctl was designed from the ground up with this in mind, serving as an interface between AI coding agents and the Dynatrace platform. Run it with --plain -o json and any agent gets clean structured output it can reason about -- no spinners, no color codes, no interactive prompts.
It ships with a built-in skill file that teaches AI assistants how to operate your Dynatrace environment. Drop it into your project, and your agent can query logs, check SLO status, trigger workflows, and manage configurations without you writing a single line of glue code.
What’s Supported?
Over 20 resource types today, including workflows, dashboards, notebooks, SLOs, buckets, settings, apps, functions, notifications, users, groups, and cloud connections (Azure, GCP). Most support full CRUD, plus extras like history, restore, diff, share, and watch where the underlying API allows it.
Check the implementation status matrix for the full picture.
Getting Started
<span class="hljs-comment"># Install via Homebrew</span>
brew install dynatrace-oss/tap/dtctl
<span class="hljs-comment"># Configure your first context</span>
dtctl config set-context my-env \
--url https://abc12345.apps.dynatrace.com \
--token <your-api-token>
<span class="hljs-comment"># Start exploring</span>
dtctl get workflows
dtctl get dashboards --mine
dtctl query <span class="hljs-string">"fetch logs | filter loglevel == \"ERROR\" | limit 5"</span>
For detailed setup options (binary download, building from source, shell completions), see the Installation Guide. For hands-on examples covering all resource types, check the Quick Start Guide.
See It in Action
Want to see dtctl in action before installing? Check out the demo video on YouTube.
We’d Love Your Feedback
This is an early release -- v0.13.0 as of this writing -- and we’re actively shaping the tool based on real-world usage. If you have ideas, find bugs, or want to contribute, head over to the GitHub repo and open an issue. And if you find dtctl useful, drop us a star on GitHub -- it helps others discover the project and keeps us motivated.