brainy/cli-package
David Snelling 7e6718f59b **feat(cli, workers): introduce text encoding patches and worker improvements**
- Added `cli-package/brainy-wrapper.js` to patch global `TextEncoder` and `TextDecoder` for Node.js environments, ensuring compatibility with TensorFlow.js.
- Implemented unified text encoding utilities in `cli-package/src/utils/textEncoding.ts` for cross-environment consistency.
- Enhanced `src/worker.js` and introduced `src/worker.ts` to improve worker execution with better function serialization and error handling.
- Updated `package.json`:
  - Modified the `build` script to include a patch for `TextEncoder`.
  - Added `test-all` script for multi-environment testing.
  - Introduced the Puppeteer dependency for browser testing.
- Created a favicon generation script `scripts/create-favicon.js` using a base64-encoded icon.
- Added `scripts/test-all-environments.js` to run automated tests across Node.js, browser, and CLI environments.
- Enhanced `src/utils/workerUtils.ts` to support improved fallback mechanisms and robust worker pooling.

This update improves the project's compatibility across environments, refines worker functionalities, and adds comprehensive testing support for reliability.
2025-07-04 14:42:33 -07:00
..
src **feat(cli, workers): introduce text encoding patches and worker improvements** 2025-07-04 14:42:33 -07:00
brainy-wrapper.js **feat(cli, workers): introduce text encoding patches and worker improvements** 2025-07-04 14:42:33 -07:00
CHANGELOG.md **chore(version): bump version to 0.9.36 and update references** 2025-07-04 12:33:28 -07:00
cli-wrapper.js **feat: improve TensorFlow.js compatibility and remove unnecessary patches** 2025-07-02 16:16:19 -07:00
package-lock.json **feat(cli, workers): introduce text encoding patches and worker improvements** 2025-07-04 14:42:33 -07:00
package.json **chore(version): bump version to 0.9.36 and update references** 2025-07-04 12:33:28 -07:00
README.md **feat: improve TensorFlow.js compatibility and remove unnecessary patches** 2025-07-02 16:16:19 -07:00
rollup.config.js **feat: enhance threading compatibility and refactor module loading** 2025-07-02 16:52:44 -07:00
tsconfig.json **chore(version): bump version to 0.9.18 and update build configurations** 2025-07-02 12:15:35 -07:00
types.d.ts **chore(version): bump version to 0.9.18 and update build configurations** 2025-07-02 12:15:35 -07:00

@soulcraft/brainy-cli

Command-line interface for the Brainy vector graph database.

Installation

# Install globally
npm install -g @soulcraft/brainy-cli

Usage

Once installed, you can use the brainy command from anywhere:

# Show help
brainy --help

# Initialize a new database
brainy init

# Add data
brainy add "Cats are independent pets" '{"noun":"Thing","category":"animal"}'

# Search
brainy search "feline pets" --limit 5

# Add relationships
brainy addVerb id1 id2 RelatedTo '{"description":"Both are pets"}'

# Visualize the graph
brainy visualize
brainy visualize --root <id> --depth 3

# Generate random test data
brainy generate-random-graph --noun-count 20 --verb-count 30 --clear

Features

  • Full access to all Brainy database functionality from the command line
  • Autocomplete support for commands and options
  • Visualization of graph data
  • Import/export capabilities
  • Augmentation pipeline testing

Requirements

  • Node.js >= 23.0.0

Changelog

0.9.25

  • Completely removed unnecessary compatibility patches for Node.js v24 as they are no longer needed with current TensorFlow.js versions

License

MIT