Lexido is an innovative assistant for the command line, designed to boost your productivity and efficiency. Powered by Gemini 1.5 Flash and utilizing the free API, Lexido offers smart suggestions for commands based on your prompts and importantly your current environment. Whether you're installing software, managing files, or configuring system settings, Lexido streamlines the process, making it faster and more intuitive.
- Command Suggestions: Simply type
lexido [prompt]
to get actionable command suggestions. - Cross-Platform: Support for both Linux and macOS
- Continued Conversations: Use
lexido -c [prompt]
to continue a previous conversation, allowing for context-aware suggestions. - Piping Support: Pipe commands into Lexido (e.g.,
ls | lexido [prompt]
) for enhanced command list suggestions. - Efficiency: Designed with efficiency in mind, Lexido helps you get things done NOW.
Lexido is available on the AUR. Install it using the package manager of your choice such as:
yay -S lexido
Lexido is available on homebrew. Install it using the brew
command:
brew install lexido
Head to the releases tab to pick up a binary! Once downloaded, you'll want to make Lexido easily accessible from anywhere on your computer. Here's how:
-
Rename the downloaded file:
The downloaded file might have a long and specific name, like "v1.0-lexido-linux-amd64". For easier use, consider renaming it to just "lexido".
-
Make the file executable:
Open your terminal and navigate to the folder where you downloaded the Lexido binary. Then, run the following command to make the file executable:
chmod +x ./lexido
-
Move the file to your system's path:
Why do this? By placing the renamed and executable Lexido file in your system's path, you can run it from any terminal window without needing to specify the full path to the file. It's a shortcut for convenience!
Here's an example command assuming you downloaded Lexido to your Downloads folder:
mv ~/Downloads/lexido /usr/local/bin/lexido
Ensure you have Go installed on your system. Follow these steps to install Lexido:
- Clone the Lexido repository:
git clone https://github.com/micr0-dev/lexido.git
- Navigate to the Lexido directory:
cd lexido
- Build the project:
go build
- Optionally, move the Lexido binary to a location in your PATH for easy access.
If you want to run lexido completely locally you can do that as of version 1.3! This is done via Ollama, a tool for easily running large language models locally. It does all the hard work of installing LLMs for you!
You can install Ollama as follows:
curl -fsSL https://ollama.com/install.sh | sh
Running lexido locally is as easy as adding the -l
flag when you want to run locally, or using --setLocal
to run locally by default! You can also select the model you want to run with -m
and again set it to be the default with --setModel
. Be sure you have the model installed before attempting to run it with lexido however!
This guide provides instructions on how to create and customize the JSON configuration files necessary for API integration within lexido. Each configuration allows the application to interact with a different external API by specifying endpoints, headers, data templates, and specific fields to extract from API responses.
The default configuration template is provided as a baseline. This template includes placeholders that should be customized based on the specific API you want to integrate with.
{
"api_config": {
"url": "https://api.example.com/endpoint/v1/chat/completions",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json"
},
"data_template": {
"model": "example-model",
"messages": "<PROMPT>"
},
"field_to_extract": "response"
}
}
- url: The endpoint URL of the API you are calling.
- headers: HTTP headers to include with your request. Common headers include
Content-Type
andAccept
. - data_template: The data body of your request.
<PROMPT>
will be replaced dynamically by the application. - field_to_extract: The field within the API response from which data should be extracted.
Below is an example configuration specifically set up for interacting with the oLlama API, which is assumed to run locally.
{
"api_config": {
"url": "http://localhost:11434/api/generate",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json"
},
"data_template": {
"model": "llama3",
"prompt": "<PROMPT>"
},
"field_to_extract": "response"
}
}
- Model: Depending on the capabilities of the API, you might need to change the
model
value to match the model provided by the API service. - Prompt: The
<PROMPT>
placeholder indata_template
will be replaced with the actual query or command you wish to send to the API.
To create your own configuration:
- Copy the default configuration template. The location for the config is
~/.lexido/remoteConfig.json
- Replace the
url
,headers
,data_template
, andfield_to_extract
fields as needed for your specific API. - Ensure all placeholders like
<PROMPT>
are appropriately positioned where dynamic content is expected to be inserted by the application.
This configuration system is designed to be flexible and extendable, allowing for easy integration with various APIs by simply modifying the JSON configuration files. For advanced configurations, you may need to adjust additional parameters.
- To get command suggestions:
lexido "install teamspeak via docker"
- To continue with a previous prompt:
lexido -c "add more details or follow-up"
- To use with piping commands:
ls | lexido "what should I do with these files?"
The binary's size mainly consists of the built-in networking and encryption libraries of Go. A quick inspection showcases this:
> goweight
12 MB runtime
8.1 MB net/http
5.3 MB google.golang.org/protobuf/internal/impl
4.1 MB net
4.1 MB golang.org/x/net/http2
3.9 MB golang.org/x/sys/unix
3.7 MB crypto/tls
3.3 MB google.golang.org/grpc
Before requesting the LLM the program does what is known as prompt building or contextualization, it collects different data about your system and your current scenario to help the LLM more accurately answer. Giving the LLM context about your situation allows it to better understand what you are asking or how to reply.
If you have any more questions feel free to reach out and ask
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
If you use and enjoy lexido, you can buy me a coffee as a thank you! https://ko-fi.com/micr0byte
Distributed under the GNU Affero General Public License v3.0 or any later version. See LICENSE
for more information.
- Gemini 1.5 Flash for the LLM powering Lexido.
Made with 💚 by Micr0byte