Skip to content

Conversation

@AbhinRustagi
Copy link

@AbhinRustagi AbhinRustagi commented Nov 16, 2025

Closes #3

Implemented Solution

Added a flag with isCurrDir by checking if projectName === '.', and using that to improve logging references, add validation, and check for any pre-existing files in the folder.


EntelligenceAI PR Summary

This PR enables project initialization in the current directory by passing '.' as the project name, with comprehensive validation to prevent overwriting existing files.

  • Added isCurrentDir boolean flag to configuration and options interfaces
  • Implemented resolveProjectName() helper to convert '.' to current directory name
  • Enhanced directory validation to allow initialization only in empty directories or those with ignored files (.git, .DS_Store, node_modules, .env, Thumbs.db)
  • Updated path resolution logic across envManager and project generator to conditionally use current working directory
  • Modified success message to skip 'cd' instruction when creating in current directory
  • Added missing path import to support new functionality

@entelligence-ai-pr-reviews
Copy link

🔒 Entelligence AI Vulnerability Scanner

No security vulnerabilities found!

Your code passed our comprehensive security analysis.

📊 Files Analyzed: 4 files


@entelligence-ai-pr-reviews
Copy link

Walkthrough

This PR introduces support for initializing projects in the current directory using '.' as the project name. The implementation adds an isCurrentDir flag that flows through the entire project creation pipeline, from initial configuration to environment setup. Key changes include a new resolveProjectName() helper that converts '.' to the current directory name, enhanced validation logic that allows initialization only in empty directories (or those containing only ignored files like .git, .DS_Store, node_modules), and conditional path resolution throughout the codebase. The success message is also updated to skip the 'cd' instruction when creating in-place, providing a more intuitive user experience.

Changes

File(s) Summary
src/types/index.ts Added isCurrentDir boolean field to CreateC1AppConfig (required) and ProjectGenerationOptions (optional) interfaces to support in-place project creation.
src/index.ts Introduced resolveProjectName() helper to convert '.' to current directory name; updated CreateC1App class to track isCurrentDir state throughout configuration, generation, and setup phases; modified success message to conditionally skip 'cd' instruction for current directory projects; added path import.
src/generators/project.ts Enhanced createProject() to conditionally set projectPath based on isCurrentDir flag; implemented new validation for current directory initialization that only allows empty directories or those containing ignored files (.git, .DS_Store, node_modules, .env, Thumbs.db).
src/env/envManager.ts Modified setupEnvironment() method to accept optional options parameter with isCurrentDir flag; updated projectPath logic to use current working directory when flag is true, otherwise joins with project name.

Sequence Diagram

This diagram shows the interactions between components:

sequenceDiagram
    participant Caller
    participant EnvironmentManager
    participant FileSystem as File System

    Caller->>EnvironmentManager: setupEnvironment(projectName, apiKey, options?)
    
    alt options.isCurrentDir is true
        EnvironmentManager->>EnvironmentManager: projectPath = process.cwd()
        Note over EnvironmentManager: Use current directory
    else options.isCurrentDir is false/undefined
        EnvironmentManager->>EnvironmentManager: projectPath = join(cwd, projectName)
        Note over EnvironmentManager: Create path with project name
    end
    
    EnvironmentManager->>FileSystem: Access projectPath directory
    FileSystem-->>EnvironmentManager: Directory access confirmed
    
    EnvironmentManager-->>Caller: StepResult
Loading

🔗 Cross-Repository Impact Analysis

Enable automatic detection of breaking changes across your dependent repositories. → Set up now

Learn more about Cross-Repository Analysis

What It Does

  • Automatically identifies repositories that depend on this code
  • Analyzes potential breaking changes across your entire codebase
  • Provides risk assessment before merging to prevent cross-repo issues

How to Enable

  1. Visit Settings → Code Management
  2. Configure repository dependencies
  3. Future PRs will automatically include cross-repo impact analysis!

Benefits

  • 🛡️ Prevent breaking changes across repositories
  • 🔍 Catch integration issues before they reach production
  • 📊 Better visibility into your multi-repo architecture

▶️AI Code Reviews for VS Code, Cursor, Windsurf
Install the extension

Note for Windsurf Please change the default marketplace provider to the following in the windsurf settings:

Marketplace Extension Gallery Service URL: https://marketplace.visualstudio.com/_apis/public/gallery

Marketplace Gallery Item URL: https://marketplace.visualstudio.com/items

Entelligence.ai can learn from your feedback. Simply add 👍 / 👎 emojis to teach it your preferences. More shortcuts below

Emoji Descriptions:

  • ⚠️ Potential Issue - May require further investigation.
  • 🔒 Security Vulnerability - Fix to ensure system safety.
  • 💻 Code Improvement - Suggestions to enhance code quality.
  • 🔨 Refactor Suggestion - Recommendations for restructuring code.
  • ℹ️ Others - General comments and information.

Interact with the Bot:

  • Send a message or request using the format:
    @entelligenceai + *your message*
Example: @entelligenceai Can you suggest improvements for this code?
  • Help the Bot learn by providing feedback on its responses.
    @entelligenceai + *feedback*
Example: @entelligenceai Do not comment on `save_auth` function !

Also you can trigger various commands with the bot by doing
@entelligenceai command

The current supported commands are

  1. config - shows the current config
  2. retrigger_review - retriggers the review

More commands to be added soon.

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.

Inconsistent behaviour when bootstrapping a project in cwd

1 participant