An AI-powered troubleshooting assistant for DevOps that integrates with TinyLlama to help analyze and troubleshoot various project files, Docker containers, Kubernetes clusters, and CI/CD pipelines.
- File indexing and semantic search
- AI-powered file analysis
- Docker container analysis and management
- Kubernetes cluster analysis
- CI/CD pipeline integration (GitHub Actions, GitLab CI, Jenkins)
- Real-time file and command monitoring
- Custom prompt templates
- Export functionality
- Remote Docker host support
- New: Secure filesystem operations for LLMs via TinyFS
pip install ghostforge-aiOr install from source:
git clone https://github.com/dmaynor/ghostforge.git
cd ghostforge
pip install -e .GhostForge now includes a setup script that configures your environment and downloads the required model:
# Set up the virtual environment and direnv for automatic activation
./setup_venv.sh
# Download the TinyLlama model
python tinyfs_auto_download_simple.py- Start the GhostForge shell:
ghostforge- Index your project files:
ghostforge> index- Analyze files:
ghostforge> analyze logs/error.log- Search indexed files:
ghostforge> search error --type=log- Use the new TinyFS file operations:
ghostforge> fs list
ghostforge> fs read config.jsonGhostForge uses several configuration files stored in the ~/.ghostforge directory:
config.yaml: General configurationci.yaml: CI/CD provider settingskubernetes.yaml: Kubernetes cluster settingsdocker.yaml: Docker host settings
Example configuration:
# ~/.ghostforge/config.yaml
model:
path: ~/.ghostforge/models/tinyllama-1.1b-chat.Q4_K_M.gguf
context_size: 2048
gpu_layers: 0
threads: 4
f16_kv: true
# ~/.ghostforge/docker.yaml
docker_hosts:
prod:
enabled: true
url: tcp://prod-server:2375
tls: true
staging:
enabled: true
use_ssh: true
hostname: staging-server
username: docker
key_file: ~/.ssh/docker_keyBelow is a comprehensive list of commands available in the GhostForge shell:
index [directory]: Index project files for searching and analysissearch <query> [--type=filetype]: Search indexed files using keywordsanalyze <file> [--prompt=template]: Analyze files using TinyLlama
fs read <path>: Read and display the contents of a filefs write <path> <content>: Write content to a filefs list [path]: List contents of a directory (defaults to current directory)fs mkdir <path>: Create a new directoryfs delete <path>: Delete a filefs copy <source> <destination>: Copy a file to a new locationfs move <source> <destination>: Move a file to a new locationfs exists <path>: Check if a file or directory existsfs info <path>: Display information about a file or directory
docker list-images: List available Docker imagesdocker list-containers: List running Docker containersdocker analyze-image <image>: Analyze a Docker imagedocker analyze-container <container>: Analyze a running containerdocker analyze-dockerfile <path>: Analyze a Dockerfile
kubernetes analyze-manifests <directory>: Analyze Kubernetes manifest fileskubernetes analyze-cluster: Analyze the current Kubernetes clusterkubernetes list-resources: List resources in the current cluster
cicd analyze <directory>: Analyze CI/CD configuration files
watch <file|command>: Watch a file or command output in real-timeunwatch <id>: Stop watching a file or commandwatches: List active watches
config get <key>: View a configuration valueconfig set <key> <value>: Set a configuration valueconfig list: List all configuration valuesprompt list: List available prompt templatesprompt show <name>: Show a specific prompt templateprompt create <name>: Create a new prompt templatemodel info: Show information about the current modelmodel load <path>: Load a different model
help: Display help information and available commandshistory: View or search command historyexitorquit: Exit the GhostForge shellhello: Test command to verify the shell is working
When you run the help command in the GhostForge shell, you'll see output similar to this:
Welcome to GhostForge Shell. Type help or ? to list commands.
Documented commands (type help <topic>):
File Operations:
analyze index search fs
Docker Commands:
docker
Kubernetes Commands:
kubernetes k8s
CI/CD Commands:
cicd
Watch Commands:
watch unwatch watches
Configuration:
config model prompts
Shell Commands:
help exit quit hello
Type help <command> for detailed information on a specific command.
For example: help analyze
GhostForge is organized around several key components:
The command-line interface is powered by the Python cmd module, with command implementations in:
ghostforge/shell.py: Core shell implementation with command categories and completionsghostforge/commands.py: Individual command implementations
The indexing system scans your codebase and stores content for quick retrieval:
ghostforge> indexThe indexer will scan your project files and gracefully handle binary files by skipping them with a message:
[GhostForge]: ./.git/index will not be indexed.
[GhostForge]: ./binary-file.png will not be indexed.
Create custom analysis prompts in YAML format:
# prompts/custom_analysis.yaml
description: Custom analysis template
template: |
Analyze this content and provide insights:
{{ content }}
Please provide:
1. Summary
2. Key findings
3. Recommendations- Set up development environment:
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"- Run tests:
pytest- Format code:
black ghostforge- Run linter:
pylint ghostforge-
Indexing errors with binary files: These are expected and won't affect GhostForge's functionality. Binary files are automatically skipped during indexing.
-
Help command exits the shell: If you encounter this issue, make sure your installation includes the latest fixes that properly implement the command categories and prompt commands.
-
Docker/Kubernetes analysis errors: Ensure you have the proper permissions to access container and cluster information.
-
Model loading errors: If you encounter errors loading the model, run the
tinyfs_auto_download_simple.pyscript to download the required model. -
Environment setup issues: Use the
setup_venv.shscript to create a properly configured virtual environment. For automatic environment activation, install direnv and rundirenv allowin the project directory.
MIT License
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
For issues and feature requests, please use the GitHub issue tracker.