@kmlckj/licos-ai-cli 0.0.55 → 0.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,6 +27,9 @@ export LICOS_PROJECT_PATH="$PROJECT_DIR"
27
27
  export AGENT_PROJECT_TYPE="${AGENT_PROJECT_TYPE:-AGENT}"
28
28
 
29
29
  PYTHON_BIN="${PYTHON_BIN:-python}"
30
+ if ! command -v "$PYTHON_BIN" >/dev/null 2>&1 && command -v python3 >/dev/null 2>&1; then
31
+ PYTHON_BIN=python3
32
+ fi
30
33
  if [ -x "$PROJECT_DIR/.venv/bin/python" ]; then
31
34
  PYTHON_BIN="$PROJECT_DIR/.venv/bin/python"
32
35
  fi
@@ -16,18 +16,59 @@ EOF
16
16
 
17
17
  ensure_pip_config
18
18
 
19
- PIP_ARGS=(--no-cache-dir)
20
- if python -m pip install --help 2>/dev/null | grep -q -- "--break-system-packages"; then
21
- PIP_ARGS+=(--break-system-packages)
19
+ PYTHON_BIN="${PYTHON_BIN:-python}"
20
+ if ! command -v "$PYTHON_BIN" >/dev/null 2>&1 && command -v python3 >/dev/null 2>&1; then
21
+ PYTHON_BIN=python3
22
22
  fi
23
- if [ -n "${PIP_TARGET:-}" ]; then
24
- PIP_ARGS+=(--target "$PIP_TARGET")
23
+ PIP_PYTHON="$PYTHON_BIN"
24
+
25
+ GLOBAL_PIP_ARGS=(--no-cache-dir)
26
+ if "$PYTHON_BIN" -m pip install --help 2>/dev/null | grep -q -- "--break-system-packages"; then
27
+ GLOBAL_PIP_ARGS+=(--break-system-packages)
25
28
  fi
26
29
 
30
+ ensure_project_venv() {
31
+ local venv_dir="$PROJECT_DIR/.venv"
32
+
33
+ if [ -x "$venv_dir/bin/python" ] && "$venv_dir/bin/python" -m pip --version >/dev/null 2>&1; then
34
+ PIP_PYTHON="$venv_dir/bin/python"
35
+ return
36
+ fi
37
+
38
+ rm -rf "$venv_dir"
39
+ echo "[setup] Creating project virtualenv at $venv_dir"
40
+ if ! "$PYTHON_BIN" -m venv "$venv_dir" >/dev/null 2>&1; then
41
+ echo "[setup] python -m venv unavailable; installing virtualenv fallback"
42
+ "$PYTHON_BIN" -m pip install "${GLOBAL_PIP_ARGS[@]}" virtualenv
43
+ "$PYTHON_BIN" -m virtualenv "$venv_dir"
44
+ fi
45
+
46
+ PIP_PYTHON="$venv_dir/bin/python"
47
+ "$PIP_PYTHON" -m pip --version >/dev/null
48
+ }
49
+
50
+ PIP_ARGS=()
51
+ refresh_pip_args() {
52
+ PIP_ARGS=(--no-cache-dir)
53
+ if "$PIP_PYTHON" -m pip install --help 2>/dev/null | grep -q -- "--break-system-packages"; then
54
+ PIP_ARGS+=(--break-system-packages)
55
+ fi
56
+ if [ -n "${PIP_TARGET:-}" ]; then
57
+ PIP_ARGS+=(--target "$PIP_TARGET")
58
+ fi
59
+ }
60
+
61
+ refresh_pip_args
62
+
27
63
  install_pyproject_dependencies_with_pip() {
64
+ if [ -z "${PIP_TARGET:-}" ]; then
65
+ ensure_project_venv
66
+ fi
67
+ refresh_pip_args
68
+
28
69
  local deps_file
29
70
  deps_file="$(mktemp)"
30
- python - "$deps_file" <<'PY'
71
+ "$PIP_PYTHON" - "$deps_file" <<'PY'
31
72
  import sys
32
73
  import tomllib
33
74
  from pathlib import Path
@@ -48,7 +89,7 @@ PY
48
89
  if [ -s "$deps_file" ]; then
49
90
  echo "[setup] Pip mode: installing dependencies from pyproject.toml"
50
91
  local status=0
51
- python -m pip install "${PIP_ARGS[@]}" -r "$deps_file" || status=$?
92
+ "$PIP_PYTHON" -m pip install "${PIP_ARGS[@]}" -r "$deps_file" || status=$?
52
93
  rm -f "$deps_file"
53
94
  return "$status"
54
95
  else
@@ -73,8 +114,12 @@ if command -v uv >/dev/null 2>&1 && [ -f "pyproject.toml" ]; then
73
114
  elif [ -f "pyproject.toml" ]; then
74
115
  install_pyproject_dependencies_with_pip
75
116
  elif [ -f "requirements.txt" ]; then
117
+ if [ -z "${PIP_TARGET:-}" ]; then
118
+ ensure_project_venv
119
+ fi
120
+ refresh_pip_args
76
121
  echo "[setup] Fallback mode (pip): installing from requirements.txt"
77
- python -m pip install "${PIP_ARGS[@]}" -r requirements.txt
122
+ "$PIP_PYTHON" -m pip install "${PIP_ARGS[@]}" -r requirements.txt
78
123
  else
79
124
  echo "[setup] no pyproject.toml or requirements.txt found, skipping install"
80
125
  fi
@@ -27,6 +27,9 @@ export LICOS_PROJECT_PATH="$PROJECT_DIR"
27
27
  export AGENT_PROJECT_TYPE="${AGENT_PROJECT_TYPE:-WORKFLOW}"
28
28
 
29
29
  PYTHON_BIN="${PYTHON_BIN:-python}"
30
+ if ! command -v "$PYTHON_BIN" >/dev/null 2>&1 && command -v python3 >/dev/null 2>&1; then
31
+ PYTHON_BIN=python3
32
+ fi
30
33
  if [ -x "$PROJECT_DIR/.venv/bin/python" ]; then
31
34
  PYTHON_BIN="$PROJECT_DIR/.venv/bin/python"
32
35
  fi
@@ -16,18 +16,59 @@ EOF
16
16
 
17
17
  ensure_pip_config
18
18
 
19
- PIP_ARGS=(--no-cache-dir)
20
- if python -m pip install --help 2>/dev/null | grep -q -- "--break-system-packages"; then
21
- PIP_ARGS+=(--break-system-packages)
19
+ PYTHON_BIN="${PYTHON_BIN:-python}"
20
+ if ! command -v "$PYTHON_BIN" >/dev/null 2>&1 && command -v python3 >/dev/null 2>&1; then
21
+ PYTHON_BIN=python3
22
22
  fi
23
- if [ -n "${PIP_TARGET:-}" ]; then
24
- PIP_ARGS+=(--target "$PIP_TARGET")
23
+ PIP_PYTHON="$PYTHON_BIN"
24
+
25
+ GLOBAL_PIP_ARGS=(--no-cache-dir)
26
+ if "$PYTHON_BIN" -m pip install --help 2>/dev/null | grep -q -- "--break-system-packages"; then
27
+ GLOBAL_PIP_ARGS+=(--break-system-packages)
25
28
  fi
26
29
 
30
+ ensure_project_venv() {
31
+ local venv_dir="$PROJECT_DIR/.venv"
32
+
33
+ if [ -x "$venv_dir/bin/python" ] && "$venv_dir/bin/python" -m pip --version >/dev/null 2>&1; then
34
+ PIP_PYTHON="$venv_dir/bin/python"
35
+ return
36
+ fi
37
+
38
+ rm -rf "$venv_dir"
39
+ echo "[setup] Creating project virtualenv at $venv_dir"
40
+ if ! "$PYTHON_BIN" -m venv "$venv_dir" >/dev/null 2>&1; then
41
+ echo "[setup] python -m venv unavailable; installing virtualenv fallback"
42
+ "$PYTHON_BIN" -m pip install "${GLOBAL_PIP_ARGS[@]}" virtualenv
43
+ "$PYTHON_BIN" -m virtualenv "$venv_dir"
44
+ fi
45
+
46
+ PIP_PYTHON="$venv_dir/bin/python"
47
+ "$PIP_PYTHON" -m pip --version >/dev/null
48
+ }
49
+
50
+ PIP_ARGS=()
51
+ refresh_pip_args() {
52
+ PIP_ARGS=(--no-cache-dir)
53
+ if "$PIP_PYTHON" -m pip install --help 2>/dev/null | grep -q -- "--break-system-packages"; then
54
+ PIP_ARGS+=(--break-system-packages)
55
+ fi
56
+ if [ -n "${PIP_TARGET:-}" ]; then
57
+ PIP_ARGS+=(--target "$PIP_TARGET")
58
+ fi
59
+ }
60
+
61
+ refresh_pip_args
62
+
27
63
  install_pyproject_dependencies_with_pip() {
64
+ if [ -z "${PIP_TARGET:-}" ]; then
65
+ ensure_project_venv
66
+ fi
67
+ refresh_pip_args
68
+
28
69
  local deps_file
29
70
  deps_file="$(mktemp)"
30
- python - "$deps_file" <<'PY'
71
+ "$PIP_PYTHON" - "$deps_file" <<'PY'
31
72
  import sys
32
73
  import tomllib
33
74
  from pathlib import Path
@@ -48,7 +89,7 @@ PY
48
89
  if [ -s "$deps_file" ]; then
49
90
  echo "[setup] Pip mode: installing dependencies from pyproject.toml"
50
91
  local status=0
51
- python -m pip install "${PIP_ARGS[@]}" -r "$deps_file" || status=$?
92
+ "$PIP_PYTHON" -m pip install "${PIP_ARGS[@]}" -r "$deps_file" || status=$?
52
93
  rm -f "$deps_file"
53
94
  return "$status"
54
95
  else
@@ -73,8 +114,12 @@ if command -v uv >/dev/null 2>&1 && [ -f "pyproject.toml" ]; then
73
114
  elif [ -f "pyproject.toml" ]; then
74
115
  install_pyproject_dependencies_with_pip
75
116
  elif [ -f "requirements.txt" ]; then
117
+ if [ -z "${PIP_TARGET:-}" ]; then
118
+ ensure_project_venv
119
+ fi
120
+ refresh_pip_args
76
121
  echo "[setup] Fallback mode (pip): installing from requirements.txt"
77
- python -m pip install "${PIP_ARGS[@]}" -r requirements.txt
122
+ "$PIP_PYTHON" -m pip install "${PIP_ARGS[@]}" -r requirements.txt
78
123
  else
79
124
  echo "[setup] no pyproject.toml or requirements.txt found, skipping install"
80
125
  fi
package/lib/cli.js CHANGED
@@ -2109,7 +2109,7 @@ const EventBuilder = {
2109
2109
  };
2110
2110
 
2111
2111
  var name = "@kmlckj/licos-ai-cli";
2112
- var version = "0.0.55";
2112
+ var version = "0.0.56";
2113
2113
  var description = "LICOS AI coding workspace CLI - project template engine and dev tools";
2114
2114
  var license = "MIT";
2115
2115
  var author = "kmlckj";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmlckj/licos-ai-cli",
3
- "version": "0.0.55",
3
+ "version": "0.0.56",
4
4
  "description": "LICOS AI coding workspace CLI - project template engine and dev tools",
5
5
  "license": "MIT",
6
6
  "author": "kmlckj",