@dialpad/dialtone-cli 1.6.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 +28 -93
  2. package/build/index.js +51849 -2502
  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>`
@@ -46,9 +51,18 @@ dialtone docs --id examples/button-default
46
51
  dialtone docs --id examples/button-disabled-tooltip --format json
47
52
  ```
48
53
 
49
- 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, not exact-ID content.
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
61
+ ```
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.
50
64
 
51
- The two selected Button examples include complete application files and pinned dependencies. Their tested 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.
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.
52
66
 
53
67
  ### `dialtone token [query]`
54
68
 
@@ -65,7 +79,7 @@ dialtone token --name=--dt-spacing-100 --values # canonical CSS token identifier
65
79
 
66
80
  ### `dialtone utility <query>`
67
81
 
68
- 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.
69
83
 
70
84
  ```bash
71
85
  dialtone utility "padding 8px"
@@ -103,109 +117,30 @@ DIALTONE_DEBUG=1 dialtone search button
103
117
 
104
118
  ## Updating
105
119
 
106
- The CLI checks for updates automatically. To update:
120
+ Update a project-local dependency from the application directory:
107
121
 
108
122
  ```bash
109
- npm install -g @dialpad/dialtone-cli@latest
123
+ npm install --save-dev --save-exact @dialpad/dialtone-cli@latest
110
124
  ```
111
125
 
112
- 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.
113
-
114
- ## Claude Code Integration
115
-
116
- 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.
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.
117
127
 
118
- ### Rules
119
-
120
- Add a rule to your project's `.claude/rules/` that teaches Claude about the CLI:
121
-
122
- ```markdown
123
- ---
124
- description: "Dialtone design system lookups"
125
- ---
126
-
127
- # Dialtone Design System
128
-
129
- When working with Dialtone components, tokens, or utility classes, use the `dialtone` CLI for lookups:
130
-
131
- - Component API: `dialtone component <name> --props`
132
- - Single prop: `dialtone component <name> --prop <prop>`
133
- - Token lookup: `dialtone token "<query>"`
134
- - Utility classes: `dialtone utility "<query>"`
135
- - Structured data: add `--format json` to any command
136
-
137
- Prefer the CLI over reading source files for design system information. It searches
138
- the generated API and leaves deprecated items out of general discovery. Exact
139
- legacy component, utility or token names retain their contract. Use `--format json`
140
- to inspect utility migration metadata. Token lookups print migration notes to stderr
141
- in all formats; add `--values --format json` for structured metadata.
142
- ```
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).
143
129
 
144
- ### Skills
130
+ ## Assistant integration
145
131
 
146
- Wrap CLI commands in a skill for common workflows:
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.
147
133
 
148
- ```markdown
149
- ---
150
- description: "Look up a Dialtone component. Use when referencing component props, events, or slots."
151
- ---
152
-
153
- # Dialtone Lookup
154
-
155
- 1. Run `dialtone component <name> --format json` to get full component data
156
- 2. If you need specific prop values, run `dialtone component <name> --prop <prop>`
157
- 3. For LLM-optimized context, run `dialtone prompt <name>`
158
- ```
159
-
160
- ### Hooks
161
-
162
- Use a `UserPromptSubmit` hook to auto-inject Dialtone context when a user mentions a component:
163
-
164
- ```json
165
- {
166
- "hooks": {
167
- "UserPromptSubmit": [
168
- {
169
- "matcher": "(?:Dt[A-Z]\\w+|dialtone\\s+component)",
170
- "command": "dialtone prompt \"$MATCH\" --format json 2>/dev/null || true"
171
- }
172
- ]
173
- }
174
- }
175
- ```
176
-
177
- ### Agents
178
-
179
- An agent can call the CLI via Bash to research design system questions:
180
-
181
- ```markdown
182
- ---
183
- description: "Research Dialtone design system components, tokens, and utilities."
184
- ---
185
-
186
- Use the `dialtone` CLI to look up design system information:
187
-
188
- - `dialtone search "<query>"` — broad search across all domains
189
- - `dialtone search "<term1>|<term2>"` — OR search across multiple terms
190
- - `dialtone component <name> --format json` — full component data
191
- - `dialtone token "<query>" --format json` — token data
192
- - `dialtone utility "<query>" --format json` — utility class data
193
-
194
- Always use `--format json` when processing results programmatically.
195
- ```
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.
196
135
 
197
136
  ### CLI vs MCP Server
198
137
 
199
- Install both. They're complementary — the CLI for fast lookups, the MCP server for deep exploration.
200
-
201
- **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.
202
-
203
- **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.
204
139
 
205
140
  | Use case | Recommended |
206
141
  |----------|-------------|
207
142
  | Quick lookups (props, tokens, classes) | CLI |
208
- | Deep reasoning across the design system | MCP server |
143
+ | Client-managed tool calls | MCP server |
209
144
  | Shell scripts and automation | CLI |
210
145
  | Piping context into AI tools | CLI (`dialtone prompt`) |
211
- | Non-Claude MCP clients (Cursor, Windsurf) | MCP server |
146
+ | Other MCP clients | Check the client's stdio support and configuration |