Sign inSign up

arjunsenngupta1008/hyejack-powershell

By arjunsenngupta1008

•Updated 6 months ago

hyeJack-powershell: AI agent turning plain English into self-healing PowerShell workflows.

Image
0

143

arjunsenngupta1008/hyejack-powershell repository overview

This project is open source.
GitHub Repository: https://github.com/PersonalProj1008/HyeJack-Powershell⁠

⁠HyeJack-Powershell

⁠AI-Powered Agentic PowerShell Automation with Self-Healing

⁠What is HyeJack-Powershell?

HyeJack-Powershell is a containerized AI automation engine that transforms natural language requests into executable PowerShell workflows using xAI's Grok LLM. It features automatic error correction, persistent knowledge bases (RAG), and multi-tool integration.

Turn this: "Create a script that backs up my project folder and uploads to S3"

Into working PowerShell code automatically.


⁠Key Features

FeatureDescription
Natural Language → PowerShellDescribe tasks in plain English, get production-ready scripts
Self-HealingAutomatically retries failed steps up to 20 times, fixing only what broke
RAG Knowledge BaseUpload documents/code to a persistent collection; Jack references them intelligently
Topic IsolationSeparate conversations and knowledge bases per project
Tool IntegrationWeb search, X (Twitter) search, code interpreter, file search
Fully ContainerizedRuns in Docker with PostgreSQL for memory and PowerShell 7

⁠Quick Start

⁠Prerequisites
  • Docker & Docker Compose
  • xAI API key (Grok LLM)
  • Grok Management API key (for file operations)
⁠1. Pull & Run
docker compose up -d
docker compose exec pwsh-worker pwsh
⁠2. Configure Credentials (First Run Only)

Inside the container:

HyeJack-Powershell --CREDENTIALS
⁠3. Create a Topic & Start Using
HyeJack-Powershell --SIDEBAR
HyeJack-Powershell --HYE_JACK "Create a PowerShell script that lists all PDF files in current directory" --AVGCHATHISTORY

⁠API Key Requirements

⁠Grok LLM API Key
  • Standard xAI API key for Grok model access
  • Used for generating workflows and responses
⁠Grok Management API Key

Required permissions:

⁠File Permissions
PermissionRequired For
DownloadFileReading uploaded files
ListFilesBrowsing knowledge base
GetFileMetadataFile information
UploadFilesAdding documents to collection
RemoveFileFromCollectionDeleting files
AddFileToCollectionAttaching files to topics
UpdateFileModifying file content
UpdateDocumentFieldUpdating document metadata
⁠Collections Endpoint Group

⚠️ Must be enabled (Custom or Full access) for collection operations:

  • Create collection
  • List collections
  • Update collection (name, description)
  • Delete collection
  • Manage documents inside collections

⁠Supported File Types (RAG Knowledge Base)

Documents: .pdf, .doc, .docx, .txt, .md, .csv, .json, .xml, .yaml, .html, .htm, .rtf

Code: .py, .js, .ts, .tsx, .jsx, .cs, .go, .java, .kt, .rs, .swift, .php, .rb, .pl, .lua, .sql, .ps1, .sh

Not supported: Standalone images (.jpg, .png, .gif) — but images inside PDFs work.


⁠Customizing Jack's Behavior

Edit hyejack_powershell_configuration.toml to modify system prompts:

SYSTEM_PROMPT = '''
You are an AI assistant named Jack...
[Modify personality, tone, or specialization here]
'''

GROK_MODEL_NAME = "grok-4-1-fast-reasoning"  # Change model as needed

⚠️ Important: Keep the JSON output structure unchanged — the Python backend expects specific keys:

  • Agentic_Data → for workflows
  • Info_Data → for informational responses
  • step, use_env, steps_to_not_include within workflows

⁠Tool Flags

FlagFunction
--WEBSEARCHReal-time web search
--XSEARCHX (Twitter) search
--COMPUTATIONALABILITYCode interpreter
--COLLECTIONREFRAG from knowledge base
--FULLPOWERAll tools enabled
--RETRIVALCOUNT NChunks to retrieve (1-40)
⁠Chat History
FlagMessages sent
--MINCHATHISTORYLast 5
--AVGCHATHISTORYLast 10
--MAXCHATHISTORYLast 20

⁠Example Workflows

# Code generation
HyeJack-Powershell --HYE_JACK "Create a FastAPI endpoint with PostgreSQL connection" --AVGCHATHISTORY

# File analysis + research
HyeJack-Powershell --HYE_JACK "Review my Python project and suggest improvements based on best practices" --FULLPOWER --COLLECTIONREF

# Automation script
HyeJack-Powershell --HYE_JACK "Build a script that monitors disk space and emails alerts at 90% usage"

⁠How Self-Healing Works

  1. Generated PowerShell script executes
  2. On failure → error + context sent back to Grok
  3. Grok fixes only the failing step
  4. Workflow re-executes
  5. Repeats up to --TRYCOUNT (default: 20)

⁠Environment Variables

VariablePurpose
PG_HOSTPostgreSQL host
PG_USERDatabase user
PG_PASSWORDDatabase password
PG_DBDatabase name

⁠Volumes

VolumePurpose
pg_dataPostgreSQL persistence
pwsh_outputGenerated script output
pwsh_logsExecution logs

Tag summary

Content type

Image

Digest

sha256:4afe81464…

Size

314 MB

Last updated

6 months ago

docker pull arjunsenngupta1008/hyejack-powershell:worker-1.0