Skip to content

okolilemuel/clich

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI CLI Chat

A beautiful CLI chat interface for AI agents, built with Bun.js and Consola.

CLI Usage

Install Globally

You can install the CLI globally using npm (after publishing) or by linking locally with Bun:

With npm (after publish):

npm install -g clic

With Bun (for local development):

make link

Run the CLI

After installing or linking, start the chat interface from anywhere with:

clic

If you see 'command not found', ensure that your Bun global bin directory (usually ~/.bun/bin) is in your PATH.

Installation

bun install -g ai-cli-chat

Usage

ai-chat --model=grok --logDir=./logs

Features

  • Interactive chat with user input and AI responses
  • Configurable via .aichatrc file
  • Command-line flags for model and log directory
  • Chat history and logging to file
  • Commands: /clear, /history, /help

Commands

  • exit: Quit the chat
  • /history: Show chat history
  • /clear: Clear the screen
  • /help: Show help message

Configuration

Create a .aichatrc file in the project root:

{
  "promptColor": "blue",
  "logDir": "./logs",
  "aiModel": "grok",
  "maxHistory": 50
}

CLI Flags

  • --model: Set AI model (e.g., --model=grok)
  • --logDir: Set log directory (e.g., --logDir=./logs)

Development

This project uses Bun as the runtime and package manager.

Setup

  1. Install Bun: If you don't have Bun installed, follow the instructions on the official Bun website.
  2. Install Dependencies:
    bun install
    This command installs all necessary dependencies defined in package.json.

Running the Application

  • Development Mode:

    bun run start

    This starts the application with live reloading (if configured) and is suitable for development.

  • Production Mode (after building):

    bun run start:dist

    This runs the built version of the application from the dist/ directory.

Publishing the CLI

To publish the CLI globally (for your own use or for npm):

make publish

This will run bun publish to publish the package to npm. Make sure you are logged in to npm and have updated the version in package.json.

Building for Production

bun run build

This command transpiles the TypeScript code to JavaScript and outputs it to the dist/ directory, preparing it for production.

Running Tests

bun run test

This executes all test files (typically *.test.ts) using Bun's built-in test runner.

Contributing

Contributions are welcome! If you'd like to contribute, please follow these steps:

  1. Fork the repository on GitHub.
  2. Clone your fork locally:
    git clone https://github.com/YOUR_USERNAME/clic.git
    cd clic
  3. Create a new branch for your feature or bug fix:
    git checkout -b your-feature-branch
  4. Make your changes and commit them with clear messages.
  5. Push your changes to your fork:
    git push origin your-feature-branch
  6. Open a Pull Request from your fork to the original repository's main branch.

Please ensure your code follows the existing style and that all tests pass before submitting a pull request.

License

MIT

About

CLICH for any backend that takes a message and returns a response.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published