- Refactored `applyTensorFlowPatch` in `textEncoding.ts` to introduce a unified `Platform` class supporting both Node.js and browser environments with native `TextEncoder`/`TextDecoder`. - Modified global object handling to target `PlatformNode` in Node.js and `PlatformBrowser` in browser environments. - Added `getTextEncoder` and `getTextDecoder` utility functions to simplify text encoding/decoding across platforms. - Introduced `setup.ts` to apply environment patches before other modules load. - Updated CLI entry points (`cli.ts`, `rollup.config.js`) to ensure patching precedes TensorFlow.js usage. - Enhanced test coverage for TextEncoder compatibility with `test-fix.js`. - Adjusted imports in `test-tensorflow-textencoder.ts` to align with the updated `./utils/textEncoding.js`. - Streamlined constructor definitions in `Platform` for improved maintainability. This update ensures robust compatibility for TensorFlow.js by patching and standardizing text encoding/decoding functionality across environments. |
||
|---|---|---|
| .. | ||
| src | ||
| brainy-wrapper.js | ||
| cli-wrapper.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| rollup.config.js | ||
| tsconfig.json | ||
| types.d.ts | ||
@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 >= 24.4.0
License
MIT