Skip to content

feat: initial release of @arkenv/cli#897

Merged
yamcodes merged 62 commits into
mainfrom
896-create-arkenv-interactive-scaffold-cli-for-onboarding
May 9, 2026
Merged

feat: initial release of @arkenv/cli#897
yamcodes merged 62 commits into
mainfrom
896-create-arkenv-interactive-scaffold-cli-for-onboarding

Conversation

@yamcodes

@yamcodes yamcodes commented May 8, 2026

Copy link
Copy Markdown
Owner

Closes #896

TODO:

Summary by CodeRabbit

  • New Features

    • Introduced an interactive ArkEnv CLI for project init: framework detection (Vite/Bun/Node), validator choice (ArkType/Zod/Valibot), scaffolded env output, and optional enforcement of TypeScript strict mode; CLI runnable via pnpm/npx/bunx and performs package-manager-aware dependency installation.
  • Documentation

    • Added README, design, spec, and task docs describing the CLI, templates, and migration plan.
  • Chores

    • Added a playground app and updated workspace configuration.

@yamcodes yamcodes linked an issue May 8, 2026 that may be closed by this pull request
@changeset-bot

changeset-bot Bot commented May 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 237f706

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@arkenv/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@yamcodes has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 26 minutes and 1 second before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f6f68f5d-819f-4d66-97a9-dca6ad0822d3

📥 Commits

Reviewing files that changed from the base of the PR and between cf72b6b and 237f706.

📒 Files selected for processing (45)
  • .idea/vcs.xml
  • TESTING.md
  • apps/playgrounds/arkenv-cli/src/index.css
  • apps/www/app/(home)/layout.tsx
  • apps/www/app/(home)/page.tsx
  • apps/www/app/docs/layout.tsx
  • apps/www/components/page/cli-command.tsx
  • apps/www/components/page/copy-button.test.tsx
  • apps/www/components/page/copy-button.tsx
  • apps/www/components/page/header-github-link.tsx
  • apps/www/components/page/index.ts
  • apps/www/components/page/quickstart-button.test.tsx
  • apps/www/components/page/quickstart-button.tsx
  • apps/www/components/page/star-us-button.test.tsx
  • apps/www/components/page/star-us-button.tsx
  • apps/www/components/ui/search-toggle.tsx
  • apps/www/content/docs/arkenv/how-to/load-environment-variables.mdx
  • apps/www/content/docs/arkenv/quickstart.mdx
  • apps/www/content/docs/cli/faq.mdx
  • apps/www/content/docs/cli/index.mdx
  • apps/www/content/docs/cli/meta.json
  • apps/www/content/docs/meta.json
  • openspec/changes/add-arkenv-cli-docs/.openspec.yaml
  • openspec/changes/add-arkenv-cli-docs/design.md
  • openspec/changes/add-arkenv-cli-docs/proposal.md
  • openspec/changes/add-arkenv-cli-docs/specs/cli-documentation/spec.md
  • openspec/changes/add-arkenv-cli-docs/tasks.md
  • openspec/changes/arkenv-cli-adequate-testing/design.md
  • openspec/changes/arkenv-cli-adequate-testing/proposal.md
  • openspec/changes/arkenv-cli-adequate-testing/specs/scaffolding-cli/spec.md
  • openspec/changes/arkenv-cli-adequate-testing/tasks.md
  • openspec/changes/arkenv-init/specs/scaffolding-cli/spec.md
  • packages/arkenv-cli/README.md
  • packages/arkenv-cli/package.json
  • packages/arkenv-cli/src/env-template.test.ts
  • packages/arkenv-cli/src/env-template.ts
  • packages/arkenv-cli/src/index.ts
  • packages/arkenv-cli/src/prompts.ts
  • packages/arkenv-cli/src/scaffold.test.ts
  • packages/arkenv-cli/src/scaffold.ts
  • packages/arkenv-cli/src/smoke.test.ts
  • packages/arkenv-cli/vitest.config.ts
  • packages/arkenv/README.md
  • packages/fumadocs-ui/src/utils/url.ts
  • tooling/playwright-www/tests/homepage.test.ts

Walkthrough

Adds a standalone @arkenv/cli package providing an interactive init wizard (prompts, validator templates, scaffold, tsconfig strict-mode prompting, and dependency installation), a React + Vite playground demonstrating usage, OpenSpec design/spec/tasks, and workspace/tooling updates.

Changes

@arkenv/cli Implementation

Layer / File(s) Summary
Package manifest & basic files
packages/arkenv-cli/package.json, packages/arkenv-cli/tsdown.config.ts, apps/playgrounds/arkenv-cli/package.json, apps/playgrounds/arkenv-cli/tsconfig*.json, apps/playgrounds/arkenv-cli/vite.config.ts
Adds @arkenv/cli package manifest with bin/exports, build/start/dev scripts, tsdown build config, and playground package metadata and TypeScript project references.
Template dispatcher & templates
packages/arkenv-cli/src/env-template.ts, packages/arkenv-cli/src/templates/*
getEnvTemplate dispatches to validator-specific template factories (arktype, zod, valibot) and embeds framework-specific notes into generated env.ts.
Scaffolding & TS config
packages/arkenv-cli/src/scaffold.ts
scaffold() writes env.ts (with overwrite confirmation), detects framework and package manager, runs dependency install command, and provides checkTsConfig() / updateTsConfigToStrict() using jsonc-parser.
CLI entry & prompts
packages/arkenv-cli/src/index.ts, packages/arkenv-cli/src/prompts.ts
CLI entry parses argv, prompts to enable strict mode if needed, runs runPromptWizard(), orchestrates scaffold() with spinner/error handling, and prints next-step instructions.
CLI helpers
packages/arkenv-cli/src/visuals.ts
Small CLI helper for formatting code-like output.

React Playground

Layer / File(s) Summary
TypeScript & Build Configuration
apps/playgrounds/arkenv-cli/package.json, apps/playgrounds/arkenv-cli/tsconfig.json, apps/playgrounds/arkenv-cli/tsconfig.app.json, apps/playgrounds/arkenv-cli/tsconfig.node.json, apps/playgrounds/arkenv-cli/vite.config.ts
Playground manifest with React/Vite deps; strict TypeScript configs and Vite config using React plugin and Babel/reactCompilerPreset.
React Application
apps/playgrounds/arkenv-cli/src/main.tsx, apps/playgrounds/arkenv-cli/src/app.tsx, apps/playgrounds/arkenv-cli/src/env.ts
App component with counter UI, env ArkEnv schema export, and React bootstrap.
Global & Component Styling
apps/playgrounds/arkenv-cli/src/index.css, apps/playgrounds/arkenv-cli/src/app.css
Theme variables, dark-mode overrides, responsive layouts, and component CSS for hero, counter, next-steps, and decorative elements.
Tooling & Documentation
apps/playgrounds/arkenv-cli/index.html, apps/playgrounds/arkenv-cli/eslint.config.js, apps/playgrounds/arkenv-cli/.gitignore, apps/playgrounds/arkenv-cli/README.md, packages/arkenv-cli/.vscode/extensions.json
HTML entry point, ESLint flat config, playground README, .gitignore, and VS Code recommendations.

OpenSpec Documentation

Layer / File(s) Summary
Design & Proposal
openspec/changes/arkenv-init/.openspec.yaml, openspec/changes/arkenv-init/design.md, openspec/changes/arkenv-init/proposal.md
Design and proposal describing extraction of CLI into @arkenv/cli, preserving arkenv zero-deps, and intended invocation patterns.
Formal Specifications & Tasks
openspec/changes/arkenv-init/specs/scaffolding-cli/spec.md, openspec/changes/arkenv-init/tasks.md
Requirements for interactive wizard behavior, validator/framework/language selection, env.ts generation, tsconfig strict enforcement, package manager detection, and phased migration checklist.

Workspace, Bun docs & misc

Layer / File(s) Summary
Workspace & dependency updates
arkenv.code-workspace, apps/playgrounds/vite-legacy/package.json, apps/www/package.json, .changeset/arkenv-init.md
Workspace folder re-scoping to @arkenv/* and @repo/*, caret semver adjustments in playground devDependencies, and changeset entry for @arkenv/cli patch release.
Bun docs terminology & IDEA config
openspec/changes/archive/2025-11-28-add-bun-plugin/*, packages/bun-plugin/CHANGELOG.md, .idea/vcs.xml
Minor phrasing updates ("type-safe" → "typesafe") in Bun plugin docs/changelog and IDEA issue-link pattern updates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

arkenv, example

Poem

A rabbit hops through init's delight,
Prompts and templates guiding the night,
From empty repo to env.ts bound,
Strict types set, scaffolds sound — 🐰✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Out of Scope Changes check ❓ Inconclusive The PR includes minor unrelated updates (vite-legacy/www package.json semver ranges, IDE config, bun-plugin docs wording) alongside the primary @arkenv/cli implementation. Clarify whether vite-legacy, www, and bun-plugin CHANGELOG updates belong in this PR or should be separated into independent changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: initial release of @arkenv/cli' is concise, clear, and directly describes the main change—introducing the new @arkenv/cli package.
Linked Issues check ✅ Passed The PR implements core scaffolding features from #896: interactive init command with validator/framework prompts, env.ts generation, dependency installation, and zero-dependency preservation in arkenv.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 896-create-arkenv-interactive-scaffold-cli-for-onboarding

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the docs Adds or changes documentation, or acts as documentation in and of itself label May 8, 2026
@yamcodes yamcodes modified the milestone: v1 May 8, 2026
@pkg-pr-new

pkg-pr-new Bot commented May 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

arkenv

npm i https://pkg.pr.new/yamcodes/arkenv@897

@arkenv/cli

npm i https://pkg.pr.new/yamcodes/arkenv/@arkenv/cli@897

@arkenv/bun-plugin

npm i https://pkg.pr.new/yamcodes/arkenv/@arkenv/bun-plugin@897

@arkenv/fumadocs-ui

npm i https://pkg.pr.new/yamcodes/arkenv/@arkenv/fumadocs-ui@897

@arkenv/vite-plugin

npm i https://pkg.pr.new/yamcodes/arkenv/@arkenv/vite-plugin@897

commit: 237f706

@arkenv-bot

arkenv-bot Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Package Size Limit Diff Status
arkenv 1.73 kB 1.95 kB 0.0%
arkenv/standard 1.01 kB 1.07 kB 0.0%
arkenv/core 441 B 500 B 0.0%
@arkenv/bun-plugin 2.4 kB 2.44 kB 0.0%

All size limits passed!

@github-actions github-actions Bot added the www Improvements or additions to arkenv.js.org label May 8, 2026
@github-actions github-actions Bot added the arkenv Changes to the `arkenv` npm package. label May 8, 2026
@yamcodes yamcodes changed the title feat: initialize project scaffolding for create-arkenv CLI tool feat: initial release of arkenv init May 8, 2026
@yamcodes
yamcodes marked this pull request as ready for review May 8, 2026 21:45
@yamcodes

yamcodes commented May 9, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 13

🧹 Nitpick comments (11)
apps/www/package.json (1)

64-81: ⚡ Quick win

Reconsider switching to caret ranges for build tooling.

Changing from exact versions to caret ranges for build-critical devDependencies (@babel/core, @rolldown/plugin-babel, babel-plugin-react-compiler) reduces build reproducibility. Since this is an application package (not published), exact versions ensure consistent builds across environments and prevent unexpected breakage from patch/minor updates in Babel and compiler tooling.

Unless there's a specific need for automatic updates, consider reverting to exact versions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/www/package.json` around lines 64 - 81, The devDependencies `@babel/core`,
`@rolldown/plugin-babel`, and babel-plugin-react-compiler were changed to caret
ranges which harms build reproducibility; revert those three entries in
package.json to exact pinned versions (remove the leading ^ and restore the
previously used exact version strings) so the app uses the exact tool versions
for consistent builds, and run a quick install to update lockfile accordingly.
packages/arkenv-cli/src/templates/valibot.ts (1)

3-3: ⚡ Quick win

Document exported API with JSDoc

Add a JSDoc comment for valibotTemplate so consumers can quickly understand frameworkNote and the generated output contract.

As per coding guidelines, "Use JSDoc comments for public APIs".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/arkenv-cli/src/templates/valibot.ts` at line 3, Add a JSDoc comment
above the exported function valibotTemplate that documents the frameworkNote
parameter (what it is and how it affects the generated template) and describes
the return value (the generated TypeScript template string containing the
contract). Ensure the JSDoc follows standard tags: `@param` {string} frameworkNote
and a brief `@returns` {string} summary so consumers can quickly understand the
API and output.
packages/arkenv-cli/src/templates/arktype.ts (1)

3-3: ⚡ Quick win

Add JSDoc for exported template helper

Please add a short JSDoc block for arktypeTemplate (params and return shape) since it’s a public exported API.

As per coding guidelines, "Use JSDoc comments for public APIs".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/arkenv-cli/src/templates/arktype.ts` at line 3, Add a JSDoc block
above the exported arktypeTemplate function describing the function, its
parameter (frameworkNote: string) and its return type (string template), e.g., a
short description, `@param` {string} frameworkNote and `@returns` {string>; ensure
the comment sits immediately above the arktypeTemplate declaration so the
exported helper has proper public API documentation.
packages/arkenv-cli/src/templates/zod.ts (1)

3-3: ⚡ Quick win

Add JSDoc to zodTemplate

Please document this exported helper with JSDoc (parameter intent + generated code purpose).

As per coding guidelines, "Use JSDoc comments for public APIs".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/arkenv-cli/src/templates/zod.ts` at line 3, Add a JSDoc block
immediately above the exported zodTemplate function that documents the function
as a public API: describe that zodTemplate generates a TypeScript/Zod schema
template string, explain the frameworkNote parameter (its intent to inject
framework-specific notes or comments into the generated template), and mention
the return type (a dedented TypeScript template string). Reference the exported
symbol zodTemplate and ensure the JSDoc follows standard tags like `@param` and
`@returns`.
packages/arkenv-cli/src/index.ts (3)

103-106: ⚡ Quick win

Remove redundant top-level error handler.

The main() function already has comprehensive error handling at lines 96-100. The outer .catch() at line 103 would never execute because all errors are caught and process.exit(1) is called inside the try-catch block.

Remove redundant handler
-main().catch((err) => {
-	log.error(String(err));
-	process.exit(1);
-});
+main();

Alternatively, if you want to keep defense-in-depth for unexpected errors, add a comment explaining why:

 main().catch((err) => {
+	// Defense-in-depth: catch any errors that escape the main error handler
 	log.error(String(err));
 	process.exit(1);
 });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/arkenv-cli/src/index.ts` around lines 103 - 106, The outer promise
rejection handler attached to main() (the .catch that calls log.error and
process.exit(1)) is redundant because main() already handles errors and exits
within its try-catch; remove the final main().catch(...) block (the one calling
log.error and process.exit) to avoid duplicate handling, or if you intentionally
want defense-in-depth keep the block but add a clear comment above it explaining
it's an extra safety net for unforeseen async rejections so future readers
understand its purpose; target the main() invocation and the surrounding
.catch(...) code for this change.

87-89: ⚡ Quick win

Simplify path normalization logic.

The conditional check for .startsWith("./") followed by a ternary is unnecessary—path.resolve() already normalizes paths correctly, and the relative path can be constructed directly.

Cleaner approach
-		const relPath = options.path.startsWith("./")
-			? options.path
-			: `./${options.path}`;
+		const relPath = path.relative(process.cwd(), targetPath).startsWith("..")
+			? options.path
+			: `./${path.relative(process.cwd(), targetPath)}`;

Or even simpler, if options.path is already expected to be in the correct format from the wizard:

-		const relPath = options.path.startsWith("./")
-			? options.path
-			: `./${options.path}`;
+		const relPath = options.path;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/arkenv-cli/src/index.ts` around lines 87 - 89, The relPath ternary
around options.path is unnecessary; replace the conditional logic that builds
relPath (the code assigning relPath from options.path.startsWith("./") ?
options.path : `./${options.path}`) with a direct normalized resolution using
Node's path utilities (e.g., use path.resolve or simply use options.path as-is
if the wizard guarantees format) so the path is normalized in one place; update
any references that consume relPath accordingly (look for the relPath variable
assignment in the module-level code in packages/arkenv-cli/src/index.ts).

19-26: ⚡ Quick win

Handle --help and -h flags explicitly.

The current logic only displays help when an unknown command is provided, but doesn't handle the common --help or -h flags when no command is given or when the command is init.

Suggested enhancement
 async function main() {
 	const args = process.argv.slice(2);
 	const command = args[0];
 
-	if (command && command !== "init") {
+	if (command === "--help" || command === "-h" || (command && command !== "init")) {
 		console.log(pc.cyan("ArkEnv CLI"));
 		console.log("\nUsage:");
 		console.log("  arkenv init    Set up ArkEnv in your project");
 		console.log("\nOptions:");
 		console.log("  --help, -h     Show this help message");
 		process.exit(0);
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/arkenv-cli/src/index.ts` around lines 19 - 26, The help text is only
shown for unknown commands; update the condition around the existing command
check (the `command` variable) to also trigger when the user passed `--help` or
`-h` (either as the command itself or present in process.argv), and also when
`init` is invoked with a `--help`/`-h` flag; change the `if (command && command
!== "init")` branch to something like checking `command === "--help" || command
=== "-h" || process.argv.includes("--help") || process.argv.includes("-h") ||
(command && command !== "init")` so the existing help printing and
`process.exit(0)` run for help flags as well. Ensure you reference and reuse the
same help output block (the console.log lines) and keep `init` behavior
unchanged except when help flags are present.
packages/arkenv-cli/src/prompts.ts (1)

81-86: 💤 Low value

Type assertion may be unnecessary.

The as ProjectOptions assertion at line 86 might not be needed if the object literal already matches the type. TypeScript should be able to infer this correctly.

Verify if assertion can be removed
 	return {
 		path: result.path || "./src/env.ts",
 		validator: result.validator,
 		framework: result.framework,
 		language: "ts",
-	} as ProjectOptions;
+	};

If TypeScript complains, the assertion is necessary; otherwise, removing it makes the code cleaner.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/arkenv-cli/src/prompts.ts` around lines 81 - 86, Remove the
unnecessary type assertion "as ProjectOptions" from the returned object (the
object using result.path/result.validator/result.framework and language: "ts");
ensure the function's declared return type (or inferred type) matches
ProjectOptions and that the properties (path, validator, framework, language)
satisfy ProjectOptions — if TypeScript then errors, restore the explicit return
type on the function or adjust property names/types accordingly rather than
re-adding the inline assertion.
packages/arkenv-cli/src/scaffold.ts (3)

53-63: ⚖️ Poor tradeoff

Consider using a more robust tsconfig discovery mechanism.

The current implementation only checks for tsconfig.app.json and tsconfig.json in the current directory. Modern TypeScript projects may use different names (tsconfig.base.json, tsconfig.node.json) or have tsconfig in parent directories.

Consider using TypeScript's own config resolution or checking for additional common patterns. However, since this is an initial implementation and the current approach covers the most common cases, this can be deferred to a future enhancement.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/arkenv-cli/src/scaffold.ts` around lines 53 - 63, The current
findTsConfig function only checks tsconfig.app.json and tsconfig.json in the
CWD; update it to be more robust by either (a) using TypeScript's API
(ts.findConfigFile / ts.sys.fileExists) to resolve the nearest tsconfig (so it
finds tsconfig.* and parent-directory configs) or (b) expand the filenames array
(add tsconfig.base.json, tsconfig.node.json, etc.) and walk up parent
directories until root; modify the files list and implement a parent-directory
loop in findTsConfig to return the first found config path or null.

42-48: ⚡ Quick win

Improve dependency installation error message.

The error message at line 47 only shows the failed command but doesn't include the underlying error details, making debugging harder for users.

Include underlying error details
 	try {
 		await exec(installCmd);
 	} catch (error) {
-		// If install fails, we don't want to crash the whole thing, but maybe log it?
-		// For now, we'll just let the user know they might need to run it manually.
-		throw new Error(`Failed to install dependencies: ${installCmd}`);
+		const message = error instanceof Error ? error.message : String(error);
+		throw new Error(
+			`Failed to install dependencies with command: ${installCmd}\n${message}\nYou may need to run this manually.`
+		);
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/arkenv-cli/src/scaffold.ts` around lines 42 - 48, The catch block
around exec(installCmd) currently throws a new Error that only includes the
command; change it to include the underlying error details (message and/or
stack) from the caught error so users can debug; update the throw in the catch
to combine `installCmd` with `error.message` or `error.stack` (cast the caught
value if needed) or log the full error before rethrowing, referencing the
existing `exec` call and `installCmd` variable to locate the change.

60-60: ⚡ Quick win

Add comments to empty catch blocks for clarity.

Multiple empty catch blocks appear throughout the file (lines 60, 141, 147, 151, 175). While these may be intentional (to silently ignore file-not-found errors), adding brief comments improves code maintainability.

Document silent error handling
 		try {
 			await fs.access(fullPath);
 			return fullPath;
-		} catch {}
+		} catch {
+			// File doesn't exist, try next candidate
+		}

Apply similar comments to the other empty catch blocks to clarify intent.

Also applies to: 141-141, 147-147, 151-151, 175-175

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/arkenv-cli/src/scaffold.ts` at line 60, There are multiple empty
catch blocks written as "catch {}" in scaffold.ts; replace each empty block with
a brief explanatory comment (e.g., "// intentionally ignore missing file" or "//
noop: expected when X may not exist") so reviewers understand the silent error
handling intent—update every occurrence of the bare catch {} (the ones noted in
the diff) with such concise comments adjacent to the catch to clarify why
exceptions are being ignored.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/playgrounds/arkenv-cli/.gitignore`:
- Around line 10-14: The .gitignore is missing rules to ignore environment files
which can leak secrets; update the .gitignore by adding patterns such as .env,
.env.local, .env.* and .env.*.local (or a single broad pattern like .env*) so
all local env files are ignored; edit the existing .gitignore (the shown
node_modules/dist entries) and append these .env ignore patterns to prevent
accidental commits of secrets.

In `@apps/playgrounds/arkenv-cli/eslint.config.js`:
- Around line 8-22: The flat ESLint config uses an invalid "extends" key; update
the array passed to defineConfig to spread the config arrays instead of nesting
them under "extends" — i.e., keep globalIgnores(["dist"]) and the file matcher
object (files: ["**/*.{ts,tsx}"], languageOptions: { globals: globals.browser })
but remove the extends property and instead include ...js.configs.recommended,
...tseslint.configs.recommended, ...reactHooks.configs.flat.recommended, and
...reactRefresh.configs.vite at the top level of the defineConfig array so those
configs are applied correctly.

In `@apps/playgrounds/arkenv-cli/package.json`:
- Around line 13-14: The package.json currently pins external semver ranges for
the internal packages "@arkenv/vite-plugin" and "arkenv"; update their
dependency entries to use the workspace protocol by replacing the version
strings with "workspace:*" for both "@arkenv/vite-plugin" and "arkenv" so the
playground uses the local workspace packages during monorepo development.

In `@apps/playgrounds/arkenv-cli/README.md`:
- Line 14: Update the README line that currently reads "Note: This will impact
Vite dev & build performances." to use singular wording: change "performances"
to "performance" so the sentence becomes "Note: This will impact Vite dev &
build performance." Locate and edit the sentence in the README.md
(apps/playgrounds/arkenv-cli/README.md) where that exact phrase appears.

In `@apps/playgrounds/arkenv-cli/src/index.css`:
- Around line 13-15: The CSS custom properties (--sans, --heading, --mono and
the other occurrence on line 23) contain capitalized font keywords that trigger
Stylelint's value-keyword-case rule; update the values so all keywords are
lowercased (e.g., change "Segoe UI", "Roboto", "Consolas" to lowercase
equivalents and ensure generic family names remain lowercase) by editing the
declarations for --sans, --heading, --mono and the other occurrence to use
lowercase tokens throughout.

In `@apps/playgrounds/arkenv-cli/vite.config.ts`:
- Line 7: The plugins array currently calls react() before babel(), but
`@vitejs/plugin-react` v6+ requires the `@rollup/plugin-babel` (babel(...)) to run
first so the React Compiler preset (reactCompilerPreset()) is applied by Babel;
update the plugins array to call babel({ presets: [reactCompilerPreset()] })
before react() (i.e., swap the order so babel(...) is the first entry).

In `@openspec/changes/arkenv-init/design.md`:
- Around line 26-35: The fenced code block that starts with ``` and contains
"User runs: pnpm dlx `@arkenv/cli`@latest init" is missing a language identifier
and triggers markdownlint MD040; update that opening fence to include a language
(e.g., use ```text or ```console) so the block becomes ```text (or ```console)
followed by the existing diagram and the closing ``` to satisfy the linter.

In `@packages/arkenv-cli/package.json`:
- Around line 9-12: The package.json currently exposes "main" and "files" but
lacks an explicit exports map; add an "exports" field that explicitly maps the
package entry points to the built files (e.g., map "." to the CommonJS and ESM
builds and to the type definitions and map "./*" to "./dist/*") so
Node/import-resolvers have an unambiguous public boundary; update package.json
to include this exports map alongside the existing "main" and "files" and ensure
the type entry (types or typesVersions) points to the built d.ts in dist.

In `@packages/arkenv-cli/src/prompts.ts`:
- Around line 72-75: Make cancellation behavior consistent by removing the hard
process exit in the onCancel handler so the caller can handle cancellations: in
the prompt's onCancel callback, replace the call to process.exit(0) with a
return of null (or simply let it invoke cancel("Operation cancelled.") and
return null), and keep the subsequent isCancel check that handles cancellation
at the call site; update any comments around onCancel/cancel/isCancel to reflect
that cancellation is propagated rather than terminating the process.

In `@packages/arkenv-cli/src/scaffold.ts`:
- Around line 107-124: The current regex-based edits to tsconfig.json (in the
block that reads content, tsConfigPath and fileName) are fragile; replace the
regex logic in the function that updates tsconfig (the code that tests
/"compilerOptions"\s*:\s*\{/ and /\{/) with a safe JSONC approach: read content,
parse it with jsonc-parser (parse), check parsed?.compilerOptions?.strict, and
if missing use modify to set ["compilerOptions","strict"] to true then
applyEdits and write the updated content to tsConfigPath; this preserves
comments/formatting and avoids touching nested/braced content or comments.
- Line 78: Replace the catch clauses typed as "e: any" with "e: unknown" and
narrow the error before using it: change both "catch (e: any)" occurrences to
"catch (e: unknown)" and where the code reads from e (logging or accessing
message/stack), use a type guard like "if (e instanceof Error) { /* use
e.message or e.stack */ } else { /* fallback: String(e) */ }" so you preserve
type safety without losing error details; update the two catch sites that
currently use "catch (e: any)" accordingly.
- Line 154: The check uses a type assertion to any on process.versions; replace
it with a type-safe property check on process.versions (e.g., use the 'in'
operator or Object.prototype.hasOwnProperty.call(process.versions, "bun") or
cast to Record<string, string | undefined> instead of any) so the runtime
detection for bun stays type-safe; update the line that references
process.versions to use one of these safe checks and return "bun" when the
property is present.
- Around line 19-21: The scaffold currently calls fs.writeFile(targetPath,
content, "utf-8") which can silently overwrite an existing env.ts; before
writing, check for file existence using fs.existsSync or fs.stat (referencing
targetPath) and if the file exists prompt the user (or surface a prompt in the
existing wizard flow) to confirm overwrite, then only call fs.writeFile from the
branch that confirms overwrite or from the branch where the file does not exist;
update the logic around getEnvTemplate and the write step to honor the user's
choice and abort or skip writing when the user declines.

---

Nitpick comments:
In `@apps/www/package.json`:
- Around line 64-81: The devDependencies `@babel/core`, `@rolldown/plugin-babel`,
and babel-plugin-react-compiler were changed to caret ranges which harms build
reproducibility; revert those three entries in package.json to exact pinned
versions (remove the leading ^ and restore the previously used exact version
strings) so the app uses the exact tool versions for consistent builds, and run
a quick install to update lockfile accordingly.

In `@packages/arkenv-cli/src/index.ts`:
- Around line 103-106: The outer promise rejection handler attached to main()
(the .catch that calls log.error and process.exit(1)) is redundant because
main() already handles errors and exits within its try-catch; remove the final
main().catch(...) block (the one calling log.error and process.exit) to avoid
duplicate handling, or if you intentionally want defense-in-depth keep the block
but add a clear comment above it explaining it's an extra safety net for
unforeseen async rejections so future readers understand its purpose; target the
main() invocation and the surrounding .catch(...) code for this change.
- Around line 87-89: The relPath ternary around options.path is unnecessary;
replace the conditional logic that builds relPath (the code assigning relPath
from options.path.startsWith("./") ? options.path : `./${options.path}`) with a
direct normalized resolution using Node's path utilities (e.g., use path.resolve
or simply use options.path as-is if the wizard guarantees format) so the path is
normalized in one place; update any references that consume relPath accordingly
(look for the relPath variable assignment in the module-level code in
packages/arkenv-cli/src/index.ts).
- Around line 19-26: The help text is only shown for unknown commands; update
the condition around the existing command check (the `command` variable) to also
trigger when the user passed `--help` or `-h` (either as the command itself or
present in process.argv), and also when `init` is invoked with a `--help`/`-h`
flag; change the `if (command && command !== "init")` branch to something like
checking `command === "--help" || command === "-h" ||
process.argv.includes("--help") || process.argv.includes("-h") || (command &&
command !== "init")` so the existing help printing and `process.exit(0)` run for
help flags as well. Ensure you reference and reuse the same help output block
(the console.log lines) and keep `init` behavior unchanged except when help
flags are present.

In `@packages/arkenv-cli/src/prompts.ts`:
- Around line 81-86: Remove the unnecessary type assertion "as ProjectOptions"
from the returned object (the object using
result.path/result.validator/result.framework and language: "ts"); ensure the
function's declared return type (or inferred type) matches ProjectOptions and
that the properties (path, validator, framework, language) satisfy
ProjectOptions — if TypeScript then errors, restore the explicit return type on
the function or adjust property names/types accordingly rather than re-adding
the inline assertion.

In `@packages/arkenv-cli/src/scaffold.ts`:
- Around line 53-63: The current findTsConfig function only checks
tsconfig.app.json and tsconfig.json in the CWD; update it to be more robust by
either (a) using TypeScript's API (ts.findConfigFile / ts.sys.fileExists) to
resolve the nearest tsconfig (so it finds tsconfig.* and parent-directory
configs) or (b) expand the filenames array (add tsconfig.base.json,
tsconfig.node.json, etc.) and walk up parent directories until root; modify the
files list and implement a parent-directory loop in findTsConfig to return the
first found config path or null.
- Around line 42-48: The catch block around exec(installCmd) currently throws a
new Error that only includes the command; change it to include the underlying
error details (message and/or stack) from the caught error so users can debug;
update the throw in the catch to combine `installCmd` with `error.message` or
`error.stack` (cast the caught value if needed) or log the full error before
rethrowing, referencing the existing `exec` call and `installCmd` variable to
locate the change.
- Line 60: There are multiple empty catch blocks written as "catch {}" in
scaffold.ts; replace each empty block with a brief explanatory comment (e.g.,
"// intentionally ignore missing file" or "// noop: expected when X may not
exist") so reviewers understand the silent error handling intent—update every
occurrence of the bare catch {} (the ones noted in the diff) with such concise
comments adjacent to the catch to clarify why exceptions are being ignored.

In `@packages/arkenv-cli/src/templates/arktype.ts`:
- Line 3: Add a JSDoc block above the exported arktypeTemplate function
describing the function, its parameter (frameworkNote: string) and its return
type (string template), e.g., a short description, `@param` {string} frameworkNote
and `@returns` {string>; ensure the comment sits immediately above the
arktypeTemplate declaration so the exported helper has proper public API
documentation.

In `@packages/arkenv-cli/src/templates/valibot.ts`:
- Line 3: Add a JSDoc comment above the exported function valibotTemplate that
documents the frameworkNote parameter (what it is and how it affects the
generated template) and describes the return value (the generated TypeScript
template string containing the contract). Ensure the JSDoc follows standard
tags: `@param` {string} frameworkNote and a brief `@returns` {string} summary so
consumers can quickly understand the API and output.

In `@packages/arkenv-cli/src/templates/zod.ts`:
- Line 3: Add a JSDoc block immediately above the exported zodTemplate function
that documents the function as a public API: describe that zodTemplate generates
a TypeScript/Zod schema template string, explain the frameworkNote parameter
(its intent to inject framework-specific notes or comments into the generated
template), and mention the return type (a dedented TypeScript template string).
Reference the exported symbol zodTemplate and ensure the JSDoc follows standard
tags like `@param` and `@returns`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e1bfe3af-8ef6-4ca8-af92-84f20c66f21c

📥 Commits

Reviewing files that changed from the base of the PR and between c70d4d6 and bd7d6ce.

⛔ Files ignored due to path filters (6)
  • apps/playgrounds/arkenv-cli/public/favicon.svg is excluded by !**/*.svg
  • apps/playgrounds/arkenv-cli/public/icons.svg is excluded by !**/*.svg
  • apps/playgrounds/arkenv-cli/src/assets/hero.png is excluded by !**/*.png
  • apps/playgrounds/arkenv-cli/src/assets/react.svg is excluded by !**/*.svg
  • apps/playgrounds/arkenv-cli/src/assets/vite.svg is excluded by !**/*.svg
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (38)
  • .changeset/arkenv-init.md
  • apps/playgrounds/arkenv-cli/.gitignore
  • apps/playgrounds/arkenv-cli/README.md
  • apps/playgrounds/arkenv-cli/eslint.config.js
  • apps/playgrounds/arkenv-cli/index.html
  • apps/playgrounds/arkenv-cli/package.json
  • apps/playgrounds/arkenv-cli/src/app.css
  • apps/playgrounds/arkenv-cli/src/app.tsx
  • apps/playgrounds/arkenv-cli/src/env.ts
  • apps/playgrounds/arkenv-cli/src/index.css
  • apps/playgrounds/arkenv-cli/src/main.tsx
  • apps/playgrounds/arkenv-cli/tsconfig.app.json
  • apps/playgrounds/arkenv-cli/tsconfig.json
  • apps/playgrounds/arkenv-cli/tsconfig.node.json
  • apps/playgrounds/arkenv-cli/vite.config.ts
  • apps/playgrounds/vite-legacy/package.json
  • apps/www/package.json
  • arkenv.code-workspace
  • openspec/changes/archive/2025-11-28-add-bun-plugin/proposal.md
  • openspec/changes/archive/2025-11-28-add-bun-plugin/specs/bun-plugin/spec.md
  • openspec/changes/arkenv-init/.openspec.yaml
  • openspec/changes/arkenv-init/design.md
  • openspec/changes/arkenv-init/proposal.md
  • openspec/changes/arkenv-init/specs/scaffolding-cli/spec.md
  • openspec/changes/arkenv-init/tasks.md
  • openspec/specs/bun-plugin/spec.md
  • packages/arkenv-cli/.vscode/extensions.json
  • packages/arkenv-cli/package.json
  • packages/arkenv-cli/src/env-template.ts
  • packages/arkenv-cli/src/index.ts
  • packages/arkenv-cli/src/prompts.ts
  • packages/arkenv-cli/src/scaffold.ts
  • packages/arkenv-cli/src/templates/arktype.ts
  • packages/arkenv-cli/src/templates/index.ts
  • packages/arkenv-cli/src/templates/valibot.ts
  • packages/arkenv-cli/src/templates/zod.ts
  • packages/arkenv-cli/tsdown.config.ts
  • packages/bun-plugin/CHANGELOG.md

Comment thread apps/playgrounds/arkenv-cli/.gitignore
Comment thread apps/playgrounds/arkenv-cli/eslint.config.js
Comment thread apps/playgrounds/arkenv-cli/package.json Outdated
Comment thread apps/playgrounds/arkenv-cli/README.md Outdated
Comment thread apps/playgrounds/arkenv-cli/src/index.css Outdated
Comment thread packages/arkenv-cli/src/prompts.ts
Comment thread packages/arkenv-cli/src/scaffold.ts Outdated
Comment thread packages/arkenv-cli/src/scaffold.ts Outdated
Comment thread packages/arkenv-cli/src/scaffold.ts Outdated
Comment thread packages/arkenv-cli/src/scaffold.ts Outdated
@arkenv-bot

arkenv-bot Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (Asia/Almaty)
arkenv Ready Ready Preview, Comment May 9 2026, 10:30 AM (Asia/Almaty)

@github-actions github-actions Bot added the arkenv Changes to the `arkenv` npm package. label May 9, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

♻️ Duplicate comments (1)
apps/playgrounds/arkenv-cli/src/index.css (1)

23-23: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix remaining Stylelint value-keyword-case violation.

The CSS keyword optimizeLegibility should be lowercase to satisfy the Stylelint rule. This was flagged in a previous review but remains unfixed.

🎨 Proposed fix
-	text-rendering: optimizeLegibility;
+	text-rendering: optimizelegibility;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/playgrounds/arkenv-cli/src/index.css` at line 23, Replace the CamelCase
CSS keyword in the text-rendering declaration with its lowercase form to satisfy
Stylelint's value-keyword-case rule; specifically update the text-rendering
property value (currently "optimizeLegibility") to the lowercase
"optimizelegibility" in apps/playgrounds/arkenv-cli/src/index.css so the linter
no longer flags the violation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.idea/vcs.xml:
- Around line 18-41: The IssueNavigationLink entries contain duplicate
issueRegexp patterns (\(#(\d+)\), #(\d+), GH-(\d+)) mapped to different
linkRegexp hosts (aruaycodes, yamcodes, danciudev) so IntelliJ will always match
the first entry and never reach later ones; fix by either removing the old
aruhaycodes entries (delete the IssueNavigationLink blocks that reference
aruhaycodes) or make patterns repository-specific (change the issueRegexp values
to unique prefixes per fork, e.g., YAM-(\d+) or DAN-(\d+), and update the
corresponding linkRegexp entries) so each IssueNavigationLink block uniquely
identifies which repo it links to.

In `@packages/arkenv-cli/src/index.ts`:
- Around line 94-95: The code uses path.relative and path.resolve when computing
relPath and displayPath but never imports the path module; add an import for the
Node path API (e.g., import path from "node:path" or const path =
require("path") depending on project module style) at the top of the file so
relPath, displayPath and the calls path.relative(path.resolve(...)) referencing
options.path work without a ReferenceError.

In `@packages/arkenv-cli/src/prompts.ts`:
- Around line 3-8: The ProjectOptions type and related prompt logic currently
hardcode language "ts" and limit validator/framework choices, preventing
supported scaffolds; update the ProjectOptions type to allow language: "ts" |
"js", validator: "arktype" | "zod" | "valibot" | "plain", and framework: "vite"
| "bun" | "node" | "next.js" | "none", then propagate these expanded unions into
every prompt/validation branch that references ProjectOptions (e.g., any
functions or constants handling validator, framework, or language at the earlier
referenced blocks), ensuring prompt choices, default values, and downstream
scaffolding logic accept "plain", "next.js", "none", and "js" paths so the
wizard can scaffold all documented entry points.

In `@packages/arkenv-cli/src/scaffold.ts`:
- Around line 24-35: If the user declines overwriting the existing file (check
the confirmOverwrite result after prompting for targetPath), abort the scaffold
early instead of proceeding to later side effects: when confirmOverwrite is
false, return from the scaffold function (or prompt explicitly to continue
without writing) so you do not call fsp.writeFile, do not mutate tsconfig, and
do not invoke the package installation steps; update the control flow around the
confirm/existsSync block to exit early on a declined overwrite to prevent
partial setup.
- Around line 173-202: The detectPackageManager function currently only inspects
package.json and lockfiles and thus can mis-detect the invoking tool; update
detectPackageManager to first check process.env.npm_config_user_agent (and
optionally process.env.npm_config_user_agent?.toString()) and parse it for
"pnpm", "yarn", "bun", or "npm" returning the matched manager immediately; only
if the user agent is missing or unrecognized fall back to the existing
filesystem walk and package.json/packageManager checks already in
detectPackageManager.
- Around line 54-63: The install step currently uses exec(installCmd) which
buffers output and can hit maxBuffer; replace this with a child_process.spawn
invocation that runs the same command returned by
getInstallCommand(packageManager, deps) and streams output by setting stdio:
'inherit' (and properly wiring the shell option if using a single string
command); ensure you await the spawned process by listening for the
'close'/'exit' event and throw an Error on non-zero exit code (preserve the
existing error message format referencing installCmd), and remove the exec
import/usages accordingly.

---

Duplicate comments:
In `@apps/playgrounds/arkenv-cli/src/index.css`:
- Line 23: Replace the CamelCase CSS keyword in the text-rendering declaration
with its lowercase form to satisfy Stylelint's value-keyword-case rule;
specifically update the text-rendering property value (currently
"optimizeLegibility") to the lowercase "optimizelegibility" in
apps/playgrounds/arkenv-cli/src/index.css so the linter no longer flags the
violation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 86aee0ae-ce45-429f-af9b-d1ceb5a2b76e

📥 Commits

Reviewing files that changed from the base of the PR and between bd7d6ce and cf72b6b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (16)
  • .idea/vcs.xml
  • apps/playgrounds/arkenv-cli/.gitignore
  • apps/playgrounds/arkenv-cli/README.md
  • apps/playgrounds/arkenv-cli/eslint.config.js
  • apps/playgrounds/arkenv-cli/package.json
  • apps/playgrounds/arkenv-cli/src/index.css
  • apps/playgrounds/arkenv-cli/vite.config.ts
  • openspec/changes/arkenv-init/design.md
  • packages/arkenv-cli/package.json
  • packages/arkenv-cli/src/index.ts
  • packages/arkenv-cli/src/prompts.ts
  • packages/arkenv-cli/src/scaffold.ts
  • packages/arkenv-cli/src/templates/arktype.ts
  • packages/arkenv-cli/src/templates/valibot.ts
  • packages/arkenv-cli/src/templates/zod.ts
  • packages/arkenv-cli/src/visuals.ts
✅ Files skipped from review due to trivial changes (5)
  • apps/playgrounds/arkenv-cli/.gitignore
  • packages/arkenv-cli/src/visuals.ts
  • apps/playgrounds/arkenv-cli/README.md
  • apps/playgrounds/arkenv-cli/package.json
  • packages/arkenv-cli/package.json
🚧 Files skipped from review as they are similar to previous changes (5)
  • apps/playgrounds/arkenv-cli/vite.config.ts
  • packages/arkenv-cli/src/templates/valibot.ts
  • packages/arkenv-cli/src/templates/arktype.ts
  • packages/arkenv-cli/src/templates/zod.ts
  • apps/playgrounds/arkenv-cli/eslint.config.js

Comment thread .idea/vcs.xml Outdated
Comment thread packages/arkenv-cli/src/index.ts
Comment on lines +3 to +8
export type ProjectOptions = {
path: string;
validator: "arktype" | "zod" | "valibot";
framework: "vite" | "bun" | "node";
language: "ts"; // TODO: Support JS
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Don't ship a narrower prompt matrix than issue #896 requires.

This wizard currently hardcodes TypeScript and only offers arktype/zod/valibot plus vite/bun/node. That leaves out the required plain, next.js, none, and JS paths, so the initial release cannot scaffold several documented entry points from the PR objective.

Also applies to: 15-18, 37-52, 81-85

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/arkenv-cli/src/prompts.ts` around lines 3 - 8, The ProjectOptions
type and related prompt logic currently hardcode language "ts" and limit
validator/framework choices, preventing supported scaffolds; update the
ProjectOptions type to allow language: "ts" | "js", validator: "arktype" | "zod"
| "valibot" | "plain", and framework: "vite" | "bun" | "node" | "next.js" |
"none", then propagate these expanded unions into every prompt/validation branch
that references ProjectOptions (e.g., any functions or constants handling
validator, framework, or language at the earlier referenced blocks), ensuring
prompt choices, default values, and downstream scaffolding logic accept "plain",
"next.js", "none", and "js" paths so the wizard can scaffold all documented
entry points.

Comment thread packages/arkenv-cli/src/scaffold.ts
Comment thread packages/arkenv-cli/src/scaffold.ts Outdated
Comment thread packages/arkenv-cli/src/scaffold.ts
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
@github-actions github-actions Bot added the tests This issue or PR is about adding, removing or changing tests label May 9, 2026
@yamcodes
yamcodes merged commit bd77362 into main May 9, 2026
19 of 20 checks passed
@yamcodes
yamcodes deleted the 896-create-arkenv-interactive-scaffold-cli-for-onboarding branch May 9, 2026 10:03
@arkenv-bot arkenv-bot Bot mentioned this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arkenv Changes to the `arkenv` npm package. docs Adds or changes documentation, or acts as documentation in and of itself tests This issue or PR is about adding, removing or changing tests www Improvements or additions to arkenv.js.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

arkenv init: interactive scaffold CLI for onboarding

1 participant