You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: registry/coder-labs/modules/codex/scripts/start.sh
+27-27Lines changed: 27 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ source "$HOME"/.bashrc
5
5
set -o errexit
6
6
set -o pipefail
7
7
command_exists() {
8
-
command -v "$1">/dev/null 2>&1
8
+
command -v "$1">/dev/null 2>&1
9
9
}
10
10
11
11
if [ -f"$HOME/.nvm/nvm.sh" ];then
@@ -30,53 +30,53 @@ set +o nounset
30
30
CODEX_ARGS=()
31
31
32
32
if command_exists codex;then
33
-
printf"Codex is installed\n"
33
+
printf"Codex is installed\n"
34
34
else
35
-
printf"Error: Codex is not installed. Please enable install_codex or install it manually\n"
36
-
exit 1
35
+
printf"Error: Codex is not installed. Please enable install_codex or install it manually\n"
36
+
exit 1
37
37
fi
38
38
39
39
if [ -d"${ARG_CODEX_START_DIRECTORY}" ];then
40
-
printf"Directory '%s' exists. Changing to it.\\n""${ARG_CODEX_START_DIRECTORY}"
41
-
cd"${ARG_CODEX_START_DIRECTORY}"|| {
42
-
printf"Error: Could not change to directory '%s'.\\n""${ARG_CODEX_START_DIRECTORY}"
43
-
exit 1
44
-
}
40
+
printf"Directory '%s' exists. Changing to it.\\n""${ARG_CODEX_START_DIRECTORY}"
41
+
cd"${ARG_CODEX_START_DIRECTORY}"|| {
42
+
printf"Error: Could not change to directory '%s'.\\n""${ARG_CODEX_START_DIRECTORY}"
43
+
exit 1
44
+
}
45
45
else
46
-
printf"Directory '%s' does not exist. Creating and changing to it.\\n""${ARG_CODEX_START_DIRECTORY}"
47
-
mkdir -p "${ARG_CODEX_START_DIRECTORY}"|| {
48
-
printf"Error: Could not create directory '%s'.\\n""${ARG_CODEX_START_DIRECTORY}"
49
-
exit 1
50
-
}
51
-
cd"${ARG_CODEX_START_DIRECTORY}"|| {
52
-
printf"Error: Could not change to directory '%s'.\\n""${ARG_CODEX_START_DIRECTORY}"
53
-
exit 1
54
-
}
46
+
printf"Directory '%s' does not exist. Creating and changing to it.\\n""${ARG_CODEX_START_DIRECTORY}"
47
+
mkdir -p "${ARG_CODEX_START_DIRECTORY}"|| {
48
+
printf"Error: Could not create directory '%s'.\\n""${ARG_CODEX_START_DIRECTORY}"
49
+
exit 1
50
+
}
51
+
cd"${ARG_CODEX_START_DIRECTORY}"|| {
52
+
printf"Error: Could not change to directory '%s'.\\n""${ARG_CODEX_START_DIRECTORY}"
53
+
exit 1
54
+
}
55
55
fi
56
56
57
57
if [ -n"$ARG_CODEX_MODEL" ];then
58
-
CODEX_ARGS+=("--model""$ARG_CODEX_MODEL")
58
+
CODEX_ARGS+=("--model""$ARG_CODEX_MODEL")
59
59
fi
60
60
61
61
if [ "$ARG_CODEX_FULL_AUTO"="true" ];then
62
-
CODEX_ARGS+=("--full-auto")
62
+
CODEX_ARGS+=("--full-auto")
63
63
fi
64
64
65
65
if [ -n"$ARG_CODEX_TASK_PROMPT" ];then
66
-
printf"Running the task prompt %s\n""$ARG_CODEX_TASK_PROMPT"
67
-
PROMPT="Complete the task at hand in one go. Every step of the way, report your progress using coder_report_task tool with proper summary and statuses. Your task at hand: $ARG_CODEX_TASK_PROMPT"
68
-
CODEX_ARGS+=("$PROMPT")
66
+
printf"Running the task prompt %s\n""$ARG_CODEX_TASK_PROMPT"
67
+
PROMPT="Complete the task at hand in one go. Every step of the way, report your progress using coder_report_task tool with proper summary and statuses. Your task at hand: $ARG_CODEX_TASK_PROMPT"
68
+
CODEX_ARGS+=("$PROMPT")
69
69
else
70
-
printf"No task prompt given.\n"
70
+
printf"No task prompt given.\n"
71
71
fi
72
72
73
73
if [ -n"$ARG_OPENAI_API_KEY" ];then
74
-
printf"openai_api_key provided !\n"
74
+
printf"openai_api_key provided !\n"
75
75
else
76
-
printf"openai_api_key not provided\n"
76
+
printf"openai_api_key not provided\n"
77
77
fi
78
78
79
79
# use low width to fit in the tasks UI sidebar
80
80
# we adjust the height to 930 due to a bug in codex, see: https://github.com/openai/codex/issues/1608
81
81
printf"Starting codex with %s\n""${CODEX_ARGS[@]}"
82
-
agentapi server --term-width 67 --term-height 1190 -- codex "${CODEX_ARGS[@]}"
82
+
agentapi server --term-width 67 --term-height 1190 -- codex "${CODEX_ARGS[@]}"
0 commit comments