Giter VIP home page Giter VIP logo

navi's Introduction

Navi: AI-Powered Shell Guide

"Navi" means "guide" in Hindi, and that's exactly what this tool aims to be. Navi is a command-line tool that utilizes the Gemini API to leverage artificial intelligence in generating shell commands based on your prompts. It simplifies your workflow by understanding your intent and providing the necessary commands to achieve your tasks.

Screen.Recording.2024-03-24.at.5.46.04.PM.mp4

Usage

Navi - Your AI-powered Shell Guide

Usage:
  navi [flags]
  navi [command]

Examples:
navi "List all files in the current directory."

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  explain     Explain - Understand your shell commands
  help        Help about any command

Flags:
  -h, --help   help for navi

Use "navi [command] --help" for more information about a command.

Commands

1. navi

The navi command takes a string as an argument and generates a shell command based on that string.

Example:

$ navi "list all files`

$ >> ls -a

2. navi explain

The navi explain command also takes a string (shell command) as an argument, and explains the functionality of a given shell command.

Example:

$ navi explain "ls -a`

$ Explanation >>

the command explanation

Installation

You can install Navi using the go install command:

go install github.com/nitintf/navi

After installation, don't forget to export your Gemini API key:

export GEMINI_API_KEY="..."

You can obtain your Gemini API key from the Gemini API Management page.

Vim integration

Plugin load and installation

Edit navi.vim to set g:NaviBin to your custom binary location. Optionally, change the preferred key combination (defaults to <C-k>).

In Vim, you simply have to :source navi.vim.

However, if you want the plugin to be persistent, make it load when Vim starts: copy navi.vim to any directory present in your runtime path (:echo &runtimepath). Restart Vim. Verify if the script is loaded with :scriptnames.

Usage

In Normal Mode, press your preferred key combination (or by default) to pass your current line to Navi. In Visual Mode, you may select more lines.

Caution

While Navi uses AI to generate shell commands, it's important to understand that AI isn't perfect. Always review the generated commands before executing them, especially if you're working in a production environment or dealing with sensitive data. Navi is a tool designed to assist you, but it doesn't replace good judgment and understanding of shell commands.

Contribution

Contributions to Navi are very welcome! If you have a feature request, bug report, or proposal for code refactoring, please feel free to open an issue or submit a pull request.

This thing only supports Gemini for the moment, but it could be easily updated to support other models using Replicate, Ollama, etc. Pull requests welcome!

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.