feat(chat): Claude Code chats use a service token from a private file when the server runs in the background

This commit is contained in:
2026-10-23 23:09:52 +01:00
parent d79173fae3
commit b490728c55
4 changed files with 107 additions and 1 deletions
+9
View File
@@ -8,6 +8,7 @@ import (
"strings"
"git.a-wan.net/alan/pipelines/internal/buildinfo"
"git.a-wan.net/alan/pipelines/internal/claude"
"git.a-wan.net/alan/pipelines/internal/harness"
"git.a-wan.net/alan/pipelines/internal/protocol"
)
@@ -24,6 +25,8 @@ type startup struct {
Harnesses harness.ListView
HarnessErr error
WebURL string
// ClaudeToken reports a service token for Claude Code chats.
ClaudeToken bool
}
// banner writes the server and backend summary. `pipelines start` prints the
@@ -72,6 +75,11 @@ func banner(w io.Writer, s startup) {
} else {
row("Chat", strings.Join(s.Chat, ", "))
}
if s.ClaudeToken {
row("Claude", "service token present")
} else {
row("Claude", "no service token; as a background service run `claude setup-token` and save it to ~/.config/pipelines/claude-token (chmod 600)")
}
if s.HarnessErr != nil {
row("Harnesses", "unreadable: "+s.HarnessErr.Error())
} else if len(s.Harnesses.Profiles) == 0 {
@@ -119,5 +127,6 @@ func firstNonEmpty(values ...string) string {
func printBanner(s startup) {
s.Harnesses, s.HarnessErr = harness.List()
s.WebURL = os.Getenv("PIPELINES_WEB_PUBLIC_URL")
s.ClaudeToken = claude.HasServiceToken()
banner(os.Stdout, s)
}