Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[P1] 提供面向 agents 的非交互 CLI 与机器可读输出

Open
#13 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript, wasm
Domain
api, cli, testing

Research direction

Start with package.json, the existing HTTP API, and the CLI implementation delivered by PRs #14 and #15; review pending PR #16 for the current boundary. Run the spawn-based CLI integration tests and real Hoya JS/Rust WASM smoke tests described in the acceptance criteria. Done means the remaining acceptance items are implemented without duplicating completed work, with documented schemas, exit codes, idempotency, and recovery behavior.

Written by the indexing model from the issue text.

Description

priority:P1 type:feature

用户问题与代码依据

当前 package.json 没有 bin 入口,仅 start/dev/build/test;已有 HTTP API 和 /llms.txt,但 agent 需手工拼 HTTP 请求。维护者要求 CLI/API 优先,前期全命令行验证,UI 先展示。

评估基线:2026-09-06,Hosta 666eca9 / Hoya 2234baa。此项记录待实现目标,不表示已完成。

验收标准

  • 提供可安装的 hosta 命令及 --help/version;通过 HTTP API 操作平台,不直接读写数据库或复制执行引擎。基础命令覆盖 doctor/status、apps create/list/get、versions upload/list、run、publish、invoke、runs get/list/logs;回滚/密钥/调度等随对应 API issue 扩展。
  • 支持 --json 输出版本化、稳定 JSON 结果(含 ID、status、error.code、retryable);stdout 只输出结果,诊断走 stderr。成功退出 0,参数/认证/网络/执行失败有文档化非零退出码;等待模式遇到 guest failed/timed_out 也必须非零。
  • 支持文件或 stdin 传入源码/JSON,明确 --app/--version 和不可变 hash;无隐式 latest 发布。--wait/--timeout 等待异步任务,返回 jobId/runId 便于恢复查询,超时不盲目重复有副作用的命令。
  • 默认无需 TTY 或提问;服务 URL/token 可由显式配置或环境提供,密钥不进入普通日志。破坏性操作需要明确 flag(如 --yes)并检查作用对象;普通发布不隐式轮换 key。
  • 文档与 --help 可供 agent 发现命令、schema、退出码及幂等规则;写操作重试复用明确 idempotency key,不自动重试不确定的 invoke/发布副作用。支持幂等需要服务端 API 配合。
  • 用 spawn CLI 的集成测试验证无 TTY、管道输入、JSON 可解析、stderr 分离、guest 失败退出码、无效凭据、服务离线和版本不存在;真实 Hoya JS/WASM smoke 全程命令行。A0 先实现基础命令与最小幂等,A1 扩展治理/诊断子命令,按子项验收。

归属与范围

归属:worktools/hosta。阶段:A0 · 双运行时执行基线。维护者已确认:CLI/API 优先,前期全命令行验收,UI 先只读展示,网页交互后续评估。沿用独立 Hoya 引擎与 Hosta 控制面边界;本项不扩展到多租户、计费、DAG 或全球调度。

依赖

下游验收

实施进展(2026-09-06)

PR #14 提供 hosta CLI:非交互 JSON/stdout、退出码、stdin/文件输入、显式版本、apps/versions/run/publish/invoke/runs/logs/doctor,以及 app/version 最小幂等。文档和真实 CLI 子进程测试已补齐,含实际 Hoya JS/Rust WASM smoke。异步生成任务、取消、部署治理/调度扩展命令未实现;前期子集可评审,此父项按剩余验收继续跟踪。

部署 CLI 进展(PR #15)

新增 deployments get/rollback/disable/rotate-key;回滚要求显式版本,拒绝跨应用、未验证版本和停用部署。恢复使用 publish 指定版本。真实 Hoya JS/Rust WASM 回归已覆盖 v1→v2(旧 key 可用)→回滚→停用拒绝→恢复→轮换旧 key 失效。4 组测试全部通过,无跳过。PR #15 基于 #14;发布事件历史与部署/运行关联仍待完成,父 issue 保持开放。移除已发布的 issue JSON 中间导出,后续以 GitHub issues 为状态来源。

合并跟进(2026-09-06 10:22 CST)

Hosta #15 已合入 #14,#14 已合入 main(160f0d3),部署 CLI 与独立引擎接入均已进入主分支。Hosta main 的真实双运行时集成 CI 通过;Hoya #12/#13/#14 均已合并,最新 main Test 通过。无未解决审查意见。两仓库的 issue 中间导出已清理,构建/缓存忽略规则已补充。本项剩余验收继续按既定范围跟踪,不因首轮 PR 合并而提前关闭。

2026-09-08:运行重试(PR #16,待合并)

新增 runs retry --run ID --yes 和 POST /api/runs/:id/retry(confirm=true)。固定原版本与输入,新 runId + retryOf + retry trigger,原记录不变;拒绝运行中、参数覆盖和无确认请求。重试失败非零退出,成功重试也不替代发布手动试运行。CLI 增加 --trigger 筛选。数据源/引擎使用当前配置,文档已说明不是历史环境重放。构建及 5 组测试通过,无跳过,包含真实 JS/Rust WASM 和拒绝路径;仅提交源码、测试和文档。重启恢复、更多秘密脱敏/错误指导等剩余验收仍开放。

Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
1h 18m
Merged PRs (30d)
7

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from worktools/hosta

All issues in worktools/hosta

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.