Skip to content

helper add

Generate a typed helper for a common runtime concern.

Terminal window
vsceasy helper add --kind secrets
FlagTypeNotes
--kindsecrets | config | state | notifications | cache | colorizeRequired. Which helper.
--forcebooleanOverwrite an existing helper file.
KindWraps
secretscontext.secrets (typed get/set/delete). Wire initSecrets(context).
configworkspace.getConfiguration(...) with typed keys.
stateglobalState / workspaceState. Wire initState(context).
notificationsinfo / warning / error message helpers.
cachein-memory TTL + LRU cache with a wrap(key, fn) helper.
colorizeapplyTokenColors / removeTokenColors — scoped TextMate colors for your own language.

The config helper exposes its settings prefix as config.section, so callers that need the fully-qualified key (opening the Settings UI at a section, for instance) don’t hardcode the prefix twice.

Terminal window
vsceasy helper add --kind config
vsceasy helper add --kind secrets
vsceasy helper add --kind cache
vsceasy helper add --kind colorize
src/helpers/cache.ts (usage)
import { createCache } from '../helpers/cache';
const cache = createCache<User>({ ttlMs: 60_000, max: 200 });
const u = await cache.wrap('user:' + id, () => orm(User).findById(id));