CLI Commands
Complete reference for the localemu and awsemu command-line tools.
localemu start
Start the LocalEmu emulator. All services become available on the gateway port.
$ localemu start [options] | Option | Description |
|---|---|
-d | Run in detached (background) mode. Returns control to the terminal immediately. |
--host <host> | Bind address. Default: 0.0.0.0 |
--port <port> | Gateway port. Default: 4566 |
# Start in the foreground
$ localemu start
LocalEmu version: 1.4.0
Ready.
# Start in the background
$ localemu start -d
LocalEmu started (PID: 12345)
Logs: ~/.localemu/localemu.log (or run 'localemu logs')
# Start on a custom port
$ localemu start --port 5000
Listening on 0.0.0.0:5000
Ready.
# Start on a specific interface
$ localemu start --host 127.0.0.1 --port 4566 localemu stop
Stop the running LocalEmu instance.
$ localemu stop
LocalEmu stopped. localemu status
Check whether LocalEmu is running and display per-service availability.
$ localemu status
LocalEmu is running (version: 1.4.0)
✓ s3: available
✓ sqs: available
✓ dynamodb: available
✓ lambda: available
✓ iam: available
...
# Check a specific port
$ localemu status --port 5000
# When not running
$ localemu status
LocalEmu is not running. localemu logs
Show logs from a detached (start -d) run. Only
detached runs write a log file — a foreground localemu start
prints directly to its own terminal instead.
$ localemu logs [options] | Option | Description |
|---|---|
-f, --follow | Follow the log file as it grows, like tail -f |
-n, --lines <n> | Number of lines to show. Default: 200 |
# Last 200 lines (default)
$ localemu logs
# Follow as new lines arrive
$ localemu logs -f
# Last 50 lines
$ localemu logs -n 50
# No detached run has ever started
$ localemu logs
No log file found at ~/.localemu/localemu.log.
(Only 'localemu start -d' writes one; a foreground run logs to its own terminal.) localemu reset
Wipe LocalEmu's persisted state (DATA_DIR) and log
file. State lives in memory only unless PERSISTENCE
is enabled, in which case this is the only way to clear it short of deleting
DATA_DIR by hand. Does not stop a running
instance — run localemu stop first, or the
still-running instance keeps writing to (and recreates) the directory this just cleared.
$ localemu reset [--yes] # Prompts for confirmation, lists exactly what will be deleted
$ localemu reset
This will permanently delete:
- /home/you/.localemu/data
- /home/you/.localemu/localemu.log
Continue? [y/N]: y
LocalEmu state reset.
# Skip the prompt, e.g. in a script
$ localemu reset --yes
LocalEmu state reset.
# Nothing persisted yet
$ localemu reset
Nothing to reset: no DATA_DIR configured and no log file found. localemu services
List every supported service in a column grid.
$ localemu services
LocalEmu supports 133 AWS services:
s3 sqs sns dynamodb
lambda iam sts kms
cloudformation cloudwatch logs events
...
Run 'localemu services <name>' to see operations for a service. localemu services <name>
Show the implemented operations for a specific service.
$ localemu services s3
s3 - 94 operations:
CreateBucket DeleteBucket ListBuckets
HeadBucket GetBucketLocation PutBucketPolicy
PutObject GetObject DeleteObject
ListObjectsV2 CopyObject HeadObject
... localemu ssh
SSH into a Docker-backed EC2 instance (requires EC2_VM_MANAGER=docker).
# Interactive shell
$ localemu ssh i-0abc123
# Run a one-shot command
$ localemu ssh i-0abc123 ls -la /
# List running instances
$ localemu ssh --list localemu vpc-ip
Debug command for VPC addressing. Shows three views of a container's IP side by side — the subnet allocator, the address index, and the live Docker bridge — and flags drift between them. Mainly useful while diagnosing networking issues with Docker-backed EC2/RDS resources.
$ localemu vpc-ip [target] [options] | Option | Description |
|---|---|
target | Instance ID, container name, or ENI ID. Omit with --all to show everything. |
--all | Show every container across every LocalEmu VPC bridge |
--output <table|json> | Output format. Default: table |
# Single instance
$ localemu vpc-ip i-0abc123
INSTANCE ENI VPC SUBNET ALLOC_IP INDEX_IP DOCKER_IP DRIFT
i-0abc123 eni-0f1a2b vpc-0a1b2c subnet-0abc 10.0.1.12 10.0.1.12 10.0.1.12
# Everything, as JSON
$ localemu vpc-ip --all --output json localemu export / import
Snapshot live LocalEmu state to Terraform, CloudFormation, or a JSON snapshot. Replay a snapshot into another LocalEmu instance (or, for Terraform output, deploy against real AWS). See the Export page for the full pipeline.
# Export to Terraform HCL
$ localemu export --format terraform --output ./snapshot/
# Export to CloudFormation
$ localemu export --format cloudformation --output ./stack.yaml
# Re-apply a JSON snapshot to a fresh LocalEmu
$ localemu import ./snapshot.json localemu --version
Print the installed version.
$ localemu --version
localemu, version 1.4.0 awsemu <command>
Run any AWS CLI command against LocalEmu. awsemu is a wrapper that automatically sets the endpoint, region, and credentials. Every AWS CLI subcommand is supported.
$ awsemu <service> <command> [options] $ awsemu s3 ls
$ awsemu sqs list-queues
$ awsemu dynamodb list-tables
$ awsemu lambda list-functions
$ awsemu sns list-topics
$ awsemu iam list-users
$ awsemu secretsmanager list-secrets
$ awsemu cloudformation list-stacks See the awsemu CLI page for detailed usage and more examples.
Quick Reference
| Command | Description |
|---|---|
localemu start | Start in the foreground |
localemu start -d | Start in the background |
localemu stop | Stop the emulator |
localemu status | Check if running |
localemu logs | Show logs from a detached (-d) run |
localemu reset | Wipe persisted state and the log file |
localemu services | List all services |
localemu services s3 | Show operations for a service |
localemu ssh i-0abc123 | SSH into a Docker-backed EC2 instance |
localemu vpc-ip i-0abc123 | Debug a container's VPC addressing |
localemu export --format terraform | Snapshot state to Terraform / CFN / JSON |
localemu import snapshot.json | Replay a JSON snapshot |
localemu --version | Print version |
awsemu <anything> | Run any AWS CLI command against LocalEmu |