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
Improve the setup-repo shell flow's operator UX:
* Open with two bulleted lists — what we know about the repo (name +
local-checkout vs GitHub-remote, classified from the repo's git URL) and
what its setup entails (Claude credential always; GH_TOKEN for GitHub repos).
* Add a GH_TOKEN step (GitHub repos only): interactive `gh auth login`, then
capture via `gh auth token` and write it into the env-file — mirroring the
Claude-token step, with a graceful fallback when `gh` isn't on the host.
* DRY the env-file write: generalize `store_oauth_token` into
`store_env_token <VAR> <token> <file>`, the one implementation both tokens
share (comment out the active line, drop the placeholder stub, append).
* Turn the closing summary into a bullet-per-step list.
* Fold in PR #309's hint wording (detach reassurance + actionable drop).
To classify local vs GitHub the script needs the repo's git URL, so the
ShellRunner now exports PANOPTICON_REPO_NAME / PANOPTICON_REPO_GIT_URL (passed
through by the spawner from the repo record).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dashboard_hint="To return to the dashboard without finishing, detach: press $prefixthen$detach (the task stays running)."
21
+
dashboard_hint="To return to the dashboard without finishing, detach: press $prefixthen$detach (you can resume this task any time from the dashboard)."
17
22
18
23
# Show how to get back to the dashboard up front, before anything else.
19
24
echo "$dashboard_hint"
20
25
echo
21
26
27
+
# Work out what's already configured and what setting this repo up entails. The Claude credential is
28
+
# always needed (the agent runs `claude` regardless); a GH_TOKEN is only needed for a GitHub remote
29
+
# (a local checkout has nothing to push).
30
+
claude_configured=0
31
+
if [ -n "${CLAUDE_CODE_OAUTH_TOKEN:-}" ] || [ -n "${ANTHROPIC_API_KEY:-}" ]; then
32
+
claude_configured=1
33
+
fi
34
+
gh_needed=0
35
+
gh_configured=0
36
+
if repo_is_github "$repo_url"; then
37
+
gh_needed=1
38
+
[ -n "${GH_TOKEN:-}" ] && gh_configured=1
39
+
fi
40
+
41
+
# What we know about the repo, and what its setup entails — two bulleted lists up front.
42
+
echo "This repo:"
43
+
echo " • Name: $repo_name"
44
+
echo " • Source: $repo_label"
45
+
echo
46
+
echo "To set up:"
47
+
if [ "$claude_configured" -eq 1 ]; then
48
+
echo " • Claude credential — already configured"
49
+
else
50
+
echo " • Claude credential — needed"
51
+
fi
52
+
if [ "$gh_needed" -eq 1 ]; then
53
+
if [ "$gh_configured" -eq 1 ]; then
54
+
echo " • GH_TOKEN — already configured"
55
+
else
56
+
echo " • GH_TOKEN — needed (GitHub repo)"
57
+
fi
58
+
else
59
+
echo " • GH_TOKEN — not needed (not a GitHub repo)"
60
+
fi
61
+
echo
62
+
63
+
# The closing summary is a bullet per step; each step appends its outcome here.
22
64
summary=""
65
+
add_summary() {
66
+
if [ -z "$summary" ]; then
67
+
summary=" • $1"
68
+
else
69
+
summary="$summary
70
+
• $1"
71
+
fi
72
+
}
23
73
24
-
# Mint a token and record the outcome in $summary. On success, capture the minted token and write it
25
-
# straight into the repo's env-file (commenting out any previous one — see store_oauth_token); fall
74
+
# Mint a Claude token and record the outcome. On success, capture the minted token and write it
75
+
# straight into the repo's env-file (commenting out any previous one — see store_env_token); fall
26
76
# back to on-screen copy instructions when it can't be captured or there's no env-file to write to.
27
-
# extract_oauth_token / store_oauth_token come from setup_repo_lib.sh (prepended by shell_script()).
77
+
# extract_oauth_token / store_env_token come from setup_repo_lib.sh (prepended by shell_script()).
28
78
collect_token() {
29
79
echo
30
80
echo "Running 'claude setup-token' — follow the prompts to mint a token."
@@ -49,36 +99,73 @@ collect_token() {
49
99
fi
50
100
51
101
if [ "$_ct_ok" -eq 0 ]; then
52
-
summary="'claude setup-token' failed or was cancelled — no token was collected."
102
+
add_summary "Claude credential: 'claude setup-token' failed or was cancelled — nothing collected."
0 commit comments