Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@brainstack/pipe-chat-cli

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brainstack/pipe-chat-cli

CLI tool to discuss with AI to about data source and apply changes.

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source

Here is a README and a deployment script for your npm package @brainstack/pipe-chat-cli:

README

# @brainstack/pipe-chat-cli

`@brainstack/pipe-chat-cli` is a CLI tool designed to interact with your Supabase database and leverage AI to discuss, refactor, and improve your database schema.

## Features

- Initialize a data source.
- Retrieve the current context (schema) from the data source.
- Chat with an AI to get insights and suggestions for schema modifications.
- Dynamically process messages through a customizable parser pipeline.

## Installation

You can install the CLI globally using npm:

```sh
npm install -g @brainstack/pipe-chat-cli

Usage

After installation, you can use the CLI commands as follows:

pipe-chat-cli init
pipe-chat-cli context
pipe-chat-cli chat

Commands

  • init: Initialize the data source.
  • context: Get the current context from the data source.
  • chat: Chat with the AI to discuss and improve the schema.

Environment Variables

Create a .env file in the root directory of your project and add the following environment variables:

SUPABASE_URL=your-supabase-url
SUPABASE_KEY=your-supabase-key
AI_PROVIDER_BASE_URL=your-openai-base-url
AI_PROVIDER_API_KEY=your-openai-api-key
AI_MODEL=your-openai-model

Example .env file

SUPABASE_URL=https://xyzcompany.supabase.co
SUPABASE_KEY=your-supabase-key
AI_PROVIDER_BASE_URL=https://api.openai.com
AI_PROVIDER_API_KEY=your-openai-api-key
AI_MODEL=gpt-4

Development

To develop and test the package locally, clone the repository and run:

npm install
npm run build
npm link

This will link the local package as a global npm package. You can then use the CLI commands as described above.

License

MIT


### Deployment Script

Here's a script to prepare and publish your package to npm:

```sh
#!/bin/bash

# Ensure the package.json version is updated before publishing
echo "Updating package version..."
npm version patch

# Build the project
echo "Building the project..."
npm run build

# Publish the package to npm
echo "Publishing the package to npm..."
npm publish

# Output completion message
echo "Package @brainstack/pipe-chat-cli published successfully!"

# Instructions for testing the package
echo "You can now test the package using: npx @brainstack/pipe-chat-cli"

Adding bin field in package.json

To make sure the CLI can be run using npx @brainstack/pipe-chat-cli, add the bin field to your package.json:

{
  "name": "@brainstack/pipe-chat-cli",
  "version": "1.0.0",
  "description": "CLI tool to interact with Supabase and AI to improve your database schema",
  "main": "dist/index.js",
  "scripts": {
    "build": "tsc",
    "start": "node dist/index.js"
  },
  "bin": {
    "pipe-chat-cli": "./dist/index.js"
  },
  "dependencies": {
    "commander": "^10.0.0",
    "dotenv": "^16.0.0",
    "openai": "^3.0.0",
    "supabase": "^1.0.0"
  },
  "devDependencies": {
    "@types/node": "^18.0.0",
    "typescript": "^5.0.0"
  },
  "keywords": [
    "supabase",
    "openai",
    "cli",
    "database",
    "ai"
  },
  "author": "Your Name",
  "license": "MIT"
}

Final Steps

  1. Save the deployment script as deploy.sh, give it executable permissions using chmod +x deploy.sh, and then run it with ./deploy.sh.
  2. Make sure to update the version in package.json appropriately before publishing.

With these steps, your CLI tool should be ready to use and can be installed globally or run using npx @brainstack/pipe-chat-cli.

Keywords

FAQs

Package last updated on 30 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc