Get Design References (GDR)
Semantically search Colicit's curated database of frontend design references. Returns React + Tailwind code snippets and labelled images.
Artifact Types
- Primitives — Atomic components (buttons, inputs, toggles, date pickers).
- Patterns — Compositions of primitives (card, sidebar, navbar).
- Views — Complete layouts (hero section, pricing page, analytics dashboard).
- Design Systems — Cohesive token sets (color palettes, font pairings, spacing scales).
Artifacts from the same source share a collection_id.
Search Modes
- Semantic search — Describe what you need by function and style. Returns the closest matches ranked by similarity.
- ID lookup — Fetch a specific artifact by its UUID.
Setup
Use the GDR CLI:
# Install once (fastest repeated usage)
npm install -g @colicit/gdr-cli@latest
# Or run ad-hoc without global install
npx -y -p @colicit/gdr-cli@latest gdr --help
Authentication
The CLI reads API keys in this order:
GET_DESIGN_REFERENCES_API_KEYin environment.env.localin the project directory.envin the project directory
For local projects, users typically store the key in .env.local:
GET_DESIGN_REFERENCES_API_KEY=<your-key>
Before any search/get command, verify auth:
gdr auth doctor --json
gdr auth status --json
If auth is unresolved, stop and ask the user to set GET_DESIGN_REFERENCES_API_KEY in environment or add it to .env.local/.env. They can go to https://www.colicit.com to get their API key. Do not extract secrets with grep/cut or print them to logs.
Ephemeral Reference Workspace
Use a temporary .references directory in the project root for each retrieval run.
- Start each run with
rm -rf .references && mkdir -p .referencesto clear stale artifacts. - Store raw CLI responses as JSON in
.references(for example.references/results.json). - Extract reusable reference code snippets as
.references/ref-<n>.txt(use.txt, not.tsx). - Add
trap 'rm -rf .references' EXIT INT TERM HUPso cleanup runs automatically. - Before finishing the task, ensure
.referencesis removed.
Workflow
- Ensure
gdrCLI is available (gdr --helpor usenpx -y -p @colicit/gdr-cli@latest gdr ...). - Run from the project root (or pass
--project-dir <path>), then rungdr auth status --json. - Read reference.md for command examples.
- Initialize ephemeral workspace:
rm -rf .references && mkdir -p .referencesandtrap 'rm -rf .references' EXIT INT TERM HUP. - Identify the artifact type that matches the need (primitive, pattern, view, or design system).
- Craft a concise
functional_description(what it is / what it does) andstyle_description(how it looks). - Run the relevant
gdr ... --jsoncommand and save output to.references/results.json. - Extract each returned
.codefield into.references/ref-<n>.txtfor repeated reference as you work on the task. - Read interpretation.md and apply its fidelity-first approach to reference usage.
- Optionally, use
gdr collections get --collection-id <uuid> --jsonto discover related artifacts from the same collection. - Remove
.referencesbefore finishing the task (trap should also handle this automatically).