Skip to main content

High-performance CLI assistant for generating shell commands using LLM models

Project description

code_djinn - Your Coding Genie

Test Upload Python Package PyPI version Python versions Development Status

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

code_djinn-0.2.1.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

code_djinn-0.2.1-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

Details for the file code_djinn-0.2.1.tar.gz.

File metadata

  • Download URL: code_djinn-0.2.1.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for code_djinn-0.2.1.tar.gz
Algorithm Hash digest
SHA256 49b3a79aeb184884cab3535512d46dc20c53140d99d633cceaa62a57e4fb5c61
MD5 d5a29f17232cc7642fc07e530b607e95
BLAKE2b-256 2d61fdc3835b3076f2858639a8c7b4bdaaa66c8c39869e9a45e5d1821739c174

See more details on using hashes here.

File details

Details for the file code_djinn-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: code_djinn-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 34.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for code_djinn-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b6b0c99916b3e066af74d7211340d8eba3122b3a896d40373e938b976222d2b
MD5 d51f585372e26c0c65a4bf47802a6642
BLAKE2b-256 eefa81e959f58a6ccfbafc5dd8bc665a2416e5f401940c1fd1cfe208545ebb43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page