@xds/cli 0.0.0-stage → 1.3.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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +73 -2
  3. package/bin/xds.js +68 -0
  4. package/package.json +44 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 kjmin-dev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,74 @@
1
- # Temporary Holding Version
1
+ # @xds/cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ ![xds — One design system across different stacks](https://xds.studiocyf.app/og-image.png)
4
+
5
+ [Documentation](https://xds.studiocyf.app/cli/install/) · [Commands](https://xds.studiocyf.app/cli/commands/) · [MCP & Agents](https://xds.studiocyf.app/cli/agents/) · [GitHub](https://github.com/kjmin-dev/xds)
6
+
7
+ Command-line tool and stdio Model Context Protocol (MCP) server for [xds](https://xds.studiocyf.app): scaffold cross-platform design-system repositories across React, Solid, Vue, Svelte, React Native, Compose Multiplatform, Flutter, SwiftUI, and GPUI; inspect DTCG tokens and component contracts; check WCAG contrast and export custom themes; and eject web components into your app.
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ npm install --global @xds/cli
13
+ xds --version
14
+ ```
15
+
16
+ Or run directly without installing globally:
17
+
18
+ ```sh
19
+ npx @xds/cli create my-app
20
+ ```
21
+
22
+ `@xds/cli` is a lightweight launcher. The native binary comes from an optional platform package that npm selects by OS and CPU: `@xds/cli-darwin-arm64`, `@xds/cli-darwin-x64`, `@xds/cli-linux-arm64`, `@xds/cli-linux-x64`, or `@xds/cli-win32-x64` (Windows on Arm runs `win32-x64` under emulation).
23
+
24
+ ## Common commands
25
+
26
+ ```sh
27
+ xds create my-app --targets web-react,kotlin-compose --theme ocean
28
+ xds tokens button.primary --json
29
+ xds components Button --json
30
+ xds contrast text.secondary background.surface
31
+ xds check-theme brand.json
32
+ xds export-theme brand.json --format css
33
+ xds eject Button
34
+ ```
35
+
36
+ ## MCP server for coding agents
37
+
38
+ Run the stdio Model Context Protocol server without installing globally:
39
+
40
+ ```sh
41
+ claude mcp add xds -- npx -y @xds/cli@latest mcp
42
+ ```
43
+
44
+ ```json
45
+ { "mcpServers": { "xds": { "command": "npx", "args": ["-y", "@xds/cli@latest", "mcp"] } } }
46
+ ```
47
+
48
+ Or point to a global install:
49
+
50
+ ```json
51
+ { "mcpServers": { "xds": { "command": "xds", "args": ["mcp"] } } }
52
+ ```
53
+
54
+ ## Updating
55
+
56
+ Check for or install a newer release:
57
+
58
+ ```sh
59
+ xds self-update --check
60
+ xds self-update
61
+ ```
62
+
63
+ Or update directly through npm:
64
+
65
+ ```sh
66
+ npm install --global @xds/cli@latest
67
+ ```
68
+
69
+ ## Documentation
70
+
71
+ - [Install xds](https://xds.studiocyf.app/cli/install/) (npm, installer scripts, and building from source)
72
+ - [Commands](https://xds.studiocyf.app/cli/commands/)
73
+ - [For scripts and agents](https://xds.studiocyf.app/cli/agents/)
74
+ - [xds as a library](https://xds.studiocyf.app/libraries/overview/)
package/bin/xds.js ADDED
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+ // Runs the native xds binary for this machine. Each platform binary lives in its own package
3
+ // (@xds/cli-darwin-arm64 and so on), listed as an optional dependency so npm installs only the
4
+ // one matching this OS and CPU.
5
+
6
+ import { spawn } from "node:child_process";
7
+ import { createRequire } from "node:module";
8
+ import { constants } from "node:os";
9
+ import { fileURLToPath } from "node:url";
10
+
11
+ const require = createRequire(import.meta.url);
12
+ // Windows on Arm runs the x64 binary under emulation.
13
+ const arch = process.platform === "win32" && process.arch === "arm64" ? "x64" : process.arch;
14
+ const platformPackage = `@xds/cli-${process.platform}-${arch}`;
15
+ const binaryName = process.platform === "win32" ? "xds.exe" : "xds";
16
+
17
+ function findBinary() {
18
+ // Lets tests and local builds run the launcher against a specific binary.
19
+ if (process.env.XDS_BINARY) return process.env.XDS_BINARY;
20
+ try {
21
+ return require.resolve(`${platformPackage}/bin/${binaryName}`);
22
+ } catch {
23
+ return undefined;
24
+ }
25
+ }
26
+
27
+ const binary = findBinary();
28
+ if (!binary) {
29
+ console.error(
30
+ `xds: the package ${platformPackage} is not installed.\n` +
31
+ "Either there is no xds build for this platform, or optional dependencies were skipped\n" +
32
+ "(npm install --omit=optional, or a lockfile written on another platform).\n" +
33
+ "Builds exist for macOS (arm64, x64), Linux (arm64, x64) and Windows (x64, and arm64 under emulation).\n" +
34
+ "Install options: https://xds.studiocyf.app/cli/install/",
35
+ );
36
+ process.exit(1);
37
+ }
38
+
39
+ // Hand stdin/stdout/stderr directly to the native binary so interactive prompts and `xds mcp`
40
+ // stdio JSON-RPC work without buffering. Forward termination signals so MCP servers never orphan.
41
+ const child = spawn(binary, process.argv.slice(2), {
42
+ stdio: "inherit",
43
+ env: {
44
+ ...process.env,
45
+ XDS_MANAGED_BY: "npm",
46
+ XDS_NPM_LAUNCHER: fileURLToPath(import.meta.url),
47
+ },
48
+ });
49
+
50
+ // Let the binary handle Ctrl-C and exit with its own cancellation code (130).
51
+ process.on("SIGINT", () => {});
52
+ for (const signal of ["SIGTERM", "SIGHUP"]) {
53
+ process.on(signal, () => {
54
+ child.kill(signal);
55
+ });
56
+ }
57
+
58
+ child.on("error", (error) => {
59
+ console.error(`xds: could not run ${binary}: ${error.message}`);
60
+ process.exit(1);
61
+ });
62
+
63
+ child.on("exit", (code, signal) => {
64
+ if (signal) {
65
+ process.exit(128 + (constants.signals[signal] ?? 0));
66
+ }
67
+ process.exit(code ?? 1);
68
+ });
package/package.json CHANGED
@@ -1,6 +1,46 @@
1
1
  {
2
2
  "name": "@xds/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.3.0",
4
+ "description": "Cross-platform design system CLI and stdio MCP server: scaffold projects, validate DTCG themes, check WCAG contrast, inspect components, and eject web UI.",
5
+ "keywords": [
6
+ "design-system",
7
+ "design-tokens",
8
+ "dtcg",
9
+ "wcag",
10
+ "scaffold",
11
+ "template",
12
+ "cli",
13
+ "mcp",
14
+ "model-context-protocol",
15
+ "coding-agent",
16
+ "eject",
17
+ "cross-platform",
18
+ "a2ui",
19
+ "xds"
20
+ ],
21
+ "license": "MIT",
22
+ "bugs": "https://github.com/kjmin-dev/xds/issues",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/kjmin-dev/xds.git",
26
+ "directory": "npm/cli"
27
+ },
28
+ "homepage": "https://xds.studiocyf.app/cli/install/",
29
+ "type": "module",
30
+ "bin": {
31
+ "xds": "bin/xds.js"
32
+ },
33
+ "files": [
34
+ "bin"
35
+ ],
36
+ "engines": {
37
+ "node": ">=18"
38
+ },
39
+ "optionalDependencies": {
40
+ "@xds/cli-darwin-arm64": "1.3.0",
41
+ "@xds/cli-darwin-x64": "1.3.0",
42
+ "@xds/cli-linux-arm64": "1.3.0",
43
+ "@xds/cli-linux-x64": "1.3.0",
44
+ "@xds/cli-win32-x64": "1.3.0"
45
+ }
46
+ }