@loftlyy/cli
v0.1.1
Published
Loftlyy brand data CLI
Readme
@loftlyy/cli
Simple CLI for querying Loftlyy brand data.
Install and Use
npm i -g @loftlyy/cliOr run without installing:
npx @loftlyy/cli listQuick examples:
loftlyy list
loftlyy search apple
loftlyy get apple
loftlyy palette apple --output jsonCommand Reference
loftlyy list [--limit <n>]- list brands (summary rows)loftlyy get <slug>- get one brand objectloftlyy search <query>- full-text and hex-token searchloftlyy filter [options]- facet filtering (--industry,--tag,--color-family,--typography-style,--q)loftlyy similar <slug> [--limit <n>]- similar brandsloftlyy palette <slug>- palette JSON/table for one brandloftlyy facets- available filter values
Legacy namespace is still supported:
loftlyy brands ...loftlyy b ...
Global Options
--source <local|remote>- where to load data from--base-url <url>- remote base URL override--output <table|json|ndjson>- output format--strict- fail fast on invalid brand data--no-color- disable ANSI colors
Data Source Behavior
The CLI auto-detects default source:
- if
data/brandsexists in the current working directory ->local - otherwise ->
remote
Remote mode uses:
- default base URL:
https://loftlyy.com - endpoint:
GET /api/cli - response shape:
{ "brands": Brand[] }
You can override the host:
loftlyy --source remote --base-url https://staging.loftlyy.com listHow It Works
localsource: scansdata/brands/*.ts(excludingindex.ts), validates entries, then builds search/facet indexes.remotesource: fetchesGET /api/cli, validates each brand entry, then builds the same indexes.- search is case-insensitive.
- slug commands (
get,similar,palette) are case-insensitive. - filter values are case-insensitive.
Maintainer Guide
Prerequisites
- Node 20+
- npm account with publish access to
@loftlyy/cli
Build the CLI package
From repository root:
pnpm cli:buildOr directly:
npm --prefix cli run buildBuild output is cli/dist/.
Bump Version
CLI package version lives in cli/package.json.
Patch:
npm --prefix cli version patchMinor:
npm --prefix cli version minorMajor:
npm --prefix cli version majorIf you do not want git tags/commits created automatically, use --no-git-tag-version.
Publish to npm (manual)
- Ensure you can publish the scope/package:
npm whoami- Build:
npm --prefix cli run build- Publish:
npm --prefix cli publish --access publicAuth Token Setup
Local machine (recommended interactive setup):
npm loginCI setup (token-based):
- Create an npm automation token in npm account settings.
- Store it as
NPM_TOKENin CI secrets. - Configure npm auth in CI before publish:
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrcThen run:
npm --prefix cli publish --access publicRelease Checklist
- Confirm
/api/cliis deployed and returning{ brands: [...] }. - Run checks:
pnpm typecheck
pnpm dlx oxlint cli app/api/cli/route.ts
npm --prefix cli run build- Bump
cli/package.jsonversion. - Publish
@loftlyy/cli. - Smoke test:
npx @loftlyy/cli list
npx @loftlyy/cli search apple
npx @loftlyy/cli get apple