Skip to main content

Copy Prompt

cmd/crewship/cmd_copy_prompt.go recovers the first user prompt from a previous run and writes it to stdout or the system clipboard. The “I want to tweak this and rerun” workflow that doesn’t end with a network round-trip. Why a top-level command rather than a flag on retry: copy-prompt is local; users routinely want to grab a past prompt, edit it in $EDITOR, and re-issue. Keeping it separate keeps crewship retry’s mental model (“rerun this exactly”) clean.

crewship copy-prompt <run-id>

Examples

A trailing newline is added if missing so shells display cleanly. With --clipboard, stderr gets [copied <n> chars to clipboard].

Re-issuing

Common errors

  • run <id> has no chat_id — the run pre-dates chat threading.
  • could not recover prompt for run <id> — no USER/HUMAN-role message in the chat.
  • no clipboard helper found (install pbcopy/wl-copy/xclip/xsel) — headless box or missing dependency.

See also