nf start resolves a relative --cert or --key against the loader folder

未关闭
#282 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
75/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
bun, typescript
领域
cli

调研方向

Read src/action/actions/start.action.ts around lines 221–222 to trace how certificate and key paths are passed to the loader; the issue says flags should resolve from the current working directory and config values from the project folder. Check the loader startup path and the start.mdx limitation, then verify both files are checked before startup and relative paths work for both input sources.

由索引模型根据 Issue 内容生成。

描述

bug command:start
Which package is this bug report for?

@nanoforge-dev/cli

Which command is this bug report for?

start

Issue description

nf start --cert <path> --key <path> (or tls.cert/tls.key in the config) only works with absolute paths (read from the code, not run). -d is made absolute with getCwd, but cert and key are passed as given (src/action/actions/start.action.ts#L221-L222). The loader runs with its cwd in node_modules/@nanoforge-dev/loader-client and opens the files with Bun.file(cert) (Loader apps/client/src/server.ts line 60). So --cert ./cert.pem, or a relative path in the config, points into the loader's folder and the client fails to start. Because of the exit-code issue on nf start, the command then exits 0 too.

start.mdx documents this as a limitation (lines 61 and 96). Related to #156, which added TLS to the config.

Expected: relative paths are resolved (from the cwd for the flags, from the project folder for config values), and both files are checked before the loader starts.

Found during a read-only audit of main at e95b881 (2026-11-11).

Code sample
params["--cert"] = target.tls.cert;   // passed as given
params["--key"] = target.tls.key;
// while "-d": getCwd(join(target.directory, target.outDir)) is made absolute
Versions
  • @nanoforge-dev/cli 3.0.1 (main, e95b881)
  • Node.js 26.7.0
  • Bun 1.3.14 (bundled)
  • Linux
Issue priority

Low (slightly annoying)

I have tested this issue on a development release

No response

主要语言
TypeScript
星标
2
派生
2
平均合并
2 天 18 小时
30 天内合并 PR
17

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NanoForge-dev/CLI 的其他 Issue

查看 NanoForge-dev/CLI 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。