Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@brainstack/pipe-chat-cli
Advanced tools
CLI tool to discuss with AI to about data source and apply changes.
Here is a README and a deployment script for your npm package @brainstack/pipe-chat-cli
:
# @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
After installation, you can use the CLI commands as follows:
pipe-chat-cli init
pipe-chat-cli context
pipe-chat-cli chat
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.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
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
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.
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"
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"
}
deploy.sh
, give it executable permissions using chmod +x deploy.sh
, and then run it with ./deploy.sh
.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
.
FAQs
CLI tool to discuss with AI to about data source and apply changes.
The npm package @brainstack/pipe-chat-cli receives a total of 0 weekly downloads. As such, @brainstack/pipe-chat-cli popularity was classified as not popular.
We found that @brainstack/pipe-chat-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.