A command-line AI chat application
Project description
ai-shell-agent
A command-line AI chat application that allows you to interact with OpenAI's language models directly from your terminal. And help you running terminal commands and python code on it's own (it inputs it for you and you can still make your edits)
Features
- Manage chat sessions
- Set and update system prompts
- Send and edit messages
- Temporary in-memory chat sessions
- API key management
Installation
You can install the package from PyPI:
pip install ai-shell-agent
Alternatively, you can install it from the source:
git clone https://github.com/yourusername/ai-shell-agent.git
cd ai-shell-agent
pip install .
Usage
Setting the API Key
Before using the application, you need to set your OpenAI API key:
ai --set-api-key
If you don't set it up you will be prompted when trying to use other functionality.
Quick conversation in session
To quickly initialize in-memory conversation, type
ai "your message here"
Creating or Loading a Chat Session
To create or load a chat session with a specified title:
ai --chat "My Chat Session"
Listing Available Chat Sessions
To list all available chat sessions:
ai --list-chats
Renaming a Chat Session
To rename an existing chat session:
ai --rename-chat "Old Title" "New Title"
Deleting a Chat Session
To delete a chat session:
ai --delete-chat "Chat Title"
Setting the Default System Prompt
To set the default system prompt for new chats:
ai --default-system-prompt "Your default system prompt"
Updating the System Prompt for the Active Chat Session
To update the system prompt for the active chat session:
ai --system-prompt "Your new system prompt"
Sending a Message
To send a message to the active chat session:
ai --send-message "Your message"
Starting a Temporary Chat Session
To start a temporary (in-memory) chat session with an initial message:
ai --temp-chat "Initial message"
Editing a Previous Message
To edit a previous message at a given index:
ai --edit 1 "New message"
Development
To contribute to the project, follow these steps:
-
Fork the repository.
-
Clone your forked repository:
git clone https://github.com/yourusername/ai-shell-agent.git
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Run the tests:
pytest
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgements
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_shell_agent-0.1.0.tar.gz.
File metadata
- Download URL: ai_shell_agent-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d909a8419c67dc03367364b608dc8477ad62e5f89f652fe0fe7721a983c9039d
|
|
| MD5 |
c454bb54f1a5f4c4d7d01a8e8b3a1b9b
|
|
| BLAKE2b-256 |
0806bd5f793bc555d740f28b798e18a69f04e57a5751f22ee3091d87c94f59c0
|
File details
Details for the file ai_shell_agent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ai_shell_agent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e59984b238e129c78ef064dcfc0929dc8603a0dd8bd5dd13f6c93c492230c0cc
|
|
| MD5 |
c125f2c5b4d852bf4060673052459f3d
|
|
| BLAKE2b-256 |
bebc73894550e05f931d9cce0dbc19d2db9b981a2016324b1b3694c46570b265
|