Skip to content

Conversation

@sestinj
Copy link
Contributor

@sestinj sestinj commented Sep 25, 2025

Description

this was shortest path to set up the husky pre-commit hook in background


Summary by cubic

Adds support for .continue/environment.json in cn serve. If the file defines an install command, it runs before the server starts to auto-setup the local environment (e.g., Husky hooks).

  • New Features
    • Detects .continue/environment.json with an install script.
    • Executes the script with inherited stdio.
    • Logs failures but does not block cn serve.

@sestinj sestinj requested a review from a team as a code owner September 25, 2025 23:32
@sestinj sestinj requested review from RomneyDa and removed request for a team September 25, 2025 23:32
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 25, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 2 files

Prompt for AI agents (all 3 issues)

Understand the root cause of the following 3 issues and fix them.


<file name="extensions/cli/src/commands/serve.ts">

<violation number="1" location="extensions/cli/src/commands/serve.ts:61">
Blocks server startup via synchronous execSync; consider deferring until after the server starts or running asynchronously to avoid long startup delays.</violation>

<violation number="2" location="extensions/cli/src/commands/serve.ts:61">
Automatically executes an install command from .continue/environment.json on startup, enabling arbitrary command execution without user confirmation. Gate behind an explicit flag/confirmation or restrict allowed commands.</violation>

<violation number="3" location="extensions/cli/src/commands/serve.ts:63">
Rule violated: **Don&#39;t use console.log**

Replace console.error with logger.error per logging guideline.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.


// Run environment install script if available
try {
await runEnvironmentInstall();
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocks server startup via synchronous execSync; consider deferring until after the server starts or running asynchronously to avoid long startup delays.

Prompt for AI agents
Address the following comment on extensions/cli/src/commands/serve.ts at line 61:

<comment>Blocks server startup via synchronous execSync; consider deferring until after the server starts or running asynchronously to avoid long startup delays.</comment>

<file context>
@@ -55,6 +56,16 @@ export async function serve(prompt?: string, options: ServeOptions = {}) {
 
+  // Run environment install script if available
+  try {
+    await runEnvironmentInstall();
+  } catch (error) {
+    console.error(
</file context>

✅ Addressed in 012585a


// Run environment install script if available
try {
await runEnvironmentInstall();
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automatically executes an install command from .continue/environment.json on startup, enabling arbitrary command execution without user confirmation. Gate behind an explicit flag/confirmation or restrict allowed commands.

Prompt for AI agents
Address the following comment on extensions/cli/src/commands/serve.ts at line 61:

<comment>Automatically executes an install command from .continue/environment.json on startup, enabling arbitrary command execution without user confirmation. Gate behind an explicit flag/confirmation or restrict allowed commands.</comment>

<file context>
@@ -55,6 +56,16 @@ export async function serve(prompt?: string, options: ServeOptions = {}) {
 
+  // Run environment install script if available
+  try {
+    await runEnvironmentInstall();
+  } catch (error) {
+    console.error(
</file context>
Fix with Cubic

try {
await runEnvironmentInstall();
} catch (error) {
console.error(
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule violated: Don't use console.log

Replace console.error with logger.error per logging guideline.

Prompt for AI agents
Address the following comment on extensions/cli/src/commands/serve.ts at line 63:

<comment>Replace console.error with logger.error per logging guideline.</comment>

<file context>
@@ -55,6 +56,16 @@ export async function serve(prompt?: string, options: ServeOptions = {}) {
+  try {
+    await runEnvironmentInstall();
+  } catch (error) {
+    console.error(
+      chalk.red(&quot;Failed to run environment install script:&quot;),
+      formatError(error),
</file context>

✅ Addressed in 012585a

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Sep 26, 2025
@sestinj sestinj merged commit 1ac8d45 into main Sep 26, 2025
33 of 34 checks passed
@sestinj sestinj deleted the nate/env-json-cn branch September 26, 2025 00:12
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PRs Sep 26, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 26, 2025
@github-actions github-actions bot added the tier 2 Important feature that adds new capabilities to the platform or improves critical user journeys label Sep 26, 2025
@sestinj
Copy link
Contributor Author

sestinj commented Sep 26, 2025

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor Author

sestinj commented Sep 26, 2025

🎉 This PR is included in version 1.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor Author

sestinj commented Oct 1, 2025

🎉 This PR is included in version 1.21.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

released size:L This PR changes 100-499 lines, ignoring generated files. tier 2 Important feature that adds new capabilities to the platform or improves critical user journeys

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants