@localstack/lstk_darwin_amd64 0.16.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +72 -5
  2. package/lstk +0 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -47,11 +47,16 @@ Running `lstk` will automatically handle configuration setup and start LocalStac
47
47
  - **Log streaming** — tail emulator logs in real-time with `--follow`; use `--verbose` to show all logs without filtering
48
48
  - **Snapshots** — save, load, and remove emulator state as local files, named cloud snapshots (`pod:` prefix), or in your own S3 bucket (`s3://`), and auto-load one on start
49
49
  - **Browser-based login** — authenticate via browser and store credentials securely in the system keyring
50
+ - **AWS CLI proxy** — run `lstk aws <args>` with endpoint, credentials, and region pre-configured
50
51
  - **AWS CLI profile** — optionally configure a `localstack` profile in `~/.aws/` after start
51
52
  - **Terraform integration** — proxy Terraform commands to LocalStack with automatic AWS provider endpoint configuration
52
53
  - **CDK integration** — proxy AWS CDK commands to LocalStack with automatic endpoint configuration (requires AWS CDK >= 2.177.0)
54
+ - **SAM integration** — proxy AWS SAM CLI commands to LocalStack (requires AWS SAM CLI >= 1.95.0)
55
+ - **Reset / restart** — clear in-memory emulator state with `lstk reset`, or restart the emulator with `lstk restart`
56
+ - **Extensions** — Git-style `lstk-<name>` executables extend the CLI with new commands
53
57
  - **Self-update** — check for and install the latest `lstk` release with `lstk update`
54
58
  - **Shell completions** — bash, zsh, and fish completions included
59
+ - **Structured JSON output** — pass `--json` to a supported command (`stop`, `reset`, `update` today, more planned) for a machine-readable envelope instead of formatted text; see [docs/structured-output.md](docs/structured-output.md)
55
60
 
56
61
  ## Authentication
57
62
 
@@ -94,11 +99,14 @@ port = "4566"
94
99
 
95
100
  The chosen emulator must be running before you set up or use its CLI integration below.
96
101
 
102
+ > [!NOTE]
103
+ > Only one `[[containers]]` block can be enabled at a time — running multiple emulators together (e.g. AWS and Snowflake) isn't supported yet.
104
+
97
105
  You can also configure cloud CLI integration:
98
106
 
99
107
  ```bash
100
108
  lstk setup aws # localstack profile in ~/.aws/
101
- lstk setup azure # isolated Azure CLI config for `lstk az` (requires the Azure CLI)
109
+ lstk setup azure # isolated Azure CLI config for `lstk az` (requires the Azure CLI); alias: lstk setup az
102
110
  ```
103
111
 
104
112
  After starting the Azure emulator and running `lstk setup azure`, run Azure CLI commands against LocalStack with `lstk az`:
@@ -132,6 +140,7 @@ lstk --config /path/to/config.toml start
132
140
  type = "aws" # Emulator type. Currently supported: "aws", "snowflake", "azure"
133
141
  tag = "latest" # Docker image tag, e.g. "latest", "2026.03"
134
142
  port = "4566" # Host port the emulator will be accessible on
143
+ # image = "" # Override the default Docker image, e.g. an internal registry mirror (see below)
135
144
  # volumes = [] # Bind mounts, "host:container[:ro]" (see below)
136
145
  # env = [] # Named environment profiles to apply (see [env.*] sections below)
137
146
  # snapshot = "pod:my-baseline" # Snapshot REF auto-loaded on start (AWS only); see Snapshots below
@@ -141,6 +150,7 @@ port = "4566" # Host port the emulator will be accessible on
141
150
  - `type`: emulator type; one of `"aws"`, `"snowflake"`, or `"azure"`
142
151
  - `tag`: Docker image tag for LocalStack (e.g. `"latest"`, `"4.14.0"`); useful for pinning a version
143
152
  - `port`: port LocalStack listens on (default `4566`)
153
+ - `image`: (optional) override the default `localstack/<product>:<tag>` image, e.g. `"my-registry.example.com/localstack:latest"` for an internal mirror or a locally loaded offline image; if it already carries a tag, `tag` above is ignored
144
154
  - `volumes`: (optional) list of `"host:container[:ro]"` bind mounts, e.g. for init hooks or the persistent-state directory (see below)
145
155
  - `env`: (optional) list of named environment variable groups to inject into the container (see below)
146
156
  - `snapshot`: (optional) snapshot REF auto-loaded after the emulator starts on a fresh run — a local file path or a `pod:` cloud snapshot (see [Snapshots](#snapshots))
@@ -168,6 +178,22 @@ EAGER_SERVICE_LOADING = "1"
168
178
 
169
179
  Host environment variables prefixed with `LOCALSTACK_` are also forwarded to the emulator.
170
180
 
181
+ ### Exposing the emulator beyond localhost
182
+
183
+ By default the gateway (and its published ports) are only reachable from `localhost`. To expose it more broadly (e.g. on an EC2 or VM host), set `GATEWAY_LISTEN` in an `[env.*]` profile:
184
+
185
+ ```toml
186
+ [[containers]]
187
+ type = "aws"
188
+ port = "4566"
189
+ env = ["public"]
190
+
191
+ [env.public]
192
+ GATEWAY_LISTEN = "0.0.0.0:4566,0.0.0.0:443"
193
+ ```
194
+
195
+ The host part of the first entry becomes the bind address for every published port (the gateway ports and the 4510-4559 service range); it defaults to `127.0.0.1` when unset.
196
+
171
197
  ### Mounting volumes and init hooks
172
198
 
173
199
  Use `volumes` to bind-mount host files or directories into the emulator, given as Docker-style `"host:container[:ro]"` strings. The most common use is [init hooks](https://docs.localstack.cloud/snowflake/capabilities/init-hooks/) — scripts LocalStack runs automatically on startup when mounted into `/etc/localstack/init/{boot,start,ready,shutdown}.d`:
@@ -198,7 +224,7 @@ volumes = ["/data:/var/lib/localstack"]
198
224
  `lstk start` degrades gracefully when the common enterprise blockers (Docker Hub unreachable, a forward proxy, TLS interception, or an unreachable license server) make a network request fail:
199
225
 
200
226
  - If the image cannot be pulled but is already present locally, `lstk` warns and starts the local image instead of failing.
201
- - If the license server cannot be reached, `lstk` skips its pre-flight check and lets the emulator validate its own bundled license at startup. A definitive rejection from the server (e.g. an invalid token) stays fatal.
227
+ - If the license server cannot be reached, or it rejects the configured image tag as unrecognized (e.g. a `dev` nightly or a custom enterprise-mirror tag), `lstk` skips its pre-flight check and lets the emulator validate the license at startup. A definitive rejection from the server (e.g. an invalid token) stays fatal.
202
228
 
203
229
  Pair this with a custom `image` in the config to point at a locally loaded image or an internal-registry mirror.
204
230
 
@@ -223,6 +249,15 @@ lstk --non-interactive
223
249
  | `LSTK_OTEL=1` | Enables OpenTelemetry trace export (disabled by default). When enabled, standard `OTEL_EXPORTER_OTLP_*` env vars are respected by the SDK (e.g. `OTEL_EXPORTER_OTLP_ENDPOINT` defaults to `http://localhost:4318`). Requires an OTLP-compatible backend to receive and visualize telemetry — for local development, `make otel` starts one (UI at http://localhost:16686). |
224
250
  | `DOCKER_HOST` | Override the Docker daemon socket (e.g. `unix:///home/user/.colima/default/docker.sock`). When unset, lstk tries the default socket and then probes common alternatives (Colima, OrbStack). |
225
251
 
252
+ ### AWS CLI Proxy
253
+
254
+ `lstk aws <args>` runs the AWS CLI against LocalStack with the endpoint, credentials, and region pre-configured — equivalent to `aws --endpoint-url http://localhost:4566 <args>` with `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_DEFAULT_REGION` set automatically. Requires the AWS CLI on your `PATH`. This is separate from `lstk setup aws`, which configures a persistent `localstack` profile in `~/.aws/` instead.
255
+
256
+ ```bash
257
+ lstk aws s3 ls
258
+ lstk aws sqs list-queues
259
+ ```
260
+
226
261
  ### Terraform Integration
227
262
 
228
263
  `lstk terraform` (alias `tf`) is a proxy that runs Terraform commands against LocalStack, automatically configuring the AWS provider to use LocalStack's endpoints. This allows you to test infrastructure-as-code locally before deploying to AWS.
@@ -256,6 +291,25 @@ CDK always targets the default LocalStack account 000000000000; there is no --ac
256
291
  - `AWS_ENDPOINT_URL_S3` — Override the auto-derived S3 endpoint
257
292
  - `AWS_REGION` — Fallback for `--region` flag
258
293
 
294
+ ### SAM Integration
295
+
296
+ `lstk sam` is a proxy that runs AWS SAM CLI commands against LocalStack, automatically configuring the endpoint and credentials.
297
+
298
+ **Requires AWS SAM CLI version 1.95.0 or newer** on your `PATH` (older versions ignore `AWS_ENDPOINT_URL` and would target real AWS).
299
+
300
+ **lstk-specific flags** (appear after the `sam` subcommand):
301
+ - `--region <region>` — Deployment region (default: `us-east-1`)
302
+ - `--account <id>` — Target AWS account ID, 12 digits (default: `000000000000`)
303
+
304
+ **Environment variables:**
305
+ - `LSTK_SAM_CMD` — SAM binary to invoke (default: `sam`)
306
+ - `AWS_ENDPOINT_URL` — Override the auto-resolved LocalStack endpoint
307
+ - `AWS_ENDPOINT_URL_S3` — Override the auto-derived S3 endpoint
308
+ - `AWS_REGION` — Fallback for `--region` flag
309
+ - `AWS_ACCESS_KEY_ID` — Fallback for `--account` flag
310
+
311
+ Known limitations versus `samlocal`: image/container-based Lambda (ECR) deploys and nested CloudFormation stacks are not supported.
312
+
259
313
  ## Usage
260
314
 
261
315
  ```bash
@@ -268,6 +322,12 @@ LOCALSTACK_AUTH_TOKEN=<token> lstk --non-interactive
268
322
  # Stop the running emulator
269
323
  lstk stop
270
324
 
325
+ # Restart the emulator
326
+ lstk restart
327
+
328
+ # Clear in-memory emulator state (buckets, functions, etc.) without stopping it
329
+ lstk reset
330
+
271
331
  # Show emulator status and deployed resources
272
332
  lstk status
273
333
 
@@ -292,6 +352,9 @@ lstk update
292
352
  # Show resolved config file path
293
353
  lstk config path
294
354
 
355
+ # Run AWS CLI commands against LocalStack
356
+ lstk aws s3 ls
357
+
295
358
  # Set up AWS CLI profile integration
296
359
  lstk setup aws
297
360
 
@@ -305,7 +368,7 @@ lstk az group list
305
368
  lstk az start-interception
306
369
  lstk az stop-interception
307
370
 
308
- # Save emulator state to a local file
371
+ # Save emulator state to a local file (`lstk save` is a shortcut for `lstk snapshot save`)
309
372
  lstk snapshot save ./my-snapshot.snapshot
310
373
 
311
374
  # Save emulator state as a named cloud snapshot on the LocalStack platform
@@ -314,7 +377,7 @@ lstk snapshot save pod:my-baseline
314
377
  # Save to your own S3 bucket (credentials from AWS_* env vars or --profile)
315
378
  lstk snapshot save my-pod s3://my-bucket/prefix
316
379
 
317
- # Load a snapshot back into the running emulator
380
+ # Load a snapshot back into the running emulator (`lstk load` is a shortcut for `lstk snapshot load`)
318
381
  lstk snapshot load pod:my-baseline
319
382
  lstk snapshot load my-pod s3://my-bucket/prefix
320
383
 
@@ -346,6 +409,10 @@ lstk cdk deploy --require-approval never
346
409
  # Synthesize a CDK app (offline, no running emulator needed)
347
410
  lstk cdk synth
348
411
 
412
+ # Build and deploy a SAM app against LocalStack
413
+ lstk sam build
414
+ lstk sam deploy
415
+
349
416
  ```
350
417
 
351
418
  ## Snapshots
@@ -425,7 +492,7 @@ lstk start --no-snapshot # skip auto-loading this run
425
492
 
426
493
  ## Extensions
427
494
 
428
- lstk supports Git-style extensions: running `lstk <name>`, for a name that isn't a built-in command, delegates to an external `lstk-<name>` executable found on your `PATH`, forwarding all arguments and passing stdin/stdout/stderr through.
495
+ lstk supports Git-style extensions: running `lstk <name>`, for a name that isn't a built-in command, resolves and delegates to an external `lstk-<name>` executable checked first in lstk's bundled-extensions directory, then on your `PATH` forwarding all arguments and passing stdin/stdout/stderr through.
429
496
 
430
497
  ```bash
431
498
  lstk my-tool --flag # resolves and runs lstk-my-tool, if it exists
package/lstk CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@localstack/lstk_darwin_amd64",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "bin": {
5
5
  "lstk_darwin_amd64": "lstk"
6
6
  },