High-performance CLI assistant for generating shell commands using LLM models
Project description
code_djinn - Your Coding Genie
Code Djinn is a lightning-fast CLI assistant that generates shell. Code Djinn leverages fast and efficient LLM models like QwQ (Qween), Codestral (Mistral), and Gemini flash (Google) to provide quick responses to your coding queries. The focus on lightweight models ensures snappy performance and responsiveness, making it a practical tool for your daily coding tasks.
So why spend hours on obscure StackOverflow threads or try to remember arcane CLI commands? Let code_djinn handle the boring stuff so you can focus on building awesome projects! 🧞♂️
Installation
Installing Code Djinn from source via:
pip install git+https://github.com/phisanti/code_djinn.git
Usage
To use Code Djinn, you need to initialize the configuration first. This is a one-time process that will save your preferences and settings. Here’s how you do it:
code-djinn --init
This will prompt you to enter some information, such as:
- Your OS family (e.g. Windows, MacOS, Linux). Code Djinn will try to detect it automatically, but you can also input it manually if it's wrong.
- Your shell (e.g. bash, zsh, fish). Code Djinn will try to guess it from your environment variables, but you can also input it manually if it's wrong.
- Your DeepInfra API key. This is required to access the AI engine that powers Code Djinn. Also, currently, the only model implemented is mistra7B, so, you have to activate that model.
Summon code-djinn by describing what you want to do:
Generate commands instantly:
# Basic command generation
code-djinn -a "list files by size"
# Output: ls -lhS
# With explanation
code-djinn -a -e "find large files"
# Execute with confirmation
code-djinn -x "show disk usage"
Available Commands
# Generate commands
code-djinn -a "your request" # Fast command generation
code-djinn -a -e "your request" # With explanation
code-djinn -a -v "your request" # Verbose LLM output
# Execute commands safely
code-djinn -x "your request" # Generate and execute with confirmation
# Utilities
code-djinn --init # Setup configuration
code-djinn --list-models # Show available LLM models
code-djinn -t "your request" # Test prompt generation
code-djinn --clear-cache # Clear performance cache
Supported Providers & Models
- DeepInfra: QwQ-32B, Qwen2.5-Coder-32B, Mistral-Small-24B
- MistralAI: codestral-2501, mistral-small-2503
- Google: gemini-2.0-flash
If you have any doubt, please open an issue!
Help
Currently, this tool is quite simple and all documentation can be found through the --help flag. Here is a quick summary:
❯ code-djinn --help (codedjinn_dev)
usage: code_djinn [-h] [-i] [-a [WISH]] [-t [WISH]] [-e] [-v] [--list-models] [-x [WISH]] [--clear-cache]
An AI CLI assistant
options:
-h, --help show this help message and exit
-i, --init Initialize the configuration
-a [WISH], --ask [WISH]
Get a shell command for the given wish
-t [WISH], --test [WISH]
Test the prompt for the given wish
-e, --explain Also provide an explanation for the command
-v, --verbose Verbose output from AI
--list-models List available models for all providers
-x [WISH], --execute [WISH]
Generate and execute a shell command for the given wish
--clear-cache Clear LLM client cache for troubleshooting
Bonus
What's djinn (“جن”)? In Arabic mythology, a Djinn (also spelled as Jinn or Genie) is a supernatural creature that is made from smokeless and scorching fire. They are often depicted as powerful and free-willed beings who can be either benevolent or malevolent. Djinns are believed to have the ability to shape-shift and can take on various forms, such as humans or animals. They are also known for their exceptional strength and their ability to travel great distances at extreme speeds. Despite their supernatural abilities, Djinns, like humans, are subject to judgment and will either be condemned to hell or rewarded with heaven in the afterlife.
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 code_djinn-0.2.2.tar.gz.
File metadata
- Download URL: code_djinn-0.2.2.tar.gz
- Upload date:
- Size: 28.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d46de72f21751be7bb117956ff8da738cea707430ac1910bd13aa536fb98b29b
|
|
| MD5 |
aab6005ce3606d41af9b980e32056a6c
|
|
| BLAKE2b-256 |
ed2fc64b5888cac048fedc50c236f887adb4c129fe9945b37d9e7faf5156e634
|
Provenance
The following attestation bundles were made for code_djinn-0.2.2.tar.gz:
Publisher:
publish-to-pypi.yml on phisanti/code_djinn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
code_djinn-0.2.2.tar.gz -
Subject digest:
d46de72f21751be7bb117956ff8da738cea707430ac1910bd13aa536fb98b29b - Sigstore transparency entry: 321260464
- Sigstore integration time:
-
Permalink:
phisanti/code_djinn@4c8e52692cf24c1c9799908ba7ad989c2800dfd3 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/phisanti
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@4c8e52692cf24c1c9799908ba7ad989c2800dfd3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file code_djinn-0.2.2-py3-none-any.whl.
File metadata
- Download URL: code_djinn-0.2.2-py3-none-any.whl
- Upload date:
- Size: 36.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80403f045f525db0477659ef3cf05750aa155874f4628109f684c6d2eeca3968
|
|
| MD5 |
befed628768de31e0193bf33ebe95a97
|
|
| BLAKE2b-256 |
0734993f6122b3292f5bc536a4e6c1fac869880e994f1332c816785af94c6cc5
|
Provenance
The following attestation bundles were made for code_djinn-0.2.2-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on phisanti/code_djinn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
code_djinn-0.2.2-py3-none-any.whl -
Subject digest:
80403f045f525db0477659ef3cf05750aa155874f4628109f684c6d2eeca3968 - Sigstore transparency entry: 321260495
- Sigstore integration time:
-
Permalink:
phisanti/code_djinn@4c8e52692cf24c1c9799908ba7ad989c2800dfd3 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/phisanti
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@4c8e52692cf24c1c9799908ba7ad989c2800dfd3 -
Trigger Event:
release
-
Statement type: