Skip to content

feat(cli): project + env authoring & use picker (spec 30 phase 3) - #120

Merged
gustavobertoi merged 1 commit into
mainfrom
feat/authoring-tuis
Jul 2, 2026
Merged

feat(cli): project + env authoring & use picker (spec 30 phase 3)#120
gustavobertoi merged 1 commit into
mainfrom
feat/authoring-tuis

Conversation

@gustavobertoi

Copy link
Copy Markdown
Contributor

Summary

The authoring surface of spec 30 — projects, env vars, and a fuzzy use picker. Editing is comment-preserving (the [Q-YAML-ROUNDTRIP] answer), reusing the AST rewriter from secrets ingest.

What's in

  • use (bare, on a TTY) → a huh fuzzy project picker; non-TTY falls back to the printed hint.
  • project list / project new <name> — list projects; scaffold a devstack.yaml and register it in workspace.yaml via a comment-preserving AST merge (--path, --template, --uses, --git).
  • env list / env set KEY=VALUE ... / env unset KEY ... — view/edit a service's local env.raw. Edits go through internal/envingest's AST rewriter, so comments and key order survive; the file is backed up before write. secret:// values pass straight through.
  • internal/envingest: exported SetEnv / ReplaceEnvBlock / AppendProjectRef.

Verified end-to-end

env set LOG_LEVEL=debug on a devstack.yaml keeps # dev server and APP_ENV: dev # keep me intact and adds the key; project new worker preserves the # projects below comment in workspace.yaml.

Tests / gates

internal/envingest/edit_test.go (comment preservation, block creation, project append) + command registration. make ci (fmt/vet/build/test-race) + make determinism green.

This completes spec 30. Together with #118/#119 (spec 31), the RFC lane is implemented across stacked PRs.

🤖 Generated with Claude Code

The authoring surface of the interactive-DX lane.

- `use` (bare, TTY) opens a huh fuzzy project picker; non-TTY falls back to the
  printed hint.
- `project list` / `project new <name>` — list projects; scaffold a devstack.yaml
  and register it in workspace.yaml via a comment-preserving AST merge.
- `env list` / `env set KEY=VALUE ...` / `env unset KEY ...` — view and edit a
  service's local env.raw. Edits reuse internal/envingest's AST rewriter, so
  comments and key order survive (the [Q-YAML-ROUNDTRIP] answer); files are backed
  up before write. secret:// values pass straight through.
- internal/envingest: exported SetEnv / ReplaceEnvBlock / AppendProjectRef.

Tests: envingest edits preserve comments / create blocks / append project refs;
command registration. make ci + determinism green. Verified end-to-end: env set
keeps `# comments`, project new preserves workspace.yaml comments.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gustavobertoi
gustavobertoi force-pushed the feat/authoring-tuis branch from 643e293 to 1b86f59 Compare July 2, 2026 01:57
@gustavobertoi
gustavobertoi merged commit 149ed68 into main Jul 2, 2026
4 checks passed
@gustavobertoi
gustavobertoi deleted the feat/authoring-tuis branch July 2, 2026 02:13
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.

1 participant