About sandbox caching and reuse
whzbox caches sandbox data locally because the practical CLI workflow needs the credentials after the initial create call, while the upstream API does not provide a clean "fetch the credentials for the current sandbox" path.
Why the cache exists
Without a local cache, the credentials printed by create would be lost as soon as the terminal session ended. The cache makes later commands possible:
listcan show what is still stored locallyexeccan inject the cached credentials into a child processcreatecan reuse a still-live sandbox instead of provisioning again
Reuse rules
create checks the local cache first:
- no cached sandbox: provision a new one
- cached but expired sandbox: provision a new one
- cached and verified sandbox: reuse it immediately
- cached and unverified sandbox: try verification again before deciding
Why logout preserves cached sandboxes
Session tokens and sandbox credentials serve different purposes. Clearing the Whizlabs session does not make the cached AWS credentials disappear, so logout preserves cached sandboxes on disk.
That is why this sequence can still work while the sandbox remains valid:
whzbox logoutwhzbox listwhzbox exec aws -- ...
Operational consequence
Commands do not all have the same dependency model:
createanddestroyneed a valid Whizlabs sessionlistandexecneed only the local sandbox cachestatusneeds only the local auth cache