**docs: restructure CLI usage details and update scripts for clarity**

- **CLI Documentation Updates**:
  - Updated `README.md` to reflect the separation of CLI functionality into a new package: `@soulcraft/brainy-cli`.
  - Replaced inline CLI imports with instructions for installing and using `@soulcraft/brainy-cli`.
  - Clarified notes on keeping the main package lightweight by decoupling CLI functionality.

- **Script and Command Adjustments**:
  - Modified build instructions in `README.demo.md` to use `npm run build && npm run build:browser`.
  - Updated demo scripts in `package.json` to point to `/demo/index.html` instead of `/index.html`.
  - Revised style-check script in `CONTRIBUTING.md` to use `npm run check:style`.

- **Issues and Contribution Guidelines**:
  - Improved issue reporting section in `DEVELOPERS.md` with clearer guidelines and examples for bug and feature requests.

**Purpose**: These changes enhance documentation accuracy, streamline developer guidance, and ensure commands/scripts are up-to-date with current usage patterns.
This commit is contained in:
David Snelling 2025-07-17 07:53:41 -07:00
parent a1d564ed64
commit 7878f200fc
5 changed files with 9 additions and 23 deletions

View file

@ -110,14 +110,9 @@ import { BrainyData } from '@soulcraft/brainy'
// Minified version for production
import { BrainyData } from '@soulcraft/brainy/min'
// CLI functionality (only imported when needed)
import '@soulcraft/brainy/cli'
```
> **Note**: The CLI functionality (4MB) is not included in the standard import, reducing the bundle size for browser and
> Node.js applications. The CLI is only built and loaded when explicitly imported or when using the command-line
> interface.
> **Note**: The CLI functionality is available as a separate package `@soulcraft/brainy-cli` to reduce the bundle size of the main package. Install it globally with `npm install -g @soulcraft/brainy-cli` to use the command-line interface.
### Browser Usage
@ -417,18 +412,13 @@ brainy visualize --root <id> --depth 3
### Using the CLI in Your Code
If you need to use the CLI functionality in your code, you can import it explicitly:
The CLI functionality is available as a separate package `@soulcraft/brainy-cli`. If you need CLI functionality in your application, install the CLI package:
```typescript
// Import the CLI functionality
import '@soulcraft/brainy/cli'
// Now you can use the CLI programmatically
// ...
```bash
npm install @soulcraft/brainy-cli
```
This will only build and load the CLI when you explicitly import it, keeping your bundle size small when you don't need
the CLI.
Then you can use the CLI commands programmatically or through the command line interface.
### Available Commands