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.1.0.tar.gz (12.1 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.1.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for brainlift-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e5f4203a6b2eae5ed30cbad578d21f291b56168d181b9819330b514e84160d28
MD5 b7c43cafbd43d257539f75aa6c3ed47d
BLAKE2b-256 263f123d51b6040cf036dc39e8868f394d8b35225f1aff78ccda762c86d39f97

See more details on using hashes here.

File details

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

File metadata

  • Download URL: brainlift-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.6 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4721ccc5e46142e1d5d4a71e9a5dadb9167198963b6614d310d904b7e233442b
MD5 d0b4c900267bc9f2b2fa9e8d81e9d199
BLAKE2b-256 a5300ac809fe2472583456f445fe287833ef9ac4d6d521426e2ee6b35f23b0fb

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