-
Notifications
You must be signed in to change notification settings - Fork 5
Iloom init command should detect when no remotes are set up and offer to help set them up (as long as gh CLI is up and running) #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Bug Report / Enhancement AnalysisQuestions for Reporter
Problem Summary User Impact Actual Behavior Expected Behavior
Next Steps
📋 Complete Context & Details (click to expand)Context from Documentation The README.md shows that
The CLAUDE.md architecture shows:
Additional Context When This Occurs:
Dependencies Already Available:
Related Workflows:
Design Decisions (from reporter):
|
Complexity AssessmentClassification: SIMPLE Metrics:
Reasoning: This feature requires adding remote detection logic to two existing commands ( Files to modify:
|
Combined Analysis & Plan - Issue #361Executive SummaryIssue #361 reports that Questions and Key Decisions (if applicable)
Implementation OverviewHigh-Level Execution Phases
Quick Stats
Complete Analysis & Implementation Details (click to expand)Research FindingsProblem Space
Codebase Research
Affected Files
Integration Points
Implementation PlanAutomated Test Cases to CreateTest File: describe('hasNoRemotes', () => {
it('should return true when no remotes exist', async () => {
// mock execa to return empty stdout
})
it('should return false when remotes exist', async () => {
// mock execa to return remote output
})
it('should return false when git command fails', async () => {
// mock execa to reject - same behavior as hasMultipleRemotes
})
})Files to Modify1. /src/utils/remote.ts:82-96Change: Add // Add after hasMultipleRemotes() at line 96
/**
* Check if repository has no remotes
*/
export async function hasNoRemotes(cwd?: string): Promise<boolean> {
try {
const remotes = await parseGitRemotes(cwd)
return remotes.length === 0
} catch (error) {
// Same error handling pattern as hasMultipleRemotes
const errMsg = error instanceof Error ? error.message : String(error)
if (/not a git repository/i.test(errMsg)) {
logger.debug('Skipping git remote check: not a git repository')
} else {
logger.warn(`Unable to check git remotes: ${errMsg}`)
}
return false
}
}2. /src/commands/start.ts:119-137Change: Add remote check after first-run setup that triggers init when no remotes detected Location: After line 128 (after the existing first-run setup check), before the repo lookup at line 130 // After line 128, before "let repo: string | undefined"
// Check for missing remotes and trigger init flow if needed
if (!isJsonMode && (await hasNoRemotes())) {
getLogger().warn('No git remotes detected. iloom requires a GitHub remote to function.')
await launchFirstRunSetup('Help me configure a GitHub remote for this repository. There are no git remotes configured.')
// Continue after setup - remotes should now be configured
}Also add import at line 18: 3. /templates/prompts/init-prompt.txt:313-315Change: Extend NO_REMOTES handling to prompt for GitHub URL and execute Replace lines 313-315: With expanded block:
Important: If the user doesn't have a GitHub repository yet, guide them to:
After configuring the remote, proceed to Phase 1 (Local Development Settings). |
Implementation Complete - Issue #361SummaryImplemented remote detection feature that checks for missing Git remotes during Changes Made
Validation Results
Detailed Changes by File (click to expand)Files Modified/src/utils/remote.tsChanges: Added
/src/utils/remote.test.tsChanges: Added
/src/commands/start.tsChanges: Added import and remote check in execute method
/src/utils/first-run-setup.tsChanges: Extended
/src/commands/start.test.tsChanges: Added /templates/prompts/init-prompt.txtChanges: Replaced simple NO_REMOTES warning with comprehensive guidance
Test Coverage Added
Dependencies AddedNone |
d9b3265 to
a283bf8
Compare
…ai#361 - Add `hasNoRemotes` utility function to detect missing remotes - Trigger first-run setup with custom message when no remotes detected - Support custom messages in `launchFirstRunSetup` function - Enhance init prompt to guide users through remote configuration - Update test mocks to support new SettingsManager dependency
- Replace generic `as any` with `Partial<SettingsManager>` cast - Improve type safety by using explicit partial type assertion Fixes iloom-ai#361
6594e9b to
1c8185d
Compare
Draft PR for issue #361
This PR was created automatically by iloom.