Skip to content

Add ability to rerun workflows with SSH, and a tool to get job SSH details#133

Open
pandaiolo wants to merge 5 commits intoCircleCI-Public:mainfrom
pandaiolo:issue-132-rerun-with-ssh
Open

Add ability to rerun workflows with SSH, and a tool to get job SSH details#133
pandaiolo wants to merge 5 commits intoCircleCI-Public:mainfrom
pandaiolo:issue-132-rerun-with-ssh

Conversation

@pandaiolo
Copy link

Closes #132

Problem

Debugging failed CircleCI jobs on the instance requires manually navigating the UI to rerun with SSH and find connection details. This is time-consuming and interrupts the development workflow.

Solution

1. Enhanced rerun_workflow tool

  • Added enableSsh parameter to automatically rerun the last job with SSH enabled
  • Validates mutually exclusive parameters (enableSsh and fromFailed)
  • Returns workflow URL and next steps for SSH access

2. New get_ssh_details tool

  • Retrieves SSH connection commands for SSH-enabled jobs
  • Auto-detects last SSH-enabled job or accepts specific job number
  • Provides clear error messages for common issues (job not ready, SSH not enabled)

Usage

// Enable SSH on workflow rerun
rerun_workflow({ workflowId: "abc-123", enableSsh: true })

// Get SSH connection details after 30-60 seconds
get_ssh_details({ workflowURL: "https://app.circleci.com/pipelines/workflows/abc-123" })
// Returns: ssh -p 54782 52.90.XXX.XXX

Add enableSsh parameter to rerun_workflow tool to enable SSH debugging.
Automatically reruns the last job in the workflow with SSH access.
Add new tool to retrieve SSH connection details for jobs rerun with SSH enabled.
Supports automatic detection of SSH-enabled jobs and provides connection commands.
Fix linting issues in rerunWorkflow and getSshDetails tools.
   Add Zod refinement to ensure either workflowId or workflowURL is provided.
   Extract repeated "wait 30-60 seconds" messages into reusable constants
   to improve code maintainability.
@pandaiolo pandaiolo requested a review from a team as a code owner November 14, 2025 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Rerun workflow with ssh

1 participant