open-index/open-npm huggingface dataset:
npm package: @guing-ai/cli
Description: Guing CLI — set up design system consumption in your project
Latest version: 0.2.6

# @guing-ai/cli

The Guing CLI allows developers to securely consume their design system components, tokens, and AI configuration generated by the Guing platform.

## Publishing to npm

To publish updates to the `@guing-ai/cli` package, you need to authenticate with npm and ensure you have an access token with bypass 2FA enabled, as the `@guing-ai` organization requires 2FA for publishing.

### Prerequisites

1. You must be added as a member to the `@guing-ai` organization on [npmjs.com](https://www.npmjs.com/).
2. Generate an **Automation / Granular Access Token** on npm:
   - Go to [https://www.npmjs.com/settings/tokens](https://www.npmjs.com/settings/tokens)
   - Click **Generate New Token** -> **Granular Access Token**
   - Give it a name (e.g., "Guing CLI Publish Token")
   - Under **Packages and scopes**, select **`@guing-ai`** and set **Read and write** access.
   - ⚠️ **CRITICAL:** Check the box that says **"Bypass two-factor authentication for publishing"**.
   - Generate and copy the token (`npm_...`).

### Steps to Publish

1. **Update the Version:**
   Increase the `version` number in `package.json` according to semver (e.g., from `"0.1.0"` to `"0.1.1"`).

2. **Build the CLI:**
   From the `cli` directory, run the build command to compile the TypeScript code:
   ```bash
   npm run build
   ```

3. **Authenticate:**
   If you haven't already, configure your local npm registry to use your generated token:
   ```bash
   npm config set //registry.npmjs.org/:_authToken="<YOUR_TOKEN>"
   ```

4. **Publish:**
   Publish the package to the public registry:
   ```bash
   npm publish --access public
   ```

## Usage

Developers can run the CLI directly using `npx` in their project's root directory:

### Initial Setup

```bash
npx @guing-ai/cli setup
```

The CLI will prompt for the **Tenant ID**, **Client Secret**, and the developer's preferred **AI Assistants** to scaffold the design system dependencies and AI instruction rules.

After a successful setup, a `.guing.json` file is saved in the project root — this records the tenant ID, API URL, selected agents, and installed version for future updates.

> ⚠️ **Security:** The `clientSecret` is never stored in `.guing.json`. It is read from the `.env` file (`GUING_CLIENT_SECRET`) or a CLI flag at runtime.

### Updating the Design System

When the design system is updated (new components, token changes, etc.), run:

```bash
npx @guing-ai/cli update
```

This will:
1. Read `.guing.json` for project settings
2. Read `GUING_CLIENT_SECRET` from `.env`
3. Fetch the latest version and manifest from the API
4. Update `package.json` with the new version tag
5. Regenerate all AI agent instruction files
6. Run `npm install` automatically

### Non-Interactive Mode

Alternatively, use flags for CI/CD environments:

```bash
npx @guing-ai/cli setup \
  --api https://us-central1-guing-ai.cloudfunctions.net/api \
  --tenant your-tenant-id \
  --secret your-client-secret \
  --agents cursor,claude \
  --yes
```