@dialpad/dialtone-cli 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +33 -92
  2. package/build/index.js +55828 -3419
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -4,10 +4,15 @@ A command-line tool for searching and exploring the [Dialtone Design System](htt
4
4
 
5
5
  ## Installation
6
6
 
7
+ For a project-local installation, run in the application directory:
8
+
7
9
  ```bash
8
- npm install -g @dialpad/dialtone-cli
10
+ npm install --save-dev --save-exact @dialpad/dialtone-cli
11
+ npm exec --no -- dialtone --help
9
12
  ```
10
13
 
14
+ Commit the manifest and lockfile. The command blocks below use the shorter `dialtone` form and require a global installation (`npm install -g @dialpad/dialtone-cli`). For a project-local install, replace bare `dialtone` with `npm exec --no -- dialtone` and run it from the application directory. A bare local bin is not guaranteed to be on an assistant's PATH. See [installation and data selection](https://dialtone.dialpad.com/guides/cli/#installation).
15
+
11
16
  ## Commands
12
17
 
13
18
  ### `dialtone search <query>`
@@ -35,15 +40,30 @@ dialtone component button --slots # slots only
35
40
  dialtone component button --examples # usage example
36
41
  ```
37
42
 
38
- ### `dialtone docs <query>`
43
+ ### `dialtone docs [query]`
39
44
 
40
45
  Search bundled reference documentation, including directive imports, registration and behavior.
41
46
 
42
47
  ```bash
43
48
  dialtone docs "v-dt-tooltip"
44
49
  dialtone docs "DtModeDirective registration"
50
+ dialtone docs --id examples/button-default
51
+ dialtone docs --id examples/button-disabled-tooltip --format json
52
+ ```
53
+
54
+ Use `--id <id>` instead of a query to retrieve a complete documentation record. Minimal and Markdown formats print its content; JSON returns a one-record array with its metadata. Missing IDs, an empty ID, or combining a query with `--id` exit with an error. `--limit` controls search results or context-reference pages, not ordinary exact-ID content.
55
+
56
+ Use `dialtone docs --id <id> --context` to list related source sections, page guidance, APIs, directives, declared utilities and authored links without copying their content. Follow the returned commands for the context you need. Context accepts `--limit` 1–50 (default 20) and `--offset` (default 0); follow `Continue` for remaining references. Context JSON is a retrieval envelope; ordinary exact/search JSON remains an array. Page links are latest references, not installed-compatibility guarantees.
57
+
58
+ ```sh
59
+ dialtone docs --id examples/toggle-base-styles --context
60
+ dialtone docs --id examples/utility-word-wrap-normal --context --format json
45
61
  ```
46
62
 
63
+ Ready public component-page Vue demos are included automatically when public imports and supported source state resolve and the source API check passes. Default IDs use `examples/docs/<docId>/<section-slug>`; source identity overrides preserve the earlier exact IDs or distinguish demos under the same heading. Removed or renamed IDs return no-match unless an explicit ID is retained.
64
+
65
+ Vue documentation and curated Combinator preset examples include complete application files and pinned dependencies; static utility examples contain standalone HTML. Other source forms remain outside this automatic rule, so this is not full coverage. Their pinned profile does not establish installed-project compatibility; read each record's build/API and manual-review status and environment. `component --examples` text output lists available example IDs; complete example records stay out of documentation search. See [Retrieve a selected example](https://dialtone.dialpad.com/guides/cli/#retrieve-a-selected-example) for setup and qualification.
66
+
47
67
  ### `dialtone token [query]`
48
68
 
49
69
  Look up design tokens. Use `--name=--dt-*` for canonical CSS names so the leading dashes are parsed as a value. Exact legacy names retain their values and qualified migration guidance; add `--values --format json` to inspect that metadata.
@@ -59,7 +79,7 @@ dialtone token --name=--dt-spacing-100 --values # canonical CSS token identifier
59
79
 
60
80
  ### `dialtone utility <query>`
61
81
 
62
- Search CSS utility classes.
82
+ Search CSS utility classes. General searches filter deprecated utilities; exact legacy names retain their contract and migration metadata in `--format json` output.
63
83
 
64
84
  ```bash
65
85
  dialtone utility "padding 8px"
@@ -97,109 +117,30 @@ DIALTONE_DEBUG=1 dialtone search button
97
117
 
98
118
  ## Updating
99
119
 
100
- The CLI checks for updates automatically. To update:
120
+ Update a project-local dependency from the application directory:
101
121
 
102
122
  ```bash
103
- npm install -g @dialpad/dialtone-cli@latest
123
+ npm install --save-dev --save-exact @dialpad/dialtone-cli@latest
104
124
  ```
105
125
 
106
- Run from a project, the CLI uses the Dialtone data installed there (components, tokens, utilities, icons). Anything it can't find comes from data bundled with the CLI at build time, and documentation search always uses bundled content. Updating the CLI refreshes that bundled data. See [Data sources](https://dialtone.dialpad.com/guides/cli/#data-sources) for how the CLI finds a project's data.
126
+ Review and commit the manifest/lockfile change. For global installations, use `npm install -g @dialpad/dialtone-cli@latest`. If your CLI notice prints a global command, choose the update command matching your installation. Restart a long-lived client after changing its PATH or environment.
107
127
 
108
- ## Claude Code Integration
128
+ The CLI selects data from its invocation directory; updating the CLI refreshes bundled documentation and fallback data, not the application's Dialtone dependencies. Check the reported sources and versions. See [data sources](https://dialtone.dialpad.com/guides/cli/#data-sources).
109
129
 
110
- The CLI can be used by Claude Code skills, hooks, and agents in any Dialpad repo. This is the recommended way to give Claude access to Dialtone when the MCP server isn't configured.
111
-
112
- ### Rules
113
-
114
- Add a rule to your project's `.claude/rules/` that teaches Claude about the CLI:
115
-
116
- ```markdown
117
- ---
118
- description: "Dialtone design system lookups"
119
- ---
120
-
121
- # Dialtone Design System
122
-
123
- When working with Dialtone components, tokens, or utility classes, use the `dialtone` CLI for lookups:
124
-
125
- - Component API: `dialtone component <name> --props`
126
- - Single prop: `dialtone component <name> --prop <prop>`
127
- - Token lookup: `dialtone token "<query>"`
128
- - Utility classes: `dialtone utility "<query>"`
129
- - Structured data: add `--format json` to any command
130
-
131
- Prefer the CLI over reading source files for design system information. It searches
132
- the generated API and leaves deprecated items out of general discovery. Exact
133
- legacy component, utility or token names retain their contract. Use `--format json`
134
- to inspect utility migration metadata. Token lookups print migration notes to stderr
135
- in all formats; add `--values --format json` for structured metadata.
136
- ```
130
+ ## Assistant integration
137
131
 
138
- ### Skills
132
+ A coding assistant can invoke the CLI through its shell tool when the command is available and permitted. For project-local installs, use the runner described above from the application directory.
139
133
 
140
- Wrap CLI commands in a skill for common workflows:
141
-
142
- ```markdown
143
- ---
144
- description: "Look up a Dialtone component. Use when referencing component props, events, or slots."
145
- ---
146
-
147
- # Dialtone Lookup
148
-
149
- 1. Run `dialtone component <name> --format json` to get full component data
150
- 2. If you need specific prop values, run `dialtone component <name> --prop <prop>`
151
- 3. For LLM-optimized context, run `dialtone prompt <name>`
152
- ```
153
-
154
- ### Hooks
155
-
156
- Use a `UserPromptSubmit` hook to auto-inject Dialtone context when a user mentions a component:
157
-
158
- ```json
159
- {
160
- "hooks": {
161
- "UserPromptSubmit": [
162
- {
163
- "matcher": "(?:Dt[A-Z]\\w+|dialtone\\s+component)",
164
- "command": "dialtone prompt \"$MATCH\" --format json 2>/dev/null || true"
165
- }
166
- ]
167
- }
168
- }
169
- ```
170
-
171
- ### Agents
172
-
173
- An agent can call the CLI via Bash to research design system questions:
174
-
175
- ```markdown
176
- ---
177
- description: "Research Dialtone design system components, tokens, and utilities."
178
- ---
179
-
180
- Use the `dialtone` CLI to look up design system information:
181
-
182
- - `dialtone search "<query>"` — broad search across all domains
183
- - `dialtone search "<term1>|<term2>"` — OR search across multiple terms
184
- - `dialtone component <name> --format json` — full component data
185
- - `dialtone token "<query>" --format json` — token data
186
- - `dialtone utility "<query>" --format json` — utility class data
187
-
188
- Always use `--format json` when processing results programmatically.
189
- ```
134
+ Merge the [shared lookup instruction](https://dialtone.dialpad.com/guides/getting-started/#ai-assisted-development) into a project file your client loads. It covers Codex and Claude Code loading routes, CLI-only access, selected-version checks and unavailable-tool behavior. Preserve existing project guidance and permission settings. A dependency README does not load itself into the assistant's context; confirm an actual CLI call and returned source/version in the consuming session.
190
135
 
191
136
  ### CLI vs MCP Server
192
137
 
193
- Install both. They're complementary — the CLI for fast lookups, the MCP server for deep exploration.
194
-
195
- **CLI** — token-efficient plain text. Best for direct lookups: "what props does this component have?", "what tokens match this query?" Returns compact output that costs minimal context window tokens.
196
-
197
- **MCP server** — structured data + resources protocol. Best when the LLM needs to pull full datasets, cross-reference components with tokens, or reason through complex design system questions. The resources (`dialtone://components`, `dialtone://tokens`) give access to the complete data.
138
+ Use the CLI for explicit terminal queries and scripts. Use the MCP server when a compatible client should call Dialtone tools. Both use the same search engine; neither interface guarantees lower token use, better reasoning or installed compatibility.
198
139
 
199
140
  | Use case | Recommended |
200
141
  |----------|-------------|
201
142
  | Quick lookups (props, tokens, classes) | CLI |
202
- | Deep reasoning across the design system | MCP server |
143
+ | Client-managed tool calls | MCP server |
203
144
  | Shell scripts and automation | CLI |
204
145
  | Piping context into AI tools | CLI (`dialtone prompt`) |
205
- | Non-Claude MCP clients (Cursor, Windsurf) | MCP server |
146
+ | Other MCP clients | Check the client's stdio support and configuration |