Documentation
¶
Overview ¶
Package claudecode finds the Claude Code magpie's Claude subscription runs, and downloads Anthropic's own build of it when the user asks, for a machine with none: a server or a container (Jorben on Discord).
The build comes from where Anthropic's installer (claude.ai/install.sh) takes it: the release's manifest.json names each platform's SHA-256 and size, and the binary is checked against both before it is kept. It is kept in magpie's cache folder, not on PATH, so it stands in for no agent: it is only what the bridge and the sign-in run.
Index ¶
Constants ¶
const InstallHint = "or run `magpie claude-code install` to download Anthropic's own build for magpie"
InstallHint is what an error about a missing Claude Code adds: how to have magpie download it.
Variables ¶
var Base = "https://downloads.claude.ai/claude-code-releases"
Base is where Anthropic publishes Claude Code's builds, as its installer downloads them; a var for tests.
Functions ¶
func Downloaded ¶
func Downloaded() (path, version string)
Downloaded is the Claude Code magpie downloaded and its version, or "" when there is none: the newest of Root's versions that has the binary.
func Find ¶
func Find() string
Find is the Claude Code to run on this machine: the user's own (on PATH or where its installers put it, proc.FindTool), else the one magpie downloaded; "" when there is neither.
func Install ¶
Install downloads r into Root, checks its size and SHA-256 against the manifest's, and keeps it as the Claude Code magpie runs when the machine has none of its own; the versions downloaded before are removed. progress, when set, is told the bytes so far. It returns the binary's path.