open-index/open-npm huggingface dataset:
npm package: @objectdocs/cli
Description: ObjectDocs CLI
Latest version: 0.2.11

# @objectdocs/cli

The central CLI orchestration tool for the ObjectStack documentation platform.

## Overview

This CLI acts as the unified interface for developing, building, and translating the ObjectStack documentation. It wraps the application logic in `@objectdocs/site` and adds workflow automation.

## Features

- **Site Orchestration**: Manages the Next.js development server and static build process.
- **AI Translation**: Automatically translates MDX documentation from English to Chinese using OpenAI.
- **Artifact Management**: Handles build output movement and directory structure organization.
- **Smart Updates**: Can process specific files or bulk translate the entire documentation.

## Installation

This package is part of the monorepo workspace. Install dependencies from the root:

```bash
pnpm install
```

## Usage

### Site Management

The CLI can also be used to run the documentation site locally with a VitePress-like experience.

```bash
# Start Dev Server
# Usage: pnpm objectdocs dev [docs-directory]
pnpm objectdocs dev ./content/docs

# Build Static Site
# Usage: pnpm objectdocs build [docs-directory]
pnpm objectdocs build ./content/docs
```

### Translate Documentation

The `translate` command reads English documentation from `content/docs/*.mdx` and generates Chinese translations as `*.cn.mdx` files in the same directory using the dot parser convention.

**Prerequisites:**
You must set the following environment variables (in `.env` or your shell):

```bash
OPENAI_API_KEY=sk-...
OPENAI_BASE_URL=https://api.openai.com/v1 # Optional
```

**Commands:**

```bash
# Translate a specific file
pnpm objectdocs translate content/docs/00-intro/index.mdx

# Translate multiple files
pnpm objectdocs translate content/docs/00-intro/index.mdx content/docs/01-quickstart/index.mdx

# Translate all files in content/docs
pnpm objectdocs translate --all

# Specify a custom model (default: gpt-4o)
pnpm objectdocs translate --all --model gpt-4-turbo
```

### CI/CD Integration

In CI environments, you can use the `CHANGED_FILES` environment variable to translate only modified files:

```bash
export CHANGED_FILES="content/docs/new-page.mdx"
pnpm objectdocs translate
```
npm package: @objectdocs/site
Description: ObjectDocs Site Template
Latest version: 0.2.11

# @objectdocs/site

The Next.js application foundation for the ObjectStack documentation.

## Overview

This package provides the actual Next.js application structure, configuration, and UI components used to render the documentation. It is designed to be encapsulated and run via the `@objectdocs/cli`.

## Tech Stack

- **Concepts**: Next.js 16 (App Router)
- **Documentation**: Fumadocs
- **Styling**: Tailwind CSS
- **Deployment**: Static Export (`output: 'export'`)

## Development

Typically you won't run this package directly. Instead, you should use the CLI from the root workspace:

```bash
pnpm dev
# or
pnpm objectdocs dev
```

However, for internal development of the site theme or logic, you can run:

```bash
cd packages/site
pnpm dev
```

## Structure

- `app/`: Next.js App Router pages and layouts.
- `lib/`: Utility functions (i18n, etc).
- `source.config.ts`: Fumadocs configuration.
- `next.config.mjs`: Next.js configuration (configured for static export).

## Build output

When built, the static assets are generated in the `out/` directory.