Skip to main content

Natural-language to shell command converter / executor with Grok API

Project description

Quick Workspace Executor (flyn)

  • A natural-language to shell command converter CLI tool. It allows you to type instructions in plain English, and it generates OS-specific shell commands safely. It also includes diagnostic tools, command explanation, history tracking, and configuration management.

Features

- Convert natural-language instructions into shell commands
- Supports multiple OS modes: Windows, Linux, macOS
- Risk analysis for potentially dangerous commands
- Command history tracking (last 50 commands)
- Configure API key, model, OS, and temperature
- Diagnostic tools for verifying API and model connectivity
- Explain shell commands with detailed breakdowns
- Version command to check current flyn version

Installation

  1. Clone the repository:
git clone <repo-url>
cd flyn
  1. Create a virtual environment:
python -m venv venv
  1. Activate the environment:
  • Windows:
venv\Scripts\activate
  • Linux/macOS:
source venv/bin/activate
  1. Install dependencies:
pip install -e .

This will install typer, rich, google-generativeai, and other required packages.


Usage

All commands use the flyn CLI.

Run Commands

Generate shell commands from natural language:

flyn run "<instruction>" [--dry-run/--run]
  • --dry-run (default) – shows the command without executing it.
  • --run – executes the command.

Example:

flyn run "count the number of files in the folder"

Output:

Generated command: (Get-ChildItem -File | Measure-Object).Count
Explanation: Counts the number of files in the current directory.
Risk level: LOW
Dry run: Command not executed.

Configuration

Manage flyn configuration:

flyn config show           # Show all config values
flyn config get <key>      # Get a single config key
flyn config set <key> <value>  # Update a config value
flyn config reset          # Reset to defaults
  • Defalut OS Configuration : Windows

  • Keys include api_key, model, os, temperature.

  • Temperature is a float value (0.0–1.0) controlling command generation randomness.

Example:

flyn config set os linux
flyn config set temperature 0.3

OS Quick Commands

Switch OS modes quickly:

flyn os windows
flyn os linux
flyn os mac

Or use:

flyn os set <os>

History

Track your commands:

flyn history show   # Show last 50 commands
flyn history clear  # Clear command history

Tools

Diagnostic and reverse-analysis tools:

flyn tools diagnose         # Verify config, API, and model
flyn tools models           # List available Gemini models
flyn tools explain "<command>"  # Explain a shell command

Version

Check the current flyn version:

flyn version

Command Reference

Command Description
flyn run "<instruction>" [--dry-run/--run] Generate shell commands from natural language.
flyn version Show the current flyn version.
flyn config show Display all configuration values.
flyn config get <key> Get a single configuration value.
flyn config set <key> <value> Update a configuration value (e.g., OS, model, temperature).
flyn config reset Reset configuration to defaults.
flyn os set <os> Set OS mode explicitly.
flyn os windows Quick set OS to Windows.
flyn os linux Quick set OS to Linux.
flyn os mac Quick set OS to macOS.
flyn history show Show the last 50 commands executed.
flyn history clear Clear all command history.
flyn tools diagnose Check configuration, API key, and model.
flyn tools models List available Gemini models for your API key.
flyn tools explain "<command>" Ask Gemini to explain what a shell command does.

Supported OS

  • Windows (PowerShell)
  • Linux (bash, sh)
  • macOS (zsh, bash)

flyn ensures commands are OS-specific and safe to run.


Safety

  • All generated commands are analyzed for risk.
  • Risk levels: LOW, MEDIUM, HIGH.
  • Dangerous commands (like rm -rf) are flagged.

Requirements

  • Python >= 3.10 (3.11 recommended)
  • Gemini API key (gemini_api_key) for command generation
  • Internet connection for API requests

Development

  • Source code is under cli/ and core/.
  • Config file: config/settings.json
  • Virtual environment recommended (venv/)
Happy scripting with flyn — turning your instructions into shell commands!  

Powered by Python, fueled by coffee, guided by late-night curiosity ☕🚀

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

flyn-0.1.4.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

flyn-0.1.4-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file flyn-0.1.4.tar.gz.

File metadata

  • Download URL: flyn-0.1.4.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for flyn-0.1.4.tar.gz
Algorithm Hash digest
SHA256 167fc29ad71e4d6e752aefefdc92ff640e0f2144e74577e6942cdec34bddde67
MD5 a82cd5d7e49f225328e5efba880d2000
BLAKE2b-256 9cb2304810540493cf443a10b9e37c29bab4d2f694eee0fdcf17654724a44e67

See more details on using hashes here.

File details

Details for the file flyn-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: flyn-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for flyn-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6d3a1d45d8c3f4cfc9983015e2f2a3e2f7d266bde73a9b7308a86bb9583a1c9d
MD5 6620a64f649da6b7acce5c029a8731c5
BLAKE2b-256 c8ebd522c7db6621e44c0708f5f8296a6133ac68851d694d2a59023f4a40338a

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