From 9b49c6e73dc1a920d960353ea729d1981f0fe17b Mon Sep 17 00:00:00 2001 From: Fredrik Lassen Date: Wed, 4 Mar 2026 11:16:53 +0100 Subject: [PATCH] #37 - wrap 1x-ai command --- commands/host/1x-ai | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 commands/host/1x-ai diff --git a/commands/host/1x-ai b/commands/host/1x-ai new file mode 100755 index 0000000..b16f8ad --- /dev/null +++ b/commands/host/1x-ai @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +## #ddev-generated +## Description: 1X AI integration +## Usage: 1x-ai +## Example: "ddev 1x-ai --help" + +## @todo: Check whether to run inside container. @see https://github.com/e0ipso/ddev-assistant-claude + +## @todo: check for npm/npx installed +if ! command -v npm 2>&1 >/dev/null +then + echo "Notice: npm (node) not found." + exit 1 +fi + +## @todo: check for @1xINTERNET token +# Let's make sure @dxp-scoped package registry is defined as it required in the starterkit below. +ONEX_REGISTRY=$(npm config get @1xINTERNET:registry) + +if [ -z "$ONEX_REGISTRY" ] || [ "$ONEX_REGISTRY" = "none" ] || [ "$ONEX_REGISTRY" = "undefined" ] ; then + echo "The @1xINTERNET-scope is not configured one the host. Consider running the command 'ddev 1x-token-setup'!" + exit 1 +fi + + +## Run 1x-ai +npx @1xINTERNET/1x-ai@latest "${@:1}" \ No newline at end of file