Metadata-Version: 2.4
Name: dnctl
Version: 0.1.2
Summary: Manage your DevNomads services from the command line
Author-email: DevNomads <support@devnomads.nl>
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.12
Requires-Dist: httpx>=0.27
Requires-Dist: rich>=13
Requires-Dist: cryptography>=42
Dynamic: license-file

# dnctl

Manage your [DevNomads](https://devnomads.nl) services from the
command line: inspect your services, manage DNS zones and records,
and move zones over from other providers - from a shell or a script.

## Install

```sh
pip install dnctl
```

For a global, isolated install (recommended on workstations), use
[uv](https://docs.astral.sh/uv/) or pipx instead - same result, no
interference with system packages:

```sh
uv tool install dnctl      # or: pipx install dnctl
```

Enable shell completion (bash, zsh, fish, PowerShell):

```sh
dnctl --install-completion
```

## Getting started

Create an API key in the [DevNomads
portal](https://portal.devnomads.nl) under **Profiel -> API
Sleutels**, then store it:

```sh
dnctl configure
```

The key is written to `~/.config/dnctl/credentials`, readable only
by you. From here every command works:

```sh
dnctl services list
dnctl domains list
dnctl containers show <id>
```

Every DevNomads product has its own command group - `apps`,
`buckets`, `containers`, `databases`, `domains`, `emails`,
`forwards`, `proxies`, `servers`, `sites` and more. Explore with
`dnctl --help` and `dnctl <group> --help`.

Commands accept any unambiguous prefix: `dnctl e l` is `dnctl emails
list`. An ambiguous prefix lists the candidates.

## Managing DNS

```sh
dnctl dns zones list
dnctl dns zones show example.com
dnctl dns records list example.com
dnctl dns records set example.com www A 192.0.2.1 --ttl 3600
dnctl dns records delete example.com www A
```

## Moving a zone from another provider

`dnctl dns transfer` copies a zone from your current DNS provider
into DevNomads. It reads the records at the source (never writes
there), shows you the changes, and applies them after confirmation:

```sh
dnctl configure --provider transip       # store source credentials
dnctl dns transfer --from transip --zone example.com --dry-run
dnctl dns transfer --from transip --zone example.com
```

Supported source providers: TransIP and AuroraDNS. The zone must
already exist at DevNomads; register or transfer the domain in the
portal first.

## Multiple accounts

Store each account as a named profile and select it per command or
per shell:

```sh
dnctl configure --profile acme
dnctl services list --profile acme
export DN_PROFILE=acme
```

## Scripting

Output is a human-readable table on a terminal and JSON when piped,
so pipelines get parseable output without any flags; `--output
json|table` forces either. Data goes to stdout, everything else
(warnings, prompts, status messages) to stderr, so `dnctl ... | jq .`
is always safe.

In CI and pipelines, skip the credentials file and pass the key via
the environment:

```sh
export DN_API_KEY=...        # beats any stored profile
dnctl services list | jq -r '.[].entity'
```

## License

MIT.
