Installation
Ghost is a Linux companion CLI, designed primarily for CachyOS and other Arch-based distributions. It requires Python 3.10 or newer.
Requirements
- Linux
- Python 3.10 or newer
- Git
- pip
Some system reports use optional tools such as lspci, smartctl, systemctl and pacman.
Clone the repository
git clone https://github.com/blawyxd/ghost.git
cd ghostCreate a virtual environment
python -m venv .venvBash / Zsh:
source .venv/bin/activateFish:
source .venv/bin/activate.fishInstall Ghost
python -m pip install -e .The editable install makes the ghost command available inside the active virtual environment while keeping it linked to your local source files.
Getting started
Run Ghost without arguments to open its home screen.
ghostDisplay the available commands:
ghost --help
ghost helpEvery command also has its own help output:
ghost COMMAND --helpFor example:
ghost hardware --help
ghost exercise --help
ghost serve --helpSystem diagnostics
These commands inspect your system and report information. They do not change system settings.
ghost doctorRun a general system health check and identify common problems.
ghost hardwareDisplay detailed hardware information, including available CPU, GPU, memory and storage details.
ghost processesView running processes and their resource usage.
ghost servicesInspect systemd services and their current states.
ghost networkInspect network interfaces and connectivity information.
ghost portsDisplay listening network ports.
ghost logsDisplay recent system journal entries.
ghost updatesCheck for available package updates using pacman. This does not install updates and is intended for Arch-based distributions.
Storage and maintenance
Inspect disk usage and identify files or dependencies that may need attention.
ghost diskShow filesystem capacity, used space, available space and usage percentages.
ghost largeSearch your home directory for large files. The scan is limited to avoid an unbounded search. It does not delete anything.
ghost cacheInspect the size and usage of your user cache.
ghost tempInspect temporary storage without deleting anything.
ghost orphansIdentify unneeded pacman dependencies. Ghost reports them but does not remove them.
ghost cleanPreview the contents and estimated size of your user cache, then ask for confirmation before removing entries. Applications may need to rebuild their caches.
Backups and security
ghost backupCreate a local archive of configuration files from ~/.config.
ghost backupsList locally stored configuration backups.
ghost restore-backup ARCHIVE_NAMERestore missing configuration files from a selected archive. Ghost previews the changes and does not overwrite files that already exist.
ghost securityRun basic security checks and report potential issues.
Configuration backups can contain private settings, credentials or tokens. Keep them somewhere secure.
Developer tools
Ghost includes utilities for inspecting and working with software projects.
ghost devDetect installed development tools.
ghost git [ACTION]Inspect a Git repository. Supported actions include status, diff, log, branches and remotes. The default action is status.
ghost git
ghost git diff
ghost git branchesghost project [DIRECTORY]Inspect a project, detect its type, find its virtual environment and examine its directory structure.
ghost project-deps [DIRECTORY]List dependencies declared by a Python project.
ghost envInspect the active Python environment.
ghost depsList installed Python dependencies.
ghost varsCheck whether selected environment variables are present without displaying their values.
ghost install-deps [DIRECTORY]Review the dependencies declared by a detected project and ask for confirmation before installing them.
ghost test [DIRECTORY]Detect and run a project's test suite.
ghost build [DIRECTORY]Build supported Python, Node.js or Rust projects.
ghost serve [DIRECTORY]Start a supported static, Django or npm development server in the foreground. Options include --host, --port and --script.
ghost serve
ghost serve --host 127.0.0.1 --port 8000Project tests, builds and development servers execute project tools or code. Only run them in projects you trust.
Python learning
Ghost includes a structured Python course with 24 lessons, progressing from programming fundamentals to more advanced application design.
Course topics
- Beginner: variables, values, operators, input, conditions, loops and functions.
- Intermediate: collections, strings, exceptions, files, modules, classes, generators, type hints, packages, APIs and testing.
- Advanced: decorators, context managers, architecture, design patterns, optimisation and building applications.
Lessons contain explanations, runnable examples, walkthroughs, common mistakes, recaps and links to related exercises.
Browse the course
ghost learn
ghost learn LESSON_IDYou can select a lesson by its number or ID. Use next to continue from the next incomplete lesson.
The current course teaches Python. Other programming languages are not currently supported by the curriculum.
Exercises and hints
Exercises let you apply what you learn. Each exercise includes instructions, starter code, automated test cases, progressive hints and a solution.
Browse exercises
ghost exercisesOpen an exercise
ghost exercise EXERCISE_IDSubmit a source file
ghost exercise EXERCISE_ID --file answer.pyGet a hint
ghost exercise EXERCISE_ID --hint 1View the solution
ghost exercise EXERCISE_ID --solutionExercises use different test modes: function-based submissions, complete scripts and HTTP exercises with mocked responses. HTTP exercises do not contact a live API.
Important: submitted code runs in a separate timed Python process and temporary working directory. This is not a security sandbox. It can still access your files, network and other system resources. Only run code you trust.
Learning projects
Ghost includes eight progressive Python projects that turn course concepts into larger pieces of software.
Browse projects
ghost projectsOpen a project
ghost projects PROJECT_IDComplete a milestone
ghost projects PROJECT_ID --complete-milestone 1Milestones must be completed in order. You cannot skip ahead.
Review a project directory
ghost projects PROJECT_ID --review ./my-projectThe project reviewer performs read-only structural checks. It can check for Python source files, tests, syntax errors and certain project files. It does not execute your project, run its tests or prove that the application works correctly. Review the acceptance criteria and run your own tests as well.
Game Mode
Learning progression is optional. You can use the entire course without enabling gamification.
Enable Game Mode
ghost learning onDisable Game Mode
ghost learning offCheck its status
ghost learning statusWhen enabled, you can earn XP, gain levels, build streaks and unlock achievements. XP is earned through learning activities such as completing lessons, exercises and project milestones.
Disabling Game Mode does not delete your saved progress. Your lessons, exercises and projects remain usable without it.
View your progress
ghost progressOther learning references
ghost glossary
ghost cheatsheetUse the glossary for programming terminology and the cheatsheet for a quick Python reference.
Safety and permissions
Ghost is designed to make system inspection straightforward without silently changing your machine.
- System reports are read-only.
- Cache cleanup previews the operation and asks for confirmation.
- Configuration restoration previews changes and skips existing files.
- Dependency installation requires confirmation.
- Ghost does not install system packages.
- Project commands and exercise submissions may execute code.
Some reports depend on optional system tools or permissions. Ghost reports when a tool or permission is unavailable rather than assuming it can access everything.
Never treat the exercise runner as a sandbox. Do not submit untrusted code.
Additional commands
ghost vaultDisplay saved useful Linux commands. They are shown as text and are not executed automatically.
ghost helpDisplay the command overview.
ghost ship is a maintainer-only publishing command. It is not part of the normal user workflow.
Running tests
From the repository root, activate your virtual environment and run:
python -m unittest discover -s tests -v
python -m compileall -q main.py ghost testsThese commands run the Python test suite and check the source files for compilation errors.