Skip to content

Add --json output support to lstk start - #467

Draft
anisaoshafi wants to merge 1 commit into
mainfrom
devx-1052-add-json-support-to-lstk-start
Draft

Add --json output support to lstk start#467
anisaoshafi wants to merge 1 commit into
mainfrom
devx-1052-add-json-support-to-lstk-start

Conversation

@anisaoshafi

Copy link
Copy Markdown
Collaborator

Motivation

The LocalStack Toolkit for VS Code is migrating onto a bundled lstk and needs a machine-readable contract instead of scraping human output. start is the first lifecycle command it needs.

Solution

start and the bare lstk now accept --json, emitting the envelope shape already agreed in openspec/changes/json-output-schema (task 5.1).

The start path had no result-carrying event — the result existed only as prose. A new EmulatorStartedEvent owns it, with a formatter reproducing the • Endpoint: line exactly, so plain-text output is unchanged. All 12 ErrorEvent sites in container.Start gained codes, and AUTH_REQUIRED now returns its reserved exit code 4.

Three spec corrections, recorded as appended tasks.md items:

  • The "two configured types report two entries" scenario is unreachable (checkSingleContainer fails first) — now asserts CONFIG_INVALID.
  • When LocalStack answers on the port but isn't in a container lstk manages, start exited 0 with no emulator reported at all. Fixed.
  • LICENSE_UNSUPPORTED_TAG dropped as unreachable; SNAPSHOT_NOT_FOUNDSNAPSHOT_INVALID_REF.

Settles design.md's NDJSON question for start only (single final envelope), leaving it open for restart and the snapshot commands.

Docs

User-facing. docs/structured-output.md moves start from the draft catalog into Implemented with its real payload and error codes, and gains the "Adding --json support to a command" section that CLAUDE.md:268 has pointed at since #374 but which was never written.

No new flags or config keys — --json already exists globally; this opts a command into it.

Review

Human review advised — establishes a wire contract an external consumer depends on, and touches the CLI's hottest code path.

Closes DEVX-1052

@anisaoshafi anisaoshafi added semver: minor docs: needed Pull request requires documentation updates labels Aug 21, 2026
Co-Authored-By: Claude <noreply@anthropic.com>
@anisaoshafi
anisaoshafi force-pushed the devx-1052-add-json-support-to-lstk-start branch from 919ea4e to 1723e9d Compare August 21, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: needed Pull request requires documentation updates semver: minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant