Skip to main content

BrainLift Manager (BLM) - A command-line interface for the BrainLift knowledge management system

Project description

BrainLift CLI

A command-line interface for the BrainLift knowledge management system. This CLI tool allows you to interact with the BrainLift serverless backend to manage, search, and generate structured knowledge content.

Installation

# Install from source
pip install -e .

Environment Setup

Create a .env file in your home directory at ~/.brain-lift/.env with the following variables:

BRAINLIFT_FUNCTION_URL=your_lambda_function_url
BRAINLIFT_API_KEY=your_api_key

Alternatively, you can use the configure-serverless command to set these values:

blm configure-serverless --function-url https://your-lambda-function-url.lambda-url.region.on.aws/ --api-key your-api-key

Commands

List Content

# List all products
blm list

# List topics in a product
blm list --product <product>

# List sections in a topic
blm list --product <product> --topic <topic>

Search Content

# Search for content
blm search "your search query"

# Search within a specific product
blm search "your search query" --product <product>

# Limit search results
blm search "your search query" --limit 5

Get Content

# Get content by path
blm get --product <product> --topic <topic>

# Get specific section
blm get --product <product> --topic <topic> --section <section>

Import Content

# Import content from a markdown file
blm import <file.md> --product <product> --topic <topic>

Update Content

# Update content
blm update --product <product> --topic <topic> --file <file.md>

Delete Content

# Delete content
blm delete --product <product> --topic <topic>

Generate Content

# Generate structured content from raw input
blm generate --product <product> --topic <topic> --file <file.md>

# Specify template version
blm generate --product <product> --topic <topic> --file <file.md> -v v3

Content Generation Guidelines

When using the generate command, the system follows these principles:

  1. Factual Accuracy: The system prioritizes factual accuracy over filling every template section. All content must be derived from the source material.

  2. DOK Structure:

    • DOK1 and DOK2: Function as context packs containing factual information and foundational knowledge directly from the source material.
    • DOK3 and DOK4: Higher-level insights are only included when they can be genuinely derived from the content, not invented.
  3. Experts Section: Only includes people or sources that are explicitly mentioned in the original content. If no experts are explicitly mentioned, this section should remain empty or be omitted.

  4. Purpose Section: Clearly defines what the content is about - the core objective or focus of the material.

  5. Template Flexibility: The template structure respects what's actually in the content rather than forcing information into categories where it doesn't exist in the source material.

Verbose Mode

Add the --verbose flag to get more detailed output:

blm --verbose INFO list
blm --verbose DEBUG generate --product <product> --topic <topic> --file <file.md>

Development

This CLI is a thin wrapper around the BrainLift serverless backend. It handles:

  1. Command-line argument parsing
  2. File I/O for content import/export
  3. API calls to the serverless backend
  4. Formatting and displaying results

All business logic, content processing, and storage operations are handled by the serverless backend.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brainlift-0.2.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brainlift-0.2.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file brainlift-0.2.0.tar.gz.

File metadata

  • Download URL: brainlift-0.2.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.15

File hashes

Hashes for brainlift-0.2.0.tar.gz
Algorithm Hash digest
SHA256 181875e94d87a8bddbd4b87c52d0a234a0685278ba58f834a8dd0281e75772ee
MD5 b373e5fc4b3960b00a5c9dfdb2f86a9d
BLAKE2b-256 221881973e18a831b472c481d7c8b0e83ed0918d6c99bd32c7b7a87314559512

See more details on using hashes here.

File details

Details for the file brainlift-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: brainlift-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.15

File hashes

Hashes for brainlift-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3cb9a98377864fb87195be9e3c4809d343c279095d92a9077ab2c9ec81672810
MD5 3117c691d20496f9c4ac7a02b669e424
BLAKE2b-256 287d168504424fcbadd76d1e1b823cba5b738b4d308fedb0f5c84e62e8c829b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page