Chat with AI from your terminal!
Project description
Intelliterm
Chat with AI from your terminal!
Note
This is a side project I occasionally work on in my free time, there are bound to be bugs and/or missing features. Contributions welcome!!
Features
- :brain: GPT-4 — Chat with any of OpenAI's language models!
- :space_invader: Code Execution — Copy and run code [^1]
- :gear: Configurations — Quickly switch between models (mid-chat!) and manage multiple configurations
- :file_folder: File Input — Dump files into prompts!
- :speech_balloon: Chat Manager — Create, save [^2] and load chats!
!
Command Palette — Do useful things with a variety of built-in commands!- :writing_hand: Auto-completion — Auto-complete commands with tab (and navigate history with ↑ / ↓)
How to use
Note
Make sure you've set yourOPENAI_API_KEY
environment variable in~/.zshrc
or~/.bashrc
:export OPENAI_API_KEY='YOUR-API-KEY'
Basic usage:
ai
# or with a prompt
ai write a python program that prints a random chess position using emojis
Input a file:
ai -f file.py # -f or --file
# or via pipes
cat file.py | ai
git diff | ai
Note
Piping a git diff is a special case for which Intelliterm one-shot generates a commit message in conventional format, summarizing the diff (for better UX).
Options
Short | Long | Description |
---|---|---|
-f |
--file |
Pass a file as prompt |
-m |
--mini --oneshot |
Complete prompt without entering the Intelliterm CLI ("one-shot" usage) |
-c |
--copy |
Auto-copy entire response to clipboard |
-cc |
--copy-code |
Auto-copy code block to clipboard |
-h |
--help |
Show help message (this one) |
-v |
--version |
Show Intelliterm version |
!
Command Palette
Note You must be in a chat to use Command Palette (start a chat via
ai
orai <prompt>
)
Intelliterm comes with a set of handy commands, triggered by entering !
followed by:
Command Aliases | Command Options | Command Description | |
---|---|---|---|
General |
!help !h
|
Show available commands | |
!quit !q or Ctrl + c |
Quit Intelliterm | ||
!shell !os
|
Run basic shell commands within Intellitermusage: |
||
Configuration |
!cfg !use !config !switch
|
edit reset
|
Manage Intelliterm configurations
|
Chat |
!new !n
|
Start new chat / clear context | |
!file !f
|
Input a file as promptusage: |
||
!info !i
|
Show information about current chat | ||
!save !s
|
Save chat (to: <DOCUMENTS_DIR>/intelliterm/chats
|
||
!load !l
|
Load chat | ||
Response |
!copy !c
|
code
|
Copy last response to clipboard
Note: to auto-copy every new response: |
!run !r
|
Run code block in last responseNote: currently supports: |
Contributing
Pull requests, suggestions and issue reports are very welcome 👽
[^1]: Running generated code currently supported for Python, JavaScript and TypeScript code snippets.
[^2]: Intelliterm uses platformdirs to determine the file paths where configurations and chats are saved to and loaded from. CONFIG_DIR
and DOCUMENTS_DIR
directory locations will thus vary based on your OS (Intelliterm displays them when saving/loading things).
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
Hashes for intelliterm-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2eb5b6234704ec2c49eea67ea291ce055f1fefdbd2239f9aaa40e4f29a885f1 |
|
MD5 | f78c0c8885ddb7673f59c6fb7174f07e |
|
BLAKE2b-256 | 7aa0144c0bb3d97c890b87dbbe1b1d097a32b10d7c0ccbbd005875929c077cc2 |