aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile43
-rw-r--r--cmd/dbx/main.go9
-rw-r--r--container/Containerfile43
-rwxr-xr-xcontainer/init23
-rwxr-xr-xcontainer/stop20
-rwxr-xr-xdbx681
-rw-r--r--go.mod3
-rw-r--r--internal/cli/cli.go9
-rw-r--r--man/dbx.1.scd22
10 files changed, 63 insertions, 791 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..84c048a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/build/
diff --git a/Makefile b/Makefile
index ca4d168..9a75daf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,31 +1,26 @@
.POSIX:
-PREFIX = $(HOME)/.local
-INSTALL = install
-
-OS ?= $(shell uname -s)
-ifeq ($(OS),Darwin)
- CONTAINER = container
-else
- CONTAINER = podman
-endif
-
-IMAGE = ghcr.io/nlordell/dbx:latest
+GO = go
+GOFLAGS =
+SCDOC = scdoc
.PHONY: all
-all:
- @echo "usage: make [install|container]"
-
-.PHONY: install
-install: dbx
- $(INSTALL) -d $(PREFIX)/bin
- $(INSTALL) -m 755 dbx $(PREFIX)/bin/dbx
+all: build man ;
-.PHONY: container
-container: container/Containerfile container/init
- $(CONTAINER) build --tag $(IMAGE) container
+.PHONY: build
+build:
+ @ mkdir -p build/bin
+ @ $(GO) build $(GOFLAGS) -o build/bin/dbx ./cmd/dbx
.PHONY: check
-check: dbx container/init container/stop
- shellcheck $^
- shfmt -d $^
+check:
+ @ $(GO) fmt ./...
+ @ $(GO) vet -fix ./...
+ @ $(GO) test ./...
+
+.PHONY: man
+man: build/man/man1/dbx.1 ;
+
+build/man/man1/dbx.1: man/dbx.1.scd
+ @ mkdir -p $(@D)
+ @ $(SCDOC) >$@ <man/dbx.1.scd
diff --git a/cmd/dbx/main.go b/cmd/dbx/main.go
new file mode 100644
index 0000000..2c4e2bd
--- /dev/null
+++ b/cmd/dbx/main.go
@@ -0,0 +1,9 @@
+package main
+
+import (
+ "dbx/internal/cli"
+)
+
+func main() {
+ cli.Hello("Go")
+}
diff --git a/container/Containerfile b/container/Containerfile
deleted file mode 100644
index 8aa03ec..0000000
--- a/container/Containerfile
+++ /dev/null
@@ -1,43 +0,0 @@
-FROM docker.io/library/debian:13
-
-# Remove container-specific APT configurations, and install required packages
-RUN rm /etc/apt/apt.conf.d/docker-* && \
- apt-get update && \
- apt-get install -y \
- bash-completion \
- bzip2 \
- curl \
- git \
- gnupg \
- htop \
- less \
- locales \
- man-db \
- manpages \
- nano \
- openssh-client \
- openssh-server \
- procps \
- sudo \
- tini \
- trash-cli \
- tree \
- vim \
- wget \
- zip \
- && \
- apt-get clean && \
- rm -dr /var/lib/apt/lists/*
-
-# Configure locale with UTF-8 support
-RUN update-locale LANG=C.UTF-8 LC_ALL=C.UTF-8
-
-# Configure SSH server
-RUN echo "StreamLocalBindUnlink yes" >> /etc/ssh/sshd_config && \
- echo "AuthorizedKeysFile /etc/ssh/authorized_keys" >> /etc/ssh/sshd_config && \
- touch /etc/ssh/authorized_keys
-
-# Set up the init and stop
-RUN mkdir -p /etc/dbx
-COPY init stop /sbin
-ENTRYPOINT ["/sbin/init"]
diff --git a/container/init b/container/init
deleted file mode 100755
index 3f17b48..0000000
--- a/container/init
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-3.0-only
-# SPDX-FileCopyrightText: 2026 Nicholas Rodrigues Lordello <[email protected]>
-
-if [ "$(id -u)" -ne 0 ]; then
- printf '%s: operation not permitted\n' "$0" >&2
- exit 1
-fi
-
-touch /run/.dbxenv
-printf "%d\n" "$$" >/run/dbx.pid
-
-if [ -f /etc/dbx/init.local ] && [ -x /etc/dbx/init.local ]; then
- /etc/dbx/init.local ||
- printf '%s: init.local failed (%d)\n' "$0" "$?" >&2
-fi
-
-# The init process is not guaranteed to be on PID 1 for all runtimes (notably,
-# `krun` will wrap the init process). Tell tini to act like an init process
-# regardless of its PID.
-export TINI_SUBREAPER=yes
-
-exec /usr/bin/tini /usr/sbin/sshd -- -D -e
diff --git a/container/stop b/container/stop
deleted file mode 100755
index 9affb9c..0000000
--- a/container/stop
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-3.0-only
-# SPDX-FileCopyrightText: 2026 Nicholas Rodrigues Lordello <[email protected]>
-
-if [ "$(id -u)" -ne 0 ]; then
- printf '%s: operation not permitted\n' "$0" >&2
- exit 1
-fi
-
-if [ -x /etc/dbx/stop.local ]; then
- /etc/dbx/stop.local ||
- printf '%s: stop.local failed (%d)\n' "$0" "$?" >&2
-fi
-
-if ! pid="$(cat /run/dbx.pid)"; then
- printf '%s: could not read init PID file, assuming 1\n' "$0" >&2
- pid=1
-fi
-kill -TERM "$pid" ||
- printf '%s: could not stop init[%s] (%d)\n' "$0" "$pid" "$?" >&2
diff --git a/dbx b/dbx
deleted file mode 100755
index 5940e2b..0000000
--- a/dbx
+++ /dev/null
@@ -1,681 +0,0 @@
-#!/usr/bin/env bash
-# SPDX-License-Identifier: GPL-3.0-only
-# SPDX-FileCopyrightText: 2026 Nicholas Rodrigues Lordello <[email protected]>
-
-set -euo pipefail
-
-command=enter
-name="dbx"
-image=ghcr.io/nlordell/dbx:latest
-skel=
-script=
-cpus=
-memory=
-asroot=
-preserve=
-recursive=
-autostart=
-fileonly=
-regenerate=
-args=()
-
-OS="$(uname -s)"
-DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}/dbx"
-CONFIGDIR="${XDG_CONFIG_HOME:-$HOME/.config}/dbx"
-if [ "$OS" = "Linux" ]; then
- RUNTIMEDIR="${XDG_RUNTIME_DIR:-/run/user/$UID}/dbx"
-fi
-
-usage() {
- cat <<USAGE
-usage: $(basename "$0") [COMMAND] [OPTIONS...] [ARGS...]
-commands:
- cp copies files to and from a devbox
- create create a new devbox
- enter opens a shell in a devbox (default: \`dbx enter -s\`)
- exec executes a command in a devbox
- proxy proxies a devbox port to the host
- ssh print devbox \`ssh\` command
- start starts a devbox
- stop stops a devbox
-options:
- -n NAME name of the devbox container (default: $name)
-cp options:
- -R copy files as root instead of the development user
- -p preserve file times and mode bits
- -r copy recursively
-create options:
- -c CPUS number of CPUs allocated to the devbox
- -i IMAGE devbox container image (default: $image)
- -k SKEL overlay skeleton directory onto the user's home
- -m MEMORY amount of memory allocated to the devbox in MiB
- -x SCRIPT override post-installation script
-enter/exec options:
- -R connect as root instead of the development user
- -s start the devbox if necessary
-ssh options:
- -F only print the path to the \`ssh_config\` file
- -g re-generate the SSH configuration
-cp arguments:
- SOURCE... one or more source files to copy from
- TARGET the target to copy to
-exec arguments:
- COMMAND... command and arguments to execute
-proxy arguments:
- PORT[:HOST] the devbox port to proxy on the host; optionally
- specify an alternate host port to bind to
-USAGE
- exit 0
-}
-
-version() {
- printf "0.0.1\n"
- exit 0
-}
-
-has_commands() {
- local cmd
-
- for cmd in "$@"; do
- if ! command -v "$cmd" &>/dev/null; then
- return 1
- fi
- done
- return 0
-}
-
-perror() {
- local code="$1"
- local msg="$2"
-
- printf "%s: %s\n" "$(basename "$0")" "$msg" >&2
- exit "$code"
-}
-
-general_error() { perror 1 "$1"; }
-usage_error() { perror 1 "$1"; }
-
-parse_name() {
- local name="$1"
-
- # Restrict allowed names only lower case letters and digits, with hyphens
- # only allowed in the middle of the name. This is restrictive, but is
- # a valid container name on all supported engines.
- case "$name" in
- "" | [!a-z0-9]* | *[!a-z0-9-]* | *[!a-z0-9])
- usage_error "invalid devbox name '$name'"
- ;;
- esac
- printf "%s\n" "$name"
-}
-
-parse_image() {
- local image="$1"
-
- # Make sure that the image isn't an option passed to the engine.
- case "$image" in
- "" | -*)
- usage_error "invalid image '$image'"
- ;;
- esac
- printf "%s\n" "$image"
-}
-
-parse_int() {
- local val="$1"
- local what="$2"
-
- case "$val" in
- "" | [!1-9]* | *[!0-9]*)
- usage_error "invalid $what '$val'"
- ;;
- esac
- printf "%s\n" "$val"
-}
-
-parse_port() {
- local port="$1"
-
- case "$port" in
- "" | [!1-9]* | *[!0-9]* | ??????*)
- usage_error "invalid port '$port'"
- ;;
- esac
- if [ "$port" -gt 65535 ]; then
- usage_error "invalid port '$port'"
- fi
- printf "%s\n" "$port"
-}
-
-parse_skel() {
- local skel="$1"
-
- if [ ! -d "$skel" ] || [ ! -r "$skel" ] || [ ! -x "$skel" ]; then
- usage_error "directory '$skel' does not exist or is not accessible"
- fi
- case "$skel" in
- *:*) usage_error "invalid skeleton directory path" ;;
- esac
- printf "%s\n" "$skel"
-}
-
-parse_script() {
- local script="$1"
-
- if [ ! -f "$script" ] || [ ! -r "$script" ] || [ ! -x "$script" ]; then
- usage_error "file '$script' does not exist or is not accessible"
- fi
- case "$script" in
- *:*) usage_error "invalid post-installation script path" ;;
- esac
- printf "%s\n" "$script"
-}
-
-parse_opt() {
- local opt="$1"
- local arg="$2"
-
- case "$opt" in
- h) usage ;;
- v) version ;;
- n) name="$(parse_name "$arg")" ;;
- i) image="$(parse_image "$arg")" ;;
- c) cpus="$(parse_int "$arg" "number of CPUs")" ;;
- m) memory="$(parse_int "$arg" "amount of memory")" ;;
- k) skel="$(parse_skel "$arg")" ;;
- x) script="$(parse_script "$arg")" ;;
- R) asroot=t ;;
- p) preserve=t ;;
- r) recursive=t ;;
- s) autostart=t ;;
- F) fileonly=t ;;
- g) regenerate=t ;;
- :) usage_error "missing argument for -$arg" ;;
- \?) usage_error "invalid option -$arg" ;;
- esac
-}
-
-parse_opts() {
- local optstr=":hvn:"
-
- if [ -n "${DBX_NAME-}" ]; then
- name="$(parse_name "$DBX_NAME")"
- fi
-
- OPTIND=1
- while getopts "$optstr" opt; do
- parse_opt "$opt" "${OPTARG-?}"
- done
- shift $((OPTIND - 1))
-
- if [ $# -gt 0 ]; then
- command="$1"
- shift
- else
- autostart=t
- fi
-
- case "$command" in
- cp) optstr="${optstr}Rpr" ;;
- create) optstr="${optstr}c:i:k:m:x:" ;;
- enter | exec) optstr="${optstr}Rs" ;;
- ssh) optstr="${optstr}Fg" ;;
- proxy | start | stop) ;;
- *) usage_error "unknown command '$command'" ;;
- esac
-
- OPTIND=1
- while getopts "$optstr" opt; do
- parse_opt "$opt" "${OPTARG-?}"
- done
- shift $((OPTIND - 1))
-
- case "$command" in
- cp)
- case "$#" in
- 0) usage_error "missing argument 'SOURCE'" ;;
- 1) usage_error "missing argument 'TARGET'" ;;
- esac
-
- # We want to make sure that there are no `host:...` paths that are not
- # for the devbox, and make `:...` paths short-hand for remote paths.
- for f in "$@"; do
- case "$f" in
- "$name":*) ;;
- :*) f="$name$f" ;;
- *:*) usage_error "invalid path specifier '$f'" ;;
- esac
- args+=("$f")
- done
- shift $#
- ;;
- exec)
- case "$#" in
- 0) usage_error "missing argument 'COMMAND'" ;;
- esac
-
- args=("$@")
- shift $#
- ;;
- proxy)
- case "$#" in
- 0) usage_error "missing argument 'PORT'" ;;
- esac
-
- args=("$(parse_port "${1%%:*}")")
- case "$1" in
- *:*) args+=("$(parse_port "${1#*:}")") ;;
- *) args+=("${args[0]}") ;;
- esac
- shift
- ;;
- esac
-
- if [ $# -gt 0 ]; then
- usage_error "unexpected argument '$1'"
- fi
-}
-
-dbx_mkdirs() {
- mkdir -p "$DATADIR" "$CONFIGDIR"
- if [ -n "${RUNTIMEDIR-}" ]; then
- mkdir -p "$RUNTIMEDIR"
- fi
-}
-
-ssh_id() {
- printf "%s\n" "$DATADIR/$name.id_ed25519"
-}
-
-ssh_config() {
- printf "%s\n" "$DATADIR/$name.ssh_config"
-}
-
-ssh_user() {
- local user
-
- if [ -n "$asroot" ]; then
- user="root"
- else
- user="$(id -un)"
- fi
- printf "User=%s\n" "$user"
-}
-
-ssh_knownhosts() {
- printf "%s\n" "$DATADIR/$name.known_hosts"
-}
-
-ssh_init() {
- rm -f "$(ssh_id)" "$(ssh_id).pub" "$(ssh_knownhosts)"
- ssh-keygen -C dbx -f "$(ssh_id)" -N "" -t ed25519 \
- </dev/null >/dev/null 2>/dev/null
-}
-
-ssh_configure() {
- local hostname
- local port
- local userconfig="$CONFIGDIR/$name.ssh_config"
-
- hostname="$(engine_hostname)"
- port="$(engine_port)"
- cat <<SSH_CONFIG >"$(ssh_config)"
-Host $name
- Hostname $hostname
- Port $port
- BatchMode yes
- ConnectTimeout 1
- IdentitiesOnly yes
- IdentityFile "$(ssh_id)"
- PreferredAuthentications publickey
- StrictHostKeyChecking accept-new
- UserKnownHostsFile "$(ssh_knownhosts)"
- Include "$userconfig"
-SSH_CONFIG
-}
-
-ssh_waitforsshd() {
- for _ in {1..20}; do
- if ssh -q -F "$(ssh_config)" "root@$name" true; then
- return 0
- fi
- sleep 0.1 2>/dev/null || sleep 1
- done
- general_error "devbox SSH server did not become ready"
-}
-
-cmd_cp() {
- local flags=()
-
- if [ -n "$preserve" ]; then
- flags+=("-p")
- fi
- if [ -n "$recursive" ]; then
- flags+=("-r")
- fi
- flags+=("--")
-
- exec scp -F "$(ssh_config)" -o "$(ssh_user)" "${flags[@]}" "$@"
-}
-
-cmd_create() {
- local user
-
- if engine_iscreated; then
- general_error "devbox name in use"
- fi
-
- dbx_mkdirs
- ssh_init
- engine_create
-
- cmd_start
- if [ -n "$skel" ]; then
- scp -q -F "$(ssh_config)" -p -r -- "${skel%/}/." "$name:"
- fi
- if [ -n "$script" ]; then
- scp -q -F "$(ssh_config)" -p -- "$script" "root@$name:/tmp/post-install"
- fi
-
- user="$(id -un)"
- ssh -q -F "$(ssh_config)" "root@$name" "
- if [ -f /tmp/post-install ] && [ -x /tmp/post-install ]; then
- /tmp/post-install '$user' && rm /tmp/post-install
- elif [ -f /etc/dbx/post-install ] && [ -x /etc/dbx/post-install ]; then
- /etc/dbx/post-install '$user'
- fi
- "
- engine_stop
-}
-
-cmd_enter() { cmd_exec "$@"; }
-cmd_exec() {
- if [ -n "$autostart" ]; then
- cmd_start
- elif ! engine_isrunning; then
- general_error 'devbox is not started'
- fi
- exec ssh -q -F "$(ssh_config)" -o "$(ssh_user)" "$name" -- "$@"
-}
-
-cmd_proxy() {
- local devboxport="$1"
- local hostport="$2"
-
- if ! engine_isrunning; then
- general_error 'devbox is not started'
- fi
-
- exec ssh -q -F "$(ssh_config)" \
- -o "ExitOnForwardFailure=yes" \
- -L "localhost:$hostport:localhost:$devboxport" -N \
- "$name"
-}
-
-cmd_ssh() {
- if ! engine_iscreated || [ ! -f "$(ssh_id)" ]; then
- general_error "devbox not created"
- fi
-
- if [ -n "$regenerate" ]; then
- ssh_configure
- fi
-
- if [ -n "$fileonly" ]; then
- ssh_config
- else
- printf "ssh -F %q %s\n" "$(ssh_config)" "$name"
- fi
-}
-
-cmd_start() {
- if engine_isrunning; then
- return 0
- fi
-
- dbx_mkdirs
- engine_start
- ssh_configure
- ssh_waitforsshd
-}
-
-cmd_stop() {
- # Stop the devbox, ensuring that any configured local stop script is
- # run. Furthermore, the `krun` runtime does not support sending the
- # `SIGTERM` signal to container processes for `podman stop` to work,
- # so this also ensures that the init process is correctly terminated.
- ssh -q -F "$(ssh_config)" "root@$name" -- \
- "/sbin/stop" \
- &>/dev/null || true
-
- # Additionally, defensively ask the engine to stop the devbox in case
- # something went wrong.
- engine_stop
-}
-
-vm_cpus() {
- local cpus="${cpus-}"
-
- if [ -z "$cpus" ]; then
- if [ "$OS" = "Darwin" ]; then
- cpus="$(sysctl -n hw.ncpu)"
- else
- cpus="$(grep -c '^processor[[:space:]]*:' /proc/cpuinfo)"
- fi
- cpus="$((cpus <= 32 ? (cpus + 1) / 2 : 16))"
- fi
- printf "%d\n" "$cpus"
-}
-
-vm_memory() {
- local memory="${memory-}"
-
- if [ -z "$memory" ]; then
- if [ "$OS" = "Darwin" ]; then
- memory="$(sysctl -n hw.memsize)"
- else
- memory="$(awk '/^MemTotal:/ {printf "%d", $2 * 1024}' /proc/meminfo)"
- memory=$((memory / 1048576))
- fi
- memory="$(((memory + 1) / 2))"
- fi
- printf "%d\n" "$memory"
-}
-
-if [ "$OS" = "Darwin" ] && has_commands container; then
- engine_init() {
- if ! container system status &>/dev/null; then
- general_error "container engine not running"
- fi
- }
-
- engine_create() {
- local user
-
- # Use a plain container for the devbox instead of a container
- # machine. Note that a container machine - even with the home
- # mounting disabled - runs with all Linux capabilities, no masked
- # or read-only `/proc` and `/sys` paths, and forwards the SSH agent
- # into the container, making it much less isolated.
- #
- # Note that, unlike container machines, container resources may
- # only be configured at creation time, so they cannot be set from
- # `engine_start`.
- container create \
- --name="$name" \
- --cpus="$(vm_cpus)" \
- --memory="$(vm_memory)M" \
- "$image" >/dev/null
-
- engine_start
-
- # Provision the devbox. Note that a plain container - unlike a
- # container machine - does not get an automatically provisioned
- # user matching the host user, so create that, and authorise our
- # SSH key. No `sudo` access is granted; the expectation is to use
- # `-R` to perform privileged operations.
- #
- # Note that unlike on Linux, the devbox user is not given the host
- # user's UID and GID, as macOS uses a different set of *ID semantics
- # than Linux (e.g. the typical `staff` group is GID 20 which is
- # `dialout` on Debian).
- user="$(id -un)"
- container exec \
- --user=root \
- "$name" \
- sh -c "
- set -eu
- printf '%s\n' '$(cat "$(ssh_id).pub")' > /etc/ssh/authorized_keys
- useradd -m -s \"\$(command -v bash)\" '$user'
- "
- engine_stop
- }
-
- engine_start() {
- container start "$name" >/dev/null
- }
-
- engine_stop() {
- container stop "$name" >/dev/null
- }
-
- engine_iscreated() {
- container inspect "$name" &>/dev/null
- }
-
- engine_isrunning() {
- local state
-
- state="$(
- container inspect "$name" 2>/dev/null |
- grep '"state"' |
- cut -d'"' -f4
- )"
- [ "$state" = "running" ]
- }
-
- engine_hostname() {
- local ipaddress
-
- ipaddress="$(
- container inspect "$name" |
- grep '"ipv4Address"' |
- head -n 1 |
- cut -d'"' -f4
- )"
- ipaddress="${ipaddress%%/*}"
- if [ -z "$ipaddress" ]; then
- general_error "failed to read devbox IP address"
- fi
- printf "%s\n" "$ipaddress"
- }
-
- engine_port() {
- printf "22\n"
- }
-elif [ "$OS" = "Linux" ] && has_commands podman krun; then
- krun_vmconfig() {
- printf "%s\n" "$CONFIGDIR/$name.krun_vm.json"
- }
-
- engine_init() {
- if [ "$(id -u)" -eq 0 ]; then
- general_error "krun runtime insecure as root"
- fi
- }
-
- engine_create() {
- local user
- local uid
- local gid
-
- # Set the default `krun` VM configuration. Do not overwrite existing
- # user configuration if the file already exists.
- if [ ! -f "$(krun_vmconfig)" ]; then
- cat <<CONFIG >"$(krun_vmconfig)"
-{
- "cpus": $(vm_cpus),
- "ram_mib": $(vm_memory),
- "use_passt": 1
-}
-CONFIG
- fi
-
- podman create \
- --runtime=krun \
- --name="$name" \
- --hostname="$name" \
- --network="pasta:--no-map-gw,--map-guest-addr,none" \
- --publish="127.0.0.1::22" \
- --sysctl="net.ipv4.ip_unprivileged_port_start=0" \
- "$image" \
- >/dev/null
- podman cp "$(ssh_id).pub" "$name:/etc/ssh/authorized_keys"
-
- # Provision the user on the devbox. The `krun` runtime does not
- # support `podman exec` so execute the script over SSH.
- engine_start
- ssh_configure
- ssh_waitforsshd
- user="$(id -un)"
- uid="$(id -u)"
- gid="$(id -g)"
- ssh -q -F "$(ssh_config)" "root@$name" "
- set -eu
- if ! getent group '$gid' >/dev/null; then
- groupadd -g '$gid' '$user'
- fi
- useradd -g '$gid' -m -s \"\$(command -v bash)\" -u '$uid' '$user'
- "
- engine_stop
- }
-
- engine_start() {
- # As a security precaution, do not allow image-provided `krun`
- # configurations, and write one from the host. This greatly reduces
- # the possible attack surface from the devbox, as it does not allow
- # an attacker to control VM startup options (e.g. a custom kernel).
- podman cp "$(krun_vmconfig)" "$name:/.krun_vm.json"
- podman start "$name" >/dev/null
- }
-
- engine_stop() {
- podman stop "$name" >/dev/null
- }
-
- engine_iscreated() {
- podman container inspect "$name" &>/dev/null
- }
-
- engine_isrunning() {
- local running
-
- running="$(
- podman container inspect --format="{{.State.Running}}" "$name" 2>/dev/null
- )"
- [ "$running" = "true" ]
- }
-
- engine_hostname() {
- printf "127.0.0.1\n"
- }
-
- engine_port() {
- local mapping
-
- mapping="$(podman port "$name" 22/tcp | head -n 1)"
- parse_port "${mapping##*:}"
- }
-else
- engine_init() {
- general_error "no supported container engine installed"
- }
-fi
-
-main() {
- parse_opts "$@"
- engine_init
- "cmd_$command" ${args[@]+"${args[@]}"}
-}
-
-main "$@"
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..a32d52c
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,3 @@
+module dbx
+
+go 1.27
diff --git a/internal/cli/cli.go b/internal/cli/cli.go
new file mode 100644
index 0000000..67c706f
--- /dev/null
+++ b/internal/cli/cli.go
@@ -0,0 +1,9 @@
+package cli
+
+import (
+ "fmt"
+)
+
+func Hello(name string) {
+ fmt.Printf("Hello, %s!\n", name)
+}
diff --git a/man/dbx.1.scd b/man/dbx.1.scd
new file mode 100644
index 0000000..927bfa3
--- /dev/null
+++ b/man/dbx.1.scd
@@ -0,0 +1,22 @@
+dbx(1)
+
+# NAME
+
+dbx - sandboxed agentic development environments
+
+# SYNOPSIS
+
+*dbx* [_options_] [_args_]
+
+# DESCRIPTION
+
+*dbx* is a tool for things.
+
+# OPTIONS
+
+*-h*, *--help*
+ Show help message and quit.
+
+# AUTHORS
+
+Created and maintained by Nicholas Rodrigues Lordello <[email protected]>.