Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"DISABLE_AUTOUPDATER": "1"
},
"forwardPorts": [3000, 3100, 3200, 8080, 8090],
"postCreateCommand": "bash .devcontainer/post-create.sh"
"postCreateCommand": "bash .devcontainer/post-create.sh",
"postStartCommand": "bash .devcontainer/postman-login.sh"
}
9 changes: 0 additions & 9 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,3 @@ if [ -n "${ANTHROPIC_API_KEY:-}" ]; then
else
echo "ANTHROPIC_API_KEY not set; add it as a Codespaces secret, or run: claude and log in"
fi

# Postman CLI: if POSTMAN_API_KEY is set, log in so `postman` commands work immediately.
if [ -n "${POSTMAN_API_KEY:-}" ]; then
postman login --with-api-key "$POSTMAN_API_KEY" >/dev/null \
&& echo "Postman CLI logged in" \
|| echo "Postman login failed; run: postman login"
else
echo "POSTMAN_API_KEY not set; add it as a Codespaces secret, or run: postman login"
fi
12 changes: 12 additions & 0 deletions .devcontainer/postman-login.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Runs on every Codespace start so the Postman CLI is always logged in.
# Needs the POSTMAN_API_KEY Codespaces secret (github.com/settings/codespaces).

if [ -z "${POSTMAN_API_KEY:-}" ]; then
echo "POSTMAN_API_KEY not set; add it as a Codespaces secret (with access to this repo), or run: postman login --with-api-key <key>"
exit 0
fi

postman login --with-api-key "$POSTMAN_API_KEY" \
&& echo "Postman CLI logged in" \
|| echo "Postman login failed; check that POSTMAN_API_KEY is a valid API key"
Loading