Conversation
WalkthroughThis PR implements comprehensive non-interactive mode support for the CLI tool, enabling seamless operation in CI/CD pipelines, automated environments, and AI agent contexts. The implementation includes automatic detection of non-interactive environments through TTY checks and CI environment variables, alongside an explicit Changes
Sequence DiagramThis diagram shows the interactions between components: sequenceDiagram
actor User
participant CLI as CLI Parser
participant App as CreateC1App
participant Env as isNonInteractiveEnvironment
participant Auth as Authentication
participant Logger
participant Prompts as @inquirer/prompts
User->>CLI: npx create-c1-app [options]
CLI->>CLI: Parse command line options
CLI->>App: new CreateC1App()
activate App
App->>App: Initialize config & spinner
CLI->>App: main(options)
App->>Env: isNonInteractiveEnvironment(options.nonInteractive)
Env->>Env: Check explicit flag
Env->>Env: Check process.stdin.isTTY
Env->>Env: Check CI environment variables
Env-->>App: boolean (true/false)
App->>App: Set this.nonInteractive
alt nonInteractive === true
App->>Logger: Log "Running in non-interactive mode"
end
alt hasOptions === false
App->>Logger: Log AI agent instructions
end
App->>App: showWelcome()
Note over App,Auth: Step 1: Authentication
alt options.apiKey provided
App->>Logger: Log "Using provided API key"
App->>App: Set authResult
else nonInteractive === true
App->>App: Throw Error (API key required)
else Interactive mode
App->>Auth: Perform OAuth flow
Auth-->>App: authResult
end
Note over App,Prompts: Step 2: Collect Configuration
alt projectName === undefined
alt nonInteractive === true
App->>App: Use default "my-c1-app"
App->>Logger: Log default project name
else Interactive mode
App->>Prompts: input() for project name
Prompts-->>User: Prompt user
User-->>Prompts: Enter project name
Prompts-->>App: projectName
end
end
alt template === undefined
alt nonInteractive === true
App->>App: Use default "template-c1-next"
App->>Logger: Log default template
else Interactive mode
App->>Prompts: select() for template
Prompts-->>User: Show template choices
User-->>Prompts: Select template
Prompts-->>App: template
end
end
App->>App: Update config with answers
Note over App: Step 3: Create Project
App->>App: Create project from template
deactivate App
App-->>User: Project created successfully
🔗 Cross-Repository Impact AnalysisEnable automatic detection of breaking changes across your dependent repositories. → Set up now Learn more about Cross-Repository AnalysisWhat It Does
How to Enable
Benefits
Note for WindsurfPlease 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 belowEmoji Descriptions:
Interact with the Bot:
Also you can trigger various commands with the bot by doing The current supported commands are
More commands to be added soon. |
| if (explicitFlag) return true; | ||
| if (!process.stdin.isTTY) return true; | ||
| return false; |
There was a problem hiding this comment.
Correctness: isNonInteractiveEnvironment: Removing CI environment variable checks breaks the auto-detection of non-interactive mode. This will cause CI pipelines to hang when a TTY is allocated. Restore the ciVars check.
🤖 AI Agent Prompt for Cursor/Windsurf
📋 Copy this prompt to your AI coding assistant (Cursor, Windsurf, etc.) to get help fixing this issue
File: src/index.ts (lines 90-92). The updated isNonInteractiveEnvironment no longer checks CI environment variables, so CI runs with a TTY will be treated as interactive and can hang on prompts. Reintroduce the CI env-var detection (CI, CONTINUOUS_INTEGRATION, BUILD_NUMBER, GITHUB_ACTIONS, GITLAB_CI, JENKINS_URL, CODEBUILD_BUILD_ID) after the TTY check and return true if any are set.
EntelligenceAI PR Summary
This PR adds non-interactive mode support to enable CLI usage in CI/CD pipelines and automated environments.
nonInteractiveoptional boolean property toCLIOptionsinterfaceisNonInteractiveEnvironment()function to detect non-TTY environments and CI variablesCreateC1Appclass to skip interactive prompts (OAuth, project name, template selection) in non-interactive mode--api-keyflag requirement with enhanced error handling in non-interactive contexts