Skip to content

Commit c8e26e9

Browse files
jiaenrenclaude
andauthored
Prompt agent skill installation during CLI install/upgrade (#841)
Add an interactive prompt to the macOS postinstall and Linux installer scripts that offers to install the OSMO agent skill for AI coding agents via `npx skills add nvidia/osmo`. The prompt: - Only appears in interactive terminals (skipped for MDM, CI) - Only appears when npx is available (prints manual instructions otherwise) - Defaults to yes on enter - Lets npx handle agent selection, scope, and install method interactively - Non-fatal: installation failure does not abort the CLI install Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f6535b9 commit c8e26e9

2 files changed

Lines changed: 112 additions & 0 deletions

File tree

src/cli/packaging/linux/installer.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,60 @@ fi
120120
# Clean up temp directory
121121
rm -rf "$OSMO_CLI_TMP_DIR"
122122

123+
# Prompt to install the OSMO agent skill for AI coding agents.
124+
# Runs interactively via npx — the user selects agents, scope, and method.
125+
# Skipped if: non-interactive, npx missing, or skill already installed.
126+
OSMO_SKILL_INSTALLED=false
127+
for agent_dir in "$HOME/.claude" "$HOME/.codex" "$HOME/.agents"; do
128+
if [ -f "$agent_dir/skills/osmo-agent/SKILL.md" ]; then
129+
OSMO_SKILL_INSTALLED=true
130+
break
131+
fi
132+
done
133+
134+
if [ -t 0 ] && [ "$OSMO_SKILL_INSTALLED" = false ]; then
135+
echo ""
136+
echo "######################################################################"
137+
echo "OSMO Agent Skill"
138+
echo ""
139+
echo "Install the OSMO agent skill for AI coding agents"
140+
echo "(Claude Code, Codex, etc.) to enable natural language"
141+
echo "commands for managing compute resources and workflows."
142+
echo "######################################################################"
143+
echo ""
144+
145+
if command -v npx &> /dev/null; then
146+
read -p "Install the OSMO agent skill? [Y/n]: " INSTALL_SKILL || INSTALL_SKILL="n"
147+
INSTALL_SKILL="${INSTALL_SKILL:-y}"
148+
if [ "$INSTALL_SKILL" = "y" ] || [ "$INSTALL_SKILL" = "Y" ]; then
149+
if npx skills add nvidia/osmo; then
150+
echo ""
151+
echo "To remove:"
152+
echo " npx skills remove osmo-agent"
153+
echo ""
154+
else
155+
echo ""
156+
echo "Installation failed. To retry:"
157+
echo " npx skills add nvidia/osmo"
158+
echo ""
159+
fi
160+
else
161+
echo "To install later:"
162+
echo " npx skills add nvidia/osmo"
163+
echo ""
164+
fi
165+
else
166+
echo "npx not found. Install Node.js to continue:"
167+
echo ""
168+
if command -v brew &> /dev/null; then
169+
echo " brew install node"
170+
fi
171+
echo " https://nodejs.org/en/download"
172+
echo ""
173+
echo "Then run:"
174+
echo " npx skills add nvidia/osmo"
175+
echo ""
176+
fi
177+
fi
178+
123179
exit 0

src/cli/packaging/macos/postinstall

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,60 @@ if [ -f "$OSMO_CLI_INSTALL_PATH/autocomplete.zsh" ]; then
4949
fi
5050
fi
5151

52+
# Prompt to install the OSMO agent skill for AI coding agents.
53+
# Runs interactively via npx — the user selects agents, scope, and method.
54+
# Skipped if: non-interactive, npx missing, or skill already installed.
55+
OSMO_SKILL_INSTALLED=false
56+
for agent_dir in "$HOME/.claude" "$HOME/.codex" "$HOME/.agents"; do
57+
if [ -f "$agent_dir/skills/osmo-agent/SKILL.md" ]; then
58+
OSMO_SKILL_INSTALLED=true
59+
break
60+
fi
61+
done
62+
63+
if [ -t 0 ] && [ "$OSMO_SKILL_INSTALLED" = false ]; then
64+
echo ""
65+
echo "######################################################################"
66+
echo "OSMO Agent Skill"
67+
echo ""
68+
echo "Install the OSMO agent skill for AI coding agents"
69+
echo "(Claude Code, Codex, etc.) to enable natural language"
70+
echo "commands for managing compute resources and workflows."
71+
echo "######################################################################"
72+
echo ""
73+
74+
if command -v npx &> /dev/null; then
75+
read -p "Install the OSMO agent skill? [Y/n]: " INSTALL_SKILL || INSTALL_SKILL="n"
76+
INSTALL_SKILL="${INSTALL_SKILL:-y}"
77+
if [ "$INSTALL_SKILL" = "y" ] || [ "$INSTALL_SKILL" = "Y" ]; then
78+
if npx skills add nvidia/osmo; then
79+
echo ""
80+
echo "To remove:"
81+
echo " npx skills remove osmo-agent"
82+
echo ""
83+
else
84+
echo ""
85+
echo "Installation failed. To retry:"
86+
echo " npx skills add nvidia/osmo"
87+
echo ""
88+
fi
89+
else
90+
echo "To install later:"
91+
echo " npx skills add nvidia/osmo"
92+
echo ""
93+
fi
94+
else
95+
echo "npx not found. Install Node.js to continue:"
96+
echo ""
97+
if command -v brew &> /dev/null; then
98+
echo " brew install node"
99+
fi
100+
echo " https://nodejs.org/en/download"
101+
echo ""
102+
echo "Then run:"
103+
echo " npx skills add nvidia/osmo"
104+
echo ""
105+
fi
106+
fi
107+
52108
exit 0

0 commit comments

Comments
 (0)