@gitsense/gscb-cli
v0.5.3
Published
GitSense Chat Bridge (GSCB) Command Line Tool
Downloads
34
Readme
GitSense Chat Bridge (GSCB) CLI
The GitSense Chat Bridge (GSCB) Command Line Interface is a tool designed to import various data sources, primarily Git repositories, into a GitSense Chat SQLite database. This allows the GitSense Chat application to leverage your code repositories for enhanced conversational AI capabilities.
Table of Contents
Installation
To install the GSCB CLI, ensure you have Node.js and npm (or yarn/pnpm) installed.
Install via npm (Recommended for users):
To install the CLI globally, run:
npm install -g @gitsense/gscb-cliThis will make the gscb command available directly in your terminal.
Install from source (For contributors/developers):
If you intend to contribute or develop the CLI, you can clone the repository and build it:
# Clone the repository
git clone https://github.com/gitsense/gscb-cli.git
cd gscb-cli
# Install dependencies
npm install
# Build the project
npm run buildAfter building, the gscb executable will be available in dist/bin/gscb.js.
Usage
The GSCB CLI's primary function is to import data.
Import Git Repository
The import git command allows you to import a Git repository into your GitSense Chat database. The command now uses positional arguments for a more streamlined experience, with the database path specified as an option.
Current Version: 0.5.0
Syntax:
gscb import git <repo directory> <repo owner> <repo name> <branch> [options]Arguments:
<repo directory>: The local path to the Git repository (e.g.,./my-repo,.for current directory).<repo owner>: The owner or organization name of the repository (e.g.,gitsense).<repo name>: The name of the repository (e.g.,gscb-cli).<branch>: The Git branch to import (e.g.,main,develop). Theref-typeis automatically set tobranch.
Options:
--db-path <path>: The path to the GitSense Chat SQLite database file (e.g.,./test.db). Defaults to./data/chats.sqlite3relative to the CLI executable.-s, --max-size <size>: Maximum file size in KB to include in the import (default:256).-i, --include <pattern>: Regular expression pattern to include specific files.-x, --exclude <pattern>: Regular expression pattern to exclude specific files.-p, --prompt <name>: Name of the system prompt to use for processing.--include-binary: Include binary files in the import (by default, binary files are skipped).-v, --verbose: Enable verbose logging for detailed output.
Examples:
- Import a repository from the current directory:
gscb import git . gitsense gscb-cli main --db-path ./test.db- Import a specific repository with a custom max file size and verbose logging:
gscb import git /path/to/your/repo my-company my-project develop --db-path ./data/chat.db -s 512 -v- Import a repository, including binary files and excluding certain patterns:
gscb import git ./another-repo your-org awesome-app main --db-path ./db/app.sqlite --include-binary -x "node_modules|dist"List Imported Data
The list command allows you to view imported data, specifically Git repositories.
Syntax:
gscb list [type] [owner] [repoName] [options]Arguments:
[type]: (Optional) The type of data to list. Currently, onlygitis supported. If omitted, available types will be listed.[owner]: (Optional) Filter by repository owner. Only applicable whentypeisgit.[repoName]: (Optional) Filter by repository name. Only applicable whentypeisgit.
Options:
--db-path <path>: Path to the GitSense Chat SQLite database. Defaults to./data/chats.sqlite3relative to the CLI executable.
Examples:
- List all available data types:
gscb list- List all imported Git repositories:
gscb list git- List all imported Git repositories from a specific database path:
gscb list git --db-path ./my-custom-db.sqlite