fix: default to cwd when --reach is used without explicit target#1121
Merged
fix: default to cwd when --reach is used without explicit target#1121
Conversation
When `socket scan create --reach` is run without an explicit target path, the CLI previously relied on an interactive prompt to ask the user to confirm the current directory. In non-TTY environments (e.g. Jenkins CI), the select() prompt silently fails because wrapPrompt swallows non-TypeError errors, causing suggestTarget() to return [] and all reach validations to fail with confusing "Input error: At least one TARGET (missing)" errors. Now defaults to '.' (cwd) when --reach is used without a target, which is consistent with --reach requiring exactly one directory target. Also bumps @coana-tech/cli to 14.12.200 and CLI version to 1.1.74. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
BarrensZeppelin
approved these changes
Mar 19, 2026
When `socket scan create --reach` is run without an explicit target path, the CLI previously relied on an interactive prompt to ask the user to confirm the current directory. In non-TTY environments (e.g. Jenkins CI), the select() prompt silently fails because wrapPrompt swallows non-TypeError errors, causing suggestTarget() to return [] and all reach validations to fail with confusing "Input error: At least one TARGET (missing)" errors. Now falls back to '.' (cwd) when the prompt returns empty, preserving the interactive prompt for TTY users while gracefully handling non-TTY environments. Also bumps @coana-tech/cli to 14.12.200 and CLI version to 1.1.74. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
220887d to
35a901c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
socket scan create --reachfailing with input validation errors when no explicit target is passed in non-TTY environments (e.g. Jenkins CI). The interactiveselect()prompt silently returnsundefinedwhen stdin is not a TTY (due towrapPromptswallowing non-TypeError errors), causingsuggestTarget()to return[]and all reach validations to fail..(cwd) when--reachis used without a target, consistent with--reachrequiring exactly one directory target.cli.input || [cwd]never fell back to[cwd]because empty arrays are truthy in JS.Fixes ENG-4810
Test plan
socket scan create --reach --org <org> --repo <repo> --branch <branch>without explicit target — should succeed using cwd.target — should still work as beforeecho "" | socket scan create --reach ...) — should no longer fail with validation errors🤖 Generated with Claude Code
Note
Low Risk
Low risk: small CLI input-handling change scoped to
socket scan create --reachplus a routine dependency/version bump; main impact is defaulting the target to.in non-interactive runs.Overview
Fixes
socket scan create --reachwhen run without an explicit target by correctly detecting an emptycli.inputarray and defaulting the reachability target to.instead of falling back to an interactive prompt (which fails in non-TTY CI).Bumps the CLI version to
1.1.74, updates@coana-tech/clito14.12.200, and records the change inCHANGELOG.md.Written by Cursor Bugbot for commit 572fbcc. Configure here.