Skip to content

Conversation

@jhaynie
Copy link
Member

@jhaynie jhaynie commented May 19, 2025

Summary by CodeRabbit

  • New Features
    • Enhanced support for managing environment variable files during cloud deployment, including interactive prompts for missing variables and handling of template files.
    • User interface improvements with styled warning messages and clearer prompts when setting environment variables.
  • Improvements
    • Secret detection for environment variables now considers associated comments for better accuracy.
    • Prompts for environment variables now support default values and placeholders for a smoother user experience.
  • Dependency Updates
    • Updated a core dependency to the latest version for improved stability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 19, 2025

Walkthrough

The changes enhance environment variable management during cloud deployment and environment file handling. They add support for parsing template files with comments, improve detection of secret variables via comments, and refine user prompts for missing variables. Related function signatures and struct fields are updated to support these features, and a dependency is bumped.

Changes

File(s) Change Summary
cmd/cloud.go Added support for reading .env.example and .env.template files, preserving comments, and prompting users to add missing variables. Implemented styled warnings, masking secrets, and functions for parsing and appending environment variables with comments.
cmd/env.go Updated to process environment files with comments, improved secret detection using comments, enhanced prompts to include default values and placeholders, and updated function signatures accordingly.
cmd/dev.go Simplified signal handling logic by removing OS-specific conditions and the runtime import. Now always listens for os.Interrupt, syscall.SIGINT, and syscall.SIGTERM.
internal/deployer/deployer.go Changed EnvFile.Env to use []env.EnvLineComment for comment support. Updated PromptHelpers.PromptForEnv signature to accept default value and placeholder parameters.
go.mod Updated github.com/agentuity/go-common dependency from v1.0.59 to v1.0.60.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant EnvFile
    participant TemplateFile

    User->>CLI: Initiate cloud deployment
    CLI->>EnvFile: Parse .env with comments
    CLI->>TemplateFile: Parse .env.example/.env.template with comments
    CLI->>CLI: Compare variables between files
    alt Missing variables found
        CLI->>User: Show styled warning, prompt to add variable
        User->>CLI: Provide value (if accepted)
        CLI->>EnvFile: Append variable with comment
    end
    CLI->>User: Proceed with deployment
Loading

Poem

In the garden of envs, new seeds are sown,
With comments and secrets, their meanings are shown.
Templates and warnings, in boxes of red,
Guide every bunny where variables are led.
Hop along, dear coder, the clouds are in sight—
Your envs now sparkle, set up just right!
🐇🌱📝

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
cmd/cloud.go (1)

310-332: Remove redundant assignment _ = filename

The blank-identifier assignment on line 317 serves no purpose (the variable is used below, so it will never trigger the “unused” compiler warning).

-        _ = filename

Eliminating the line tightens the code and avoids confusion.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between a2cf233 and 46b5344.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (5)
  • cmd/cloud.go (7 hunks)
  • cmd/dev.go (1 hunks)
  • cmd/env.go (4 hunks)
  • go.mod (1 hunks)
  • internal/deployer/deployer.go (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
cmd/cloud.go (5)
internal/util/io.go (1)
  • Exists (14-19)
internal/errsystem/errsystem.go (2)
  • New (33-63)
  • WithContextMessage (100-104)
internal/errsystem/errorcodes.go (1)
  • ErrParseEnvironmentFile (41-44)
internal/deployer/deployer.go (1)
  • EnvFile (14-17)
internal/util/strings.go (1)
  • Pluralize (32-40)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build and Test (windows-latest)
  • GitHub Check: Analyze (go)
🔇 Additional comments (11)
cmd/dev.go (1)

46-46: Signal handling simplification

The signal handling has been simplified by directly passing all signals (os.Interrupt, syscall.SIGINT, syscall.SIGTERM) to signal.NotifyContext rather than using conditional OS-specific logic.

go.mod (1)

7-7:

Details

✅ Verification successful

Dependency update to support environment template variables

The go-common dependency has been updated from v1.0.59 to v1.0.60 to support the new environment template variables functionality.


🏁 Script executed:

#!/bin/bash
# Check what changes were introduced in this dependency version
git log --oneline -1 v1.0.60 || echo "Cannot find version tag in local repo"
# Try to fetch the repository to check the changes
cd /tmp && git clone --depth=2 https://github.com/agentuity/go-common.git 2>/dev/null && cd go-common && git log --name-status -1

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Clone the specific v1.0.60 tag to inspect its commit
git clone --single-branch --branch v1.0.60 --depth=1 https://github.com/agentuity/go-common.git /tmp/go-common
cd /tmp/go-common
git log --name-status -1

Length of output: 807


🏁 Script executed:

#!/bin/bash
# Clone a shallow copy with tags to compare v1.0.59 and v1.0.60
rm -rf /tmp/go-common
git clone --depth 5 https://github.com/agentuity/go-common.git /tmp/go-common
cd /tmp/go-common
git fetch --tags --depth=5
echo "Changes in v1.0.60:"
git show v1.0.60 --name-status
echo
echo "Changes in v1.0.59:"
git show v1.0.59 --name-status
echo
echo "Diff between v1.0.59 and v1.0.60:"
git diff --name-status v1.0.59 v1.0.60

Length of output: 4138


Approve dependency update: go-common v1.0.60

  • Bumps github.com/agentuity/go-common from v1.0.59 to v1.0.60.
  • Adds a new utility for parsing environment files and returning EnvLineComment (PR #70).
  • Changes are limited to env/env.go and its tests; no breaking API modifications detected.
internal/deployer/deployer.go (2)

16-16: Enhanced environment variable support with comments

The EnvFile.Env field type changed from []env.EnvLine to []env.EnvLineComment to support preservation and utilization of comments in environment files.


44-44: Extended PromptForEnv with default value and placeholder support

The PromptForEnv function signature now includes two additional parameters (defaultValue and placeholder) to provide more user-friendly and contextual prompts when requesting environment variable values.

cmd/env.go (5)

44-59: Added helper to detect secrets based on description

New helper function to identify secrets by analyzing comments for keywords like "secret", "password", or "key" - enabling better automatic secret detection.


61-61: Updated loadEnvFile to support comment preservation

The function now accepts []env.EnvLineComment instead of []env.EnvLine to leverage the comments associated with environment variables.


68-68: Enhanced secret detection logic

Secret detection now considers comment content in addition to key names and the forceSecret flag, improving automatic identification of sensitive values.


168-169: Parse environment files with comments

Updated to use env.ParseEnvFileWithComments instead of env.ParseEnvFile to support the comment-aware loading of environment variables.


254-254: Updated promptForEnv call with new parameters

The call to promptForEnv now uses the updated signature, passing empty strings for the new defaultValue and placeholder parameters.

cmd/cloud.go (2)

179-181: Nice touch adding styled diff boxes

The lipgloss-based border and redDiff styles provide clear visual feedback for missing variables.
Well-implemented!


154-177:

Details

✅ Verification successful

Preserve original file permissions when rewriting .env

appendToEnvFile rewrites the entire file with a hard-coded 0644 mode.
If the user deliberately made the file non-world-readable (e.g. 0600 for secrets), we unintentionally widen the permissions.

-    if err := os.WriteFile(envfile, []byte(buf.String()), 0644); err != nil {
+    // Keep current permissions if possible
+    mode := os.FileMode(0644)
+    if fi, statErr := os.Stat(envfile); statErr == nil {
+        mode = fi.Mode()
+    }
+    if err := os.WriteFile(envfile, []byte(buf.String()), mode); err != nil {
         return nil, err
     }

Minor, but important for security-conscious users.


No change required: os.WriteFile already preserves existing permissions

Go’s os.WriteFile only applies the provided permission when creating a new file; if the file exists, it’s truncated and rewritten without altering its mode. Since appendToEnvFile parses an existing .env (failing early if it doesn’t exist), its call to os.WriteFile(..., 0644) will not widen permissions on an already-present file.

Comment on lines +77 to +102
func promptForEnv(logger logger.Logger, key string, isSecret bool, localenv map[string]string, osenv map[string]string, defaultValue string, placeholder string) string {
prompt := "Enter the value for " + key
var help string
var defaultValue string
var value string
if isSecret {
prompt = "Enter the secret value for " + key
if val, ok := localenv[key]; ok {
help = "Press enter to set as " + maxString(cstr.Mask(val), 30) + " from your .env file"
defaultValue = val
if defaultValue == "" {
defaultValue = val
}
} else if val, ok := osenv[key]; ok {
help = "Press enter to set as " + maxString(cstr.Mask(val), 30) + " from your environment"
defaultValue = val
if defaultValue == "" {
defaultValue = val
}
} else {
help = "Your input will be masked"
}
value = tui.Password(logger, prompt, help)
} else {
value = tui.Input(logger, prompt, help)
if placeholder == "" {
value = tui.InputWithPlaceholder(logger, prompt, placeholder, defaultValue)
} else {
value = tui.InputWithPlaceholder(logger, prompt, help, defaultValue)
}
Copy link
Contributor

@coderabbitai coderabbitai bot May 19, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue

Enhanced promptForEnv with better default handling and placeholder support

The function has been extended to:

  1. Accept defaultValue and placeholder parameters
  2. Only use values from local/OS environment if no explicit default is provided
  3. Support placeholders for non-secret inputs, improving the UX

There appears to be a small logic error with placeholder handling.

Lines 98-102 contain a logical error in the conditional block. If placeholder is provided (not empty), it uses help as the placeholder parameter instead of the actual placeholder. This should be fixed:

-		if placeholder == "" {
-			value = tui.InputWithPlaceholder(logger, prompt, placeholder, defaultValue)
-		} else {
-			value = tui.InputWithPlaceholder(logger, prompt, help, defaultValue)
-		}
+		if placeholder == "" {
+			value = tui.InputWithPlaceholder(logger, prompt, help, defaultValue)
+		} else {
+			value = tui.InputWithPlaceholder(logger, prompt, placeholder, defaultValue)
+		}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func promptForEnv(logger logger.Logger, key string, isSecret bool, localenv map[string]string, osenv map[string]string, defaultValue string, placeholder string) string {
prompt := "Enter the value for " + key
var help string
var defaultValue string
var value string
if isSecret {
prompt = "Enter the secret value for " + key
if val, ok := localenv[key]; ok {
help = "Press enter to set as " + maxString(cstr.Mask(val), 30) + " from your .env file"
defaultValue = val
if defaultValue == "" {
defaultValue = val
}
} else if val, ok := osenv[key]; ok {
help = "Press enter to set as " + maxString(cstr.Mask(val), 30) + " from your environment"
defaultValue = val
if defaultValue == "" {
defaultValue = val
}
} else {
help = "Your input will be masked"
}
value = tui.Password(logger, prompt, help)
} else {
value = tui.Input(logger, prompt, help)
if placeholder == "" {
value = tui.InputWithPlaceholder(logger, prompt, placeholder, defaultValue)
} else {
value = tui.InputWithPlaceholder(logger, prompt, help, defaultValue)
}
func promptForEnv(logger logger.Logger, key string, isSecret bool, localenv map[string]string, osenv map[string]string, defaultValue string, placeholder string) string {
prompt := "Enter the value for " + key
var help string
var value string
if isSecret {
// … secret‐input logic …
value = tui.Password(logger, prompt, help)
} else {
if placeholder == "" {
value = tui.InputWithPlaceholder(logger, prompt, help, defaultValue)
} else {
value = tui.InputWithPlaceholder(logger, prompt, placeholder, defaultValue)
}
}
return value
}
🤖 Prompt for AI Agents
In cmd/env.go around lines 98 to 102, the conditional incorrectly uses the
variable 'help' as the placeholder argument when 'placeholder' is non-empty. To
fix this, update the else branch to pass the actual 'placeholder' variable to
tui.InputWithPlaceholder instead of 'help', ensuring the correct placeholder
text is shown for non-secret inputs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, good catch. This needs fixing

Copy link
Contributor

Choose a reason for hiding this comment

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

No description provided.

Copy link
Contributor

Choose a reason for hiding this comment

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

A summary of the edits CodeRabbit can apply:

Fix the placeholder handling logic in promptForEnv in cmd/env.go to correctly use help when placeholder is empty and placeholder when provided.

A plan of each step that CodeRabbit will take in order to execute the edits for each file (with inline rough draft snippets):

✏️ cmd/env.go

Open cmd/env.go and find the promptForEnv function around line 77.


Locate the non-secret input placeholder block (currently lines 100–103):

if placeholder == "" {
    value = tui.InputWithPlaceholder(logger, prompt, placeholder, defaultValue)
} else {
    value = tui.InputWithPlaceholder(logger, prompt, help, defaultValue)
}

Replace lines 100–103 with the corrected logic so that help is used when placeholder is empty and placeholder when provided:

if placeholder == "" {
    value = tui.InputWithPlaceholder(logger, prompt, help, defaultValue)
} else {
    value = tui.InputWithPlaceholder(logger, prompt, placeholder, defaultValue)
}

Verify the indentation uses tabs to align with surrounding code, save cmd/env.go, then run the CLI in both placeholder-present and placeholder-empty scenarios to ensure the fix works.

A summary of the context that CodeRabbit is considering across the codebase:

Display the relevant lines around the InputWithPlaceholder calls to confirm the exact block to update.

  • ✅ Create PR with these edits
  • 📌 Create commit in current branch
  • 📋 Get copyable edits

Comment on lines +127 to +152
func readPossibleEnvTemplateFiles(baseDir string) map[string][]env.EnvLineComment {
var results map[string][]env.EnvLineComment
keys := make(map[string]bool)
for _, file := range envTemplateFileNames {
filename := filepath.Join(baseDir, file)
if !util.Exists(filename) {
continue
}
efc, err := env.ParseEnvFileWithComments(filename)
if err == nil {
if results == nil {
results = make(map[string][]env.EnvLineComment)
}
for _, ev := range efc {
if _, ok := keys[ev.Key]; !ok {
if isAgentuityEnv.MatchString(ev.Key) {
continue
}
keys[ev.Key] = true
results[file] = append(results[file], ev)
}
}
}
}
return results
}
Copy link
Contributor

@coderabbitai coderabbitai bot May 19, 2025

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Surface parse errors from template files instead of silently ignoring them

readPossibleEnvTemplateFiles swallows any parsing error coming from env.ParseEnvFileWithComments.
If a user mistypes a line in .env.example, the CLI will behave as if the variable is simply missing, giving no clue about the real problem.

Consider propagating or at least logging the error so the user can fix the malformed template.

-func readPossibleEnvTemplateFiles(baseDir string) map[string][]env.EnvLineComment {
-    var results map[string][]env.EnvLineComment
+// returns map[template-filename]vars and an optional error so callers can decide how to react
+func readPossibleEnvTemplateFiles(baseDir string) (map[string][]env.EnvLineComment, error) {
+    var results map[string][]env.EnvLineComment
     keys := make(map[string]bool)
@@
-        efc, err := env.ParseEnvFileWithComments(filename)
-        if err == nil {
+        efc, err := env.ParseEnvFileWithComments(filename)
+        if err != nil {
+            // bubble up – caller can choose to warn the user
+            return nil, fmt.Errorf("parsing %s: %w", filename, err)
+        }
+
         if results == nil {
             results = make(map[string][]env.EnvLineComment)
         }
@@
-    return results
+    return results, nil
 }

You will need to adjust the single call-site accordingly.
Fail-fast behaviour avoids silent mis-configuration.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In cmd/cloud.go around lines 127 to 152, the function
readPossibleEnvTemplateFiles currently ignores errors from
env.ParseEnvFileWithComments, which hides parsing issues in env template files.
Modify the function to return an error along with the results map, propagate any
parsing errors instead of silently continuing, and update the call-site to
handle this error. This change will enable fail-fast behavior and prevent silent
misconfiguration by surfacing malformed template problems to the user.

Copy link
Contributor

Choose a reason for hiding this comment

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

He's got a valid point... happy path is covered

Copy link
Contributor

Choose a reason for hiding this comment

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

No description provided.

Copy link
Contributor

Choose a reason for hiding this comment

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

A summary of the edits CodeRabbit can apply:

Update readPossibleEnvTemplateFiles in cmd/cloud.go to return an error and propagate parsing failures.

Update the call site in cmd/cloud.go to handle the error returned by readPossibleEnvTemplateFiles.

A plan of each step that CodeRabbit will take in order to execute the edits for each file (with inline rough draft snippets):

✏️ cmd/cloud.go

Replace the function signature and add documentation comments. Overwrite lines 127–127 with:

// readPossibleEnvTemplateFiles reads and parses environment template files
// from the specified base directory.
func readPossibleEnvTemplateFiles(baseDir string) (map[string][]env.EnvLineComment, error) {

Inside the loop, replace the error check at lines 135–136 from:

efc, err := env.ParseEnvFileWithComments(filename)
if err == nil {

to:

efc, err := env.ParseEnvFileWithComments(filename)
if err != nil {
    return nil, fmt.Errorf("parsing %s: %w", filename, err)
}

Replace the final return at line 151 from:

return results

to:

return results, nil

Change the call at line 290 from:

templateEnvs := readPossibleEnvTemplateFiles(dir)

to:

templateEnvs, err := readPossibleEnvTemplateFiles(dir)

Immediately after, insert an error check:

if err != nil {
    errsystem.New(errsystem.ErrParseEnvironmentFile, err,
        errsystem.WithContextMessage("Error parsing environment template file")).ShowErrorAndExit()
}

A summary of the context that CodeRabbit is considering across the codebase:

We need to inspect the existing readPossibleEnvTemplateFiles definition—including its signature, body, and return—to determine the precise lines to update.

We need to locate the call site(s) of readPossibleEnvTemplateFiles in order to update them to handle the new error return.

  • ✅ Create PR with these edits
  • 📌 Create commit in current branch
  • 📋 Get copyable edits

Comment on lines +127 to +152
func readPossibleEnvTemplateFiles(baseDir string) map[string][]env.EnvLineComment {
var results map[string][]env.EnvLineComment
keys := make(map[string]bool)
for _, file := range envTemplateFileNames {
filename := filepath.Join(baseDir, file)
if !util.Exists(filename) {
continue
}
efc, err := env.ParseEnvFileWithComments(filename)
if err == nil {
if results == nil {
results = make(map[string][]env.EnvLineComment)
}
for _, ev := range efc {
if _, ok := keys[ev.Key]; !ok {
if isAgentuityEnv.MatchString(ev.Key) {
continue
}
keys[ev.Key] = true
results[file] = append(results[file], ev)
}
}
}
}
return results
}
Copy link
Contributor

Choose a reason for hiding this comment

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

He's got a valid point... happy path is covered

Comment on lines +77 to +102
func promptForEnv(logger logger.Logger, key string, isSecret bool, localenv map[string]string, osenv map[string]string, defaultValue string, placeholder string) string {
prompt := "Enter the value for " + key
var help string
var defaultValue string
var value string
if isSecret {
prompt = "Enter the secret value for " + key
if val, ok := localenv[key]; ok {
help = "Press enter to set as " + maxString(cstr.Mask(val), 30) + " from your .env file"
defaultValue = val
if defaultValue == "" {
defaultValue = val
}
} else if val, ok := osenv[key]; ok {
help = "Press enter to set as " + maxString(cstr.Mask(val), 30) + " from your environment"
defaultValue = val
if defaultValue == "" {
defaultValue = val
}
} else {
help = "Your input will be masked"
}
value = tui.Password(logger, prompt, help)
} else {
value = tui.Input(logger, prompt, help)
if placeholder == "" {
value = tui.InputWithPlaceholder(logger, prompt, placeholder, defaultValue)
} else {
value = tui.InputWithPlaceholder(logger, prompt, help, defaultValue)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, good catch. This needs fixing

@pec1985
Copy link
Contributor

pec1985 commented May 19, 2025

CodeRabbit made a good couple of points. The second one is a bug, the first is about error handling. Also, how do I test it?

@jhaynie
Copy link
Member Author

jhaynie commented May 19, 2025

@pec1985 if you can take this one over and i have a couple of follows after this PR.

to test:

create a file in your project named .env.example and add the following:

# this is a bar
FOO=bar

# this is a secret
BAR=super secret value

FOOBAR=XXXXXXXXX

AGENTUITY_FOO_BAR=this should be ignored

Then run that project deploy (make sure to delete from .env and dashboard if testing more than once).

Once this PR merges, it would be good to refactor this into a set of utilities we can reuse for the following:

  • Check on agentuity dev
  • Check on agentuity project import

Also, I would like to add both TTY and non-TTY versions.

for the TTY version, it can have user interaction like it does now.

but we should support non-TTY version (like the CI build) and have it show a nice table of the issues and exit(1) so the build will fail with instructions on why.

Copy link
Contributor

@pec1985 pec1985 left a comment

Choose a reason for hiding this comment

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

ALL GOOD

@jhaynie jhaynie merged commit 2efc006 into main May 20, 2025
15 checks passed
@jhaynie jhaynie deleted the env-template-vars branch May 20, 2025 13:46
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.

3 participants