Skip to content

Commit 0f87683

Browse files
committed
feat: pretty shell script
1 parent 7dbf18c commit 0f87683

File tree

2 files changed

+30
-35
lines changed

2 files changed

+30
-35
lines changed

registry/coder-labs/modules/auggie/scripts/install.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ function install_auggie() {
9090
}
9191

9292
function create_coder_mcp() {
93-
AUGGIE_CODER_MCP_FILE="$HOME/.augment/coder_mcp.json"
94-
CODER_MCP=$(
95-
cat << EOF
93+
AUGGIE_CODER_MCP_FILE="$HOME/.augment/coder_mcp.json"
94+
CODER_MCP=$(
95+
cat << EOF
9696
{
9797
"mcpServers":{
9898
"coder": {
@@ -108,10 +108,10 @@ function create_coder_mcp() {
108108
}
109109
}
110110
EOF
111-
)
112-
mkdir -p "$(dirname "$AUGGIE_CODER_MCP_FILE")"
113-
echo "$CODER_MCP" > "$AUGGIE_CODER_MCP_FILE"
114-
printf "Coder MCP config created at: %s\n" "$AUGGIE_CODER_MCP_FILE"
111+
)
112+
mkdir -p "$(dirname "$AUGGIE_CODER_MCP_FILE")"
113+
echo "$CODER_MCP" > "$AUGGIE_CODER_MCP_FILE"
114+
printf "Coder MCP config created at: %s\n" "$AUGGIE_CODER_MCP_FILE"
115115
}
116116

117117
function create_rules_file() {
@@ -127,4 +127,4 @@ function create_rules_file() {
127127

128128
install_auggie
129129
create_coder_mcp
130-
create_rules_file
130+
create_rules_file

registry/coder-labs/modules/auggie/scripts/start.sh

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -o pipefail
55
source "$HOME"/.bashrc
66

77
command_exists() {
8-
command -v "$1" >/dev/null 2>&1
8+
command -v "$1" > /dev/null 2>&1
99
}
1010

1111
if [ -f "$HOME/.nvm/nvm.sh" ]; then
@@ -14,7 +14,6 @@ else
1414
export PATH="$HOME/.npm-global/bin:$PATH"
1515
fi
1616

17-
1817
set -o errexit
1918
set -o pipefail
2019
set -o nounset
@@ -31,7 +30,6 @@ ARG_AUGGIE_MODEL=${ARG_AUGGIE_MODEL:-}
3130

3231
ARGS=()
3332

34-
3533
echo "--------------------------------"
3634

3735
printf "auggie_start_directory: %s\n" "$ARG_AUGGIE_START_DIRECTORY"
@@ -48,34 +46,33 @@ echo "--------------------------------"
4846

4947
set +o nounset
5048

51-
5249
function validate_auggie_installation() {
53-
if command_exists auggie; then
54-
printf "Auggie is installed\n"
55-
else
56-
printf "Error: Auggie is not installed. Please enable install_auggie or install it manually\n"
57-
exit 1
58-
fi
50+
if command_exists auggie; then
51+
printf "Auggie is installed\n"
52+
else
53+
printf "Error: Auggie is not installed. Please enable install_auggie or install it manually\n"
54+
exit 1
55+
fi
5956
}
6057

6158
function build_auggie_args() {
6259
if [ -n "$ARG_AUGGIE_INTERACTION_MODE" ]; then
63-
if [ "$ARG_AUGGIE_INTERACTION_MODE" != "interactive" ]; then
64-
ARGS+=(--"$ARG_AUGGIE_INTERACTION_MODE")
65-
fi
60+
if [ "$ARG_AUGGIE_INTERACTION_MODE" != "interactive" ]; then
61+
ARGS+=(--"$ARG_AUGGIE_INTERACTION_MODE")
62+
fi
6663
fi
6764

6865
if [ -n "$ARG_AUGGIE_MODEL" ]; then
69-
ARGS+=(--model "$ARG_AUGGIE_MODEL")
66+
ARGS+=(--model "$ARG_AUGGIE_MODEL")
7067
fi
7168

7269
if [ -n "$ARG_MCP_CONFIG" ]; then
73-
ARGS+=(--mcp-config "$ARG_MCP_CONFIG")
70+
ARGS+=(--mcp-config "$ARG_MCP_CONFIG")
7471
fi
7572

7673
if [ -n "$ARG_MCP_FILES" ]; then
7774
for file in $(echo "$ARG_MCP_FILES" | jq -r '.[]'); do
78-
ARGS+=(--mcp-config "$file")
75+
ARGS+=(--mcp-config "$file")
7976
done
8077
fi
8178

@@ -88,25 +85,23 @@ function build_auggie_args() {
8885
fi
8986

9087
if [ "$ARG_AUGGIE_CONTINUE_PREVIOUS_CONVERSATION" == "true" ]; then
91-
ARGS+=(--continue)
88+
ARGS+=(--continue)
9289
fi
9390

94-
9591
if [ -n "$ARG_TASK_PROMPT" ]; then
96-
PROMPT="Every step of the way, report your progress using coder_report_task tool with proper summary and statuses. Your task at hand: $ARG_TASK_PROMPT"
97-
ARGS+=(--instruction "$PROMPT")
92+
PROMPT="Every step of the way, report your progress using coder_report_task tool with proper summary and statuses. Your task at hand: $ARG_TASK_PROMPT"
93+
ARGS+=(--instruction "$PROMPT")
9894
fi
9995
}
10096

10197
function start_agentapi_server() {
102-
mkdir -p "$ARG_AUGGIE_START_DIRECTORY"
103-
cd "$ARG_AUGGIE_START_DIRECTORY"
104-
ARGS+=(--workspace-root "$ARG_AUGGIE_START_DIRECTORY")
105-
printf "Running auggie with args: %s\n" "$(printf '%q ' "${ARGS[@]}")"
106-
agentapi server --term-width 67 --term-height 1190 -- auggie "${ARGS[@]}"
98+
mkdir -p "$ARG_AUGGIE_START_DIRECTORY"
99+
cd "$ARG_AUGGIE_START_DIRECTORY"
100+
ARGS+=(--workspace-root "$ARG_AUGGIE_START_DIRECTORY")
101+
printf "Running auggie with args: %s\n" "$(printf '%q ' "${ARGS[@]}")"
102+
agentapi server --term-width 67 --term-height 1190 -- auggie "${ARGS[@]}"
107103
}
108104

109-
110105
validate_auggie_installation
111106
build_auggie_args
112-
start_agentapi_server
107+
start_agentapi_server

0 commit comments

Comments
 (0)