Overview

appendix A  Command reference

This appendix serves as a quick command cheat sheet for the practical work in the book, collecting the terminal, package-management, model, Python, web-app, and Git commands used throughout the projects. It is designed for fast lookup while building and troubleshooting local AI applications on a Mac.

The command reference begins with core shell tools for navigating the filesystem, creating and removing files and folders, inspecting file contents, searching text, and checking system state. It also includes common keyboard shortcuts that speed up terminal work, such as interrupting commands, clearing the screen, recalling history, and using tab completion.

From there, the appendix groups together the most important workflows for the book’s stack: Homebrew for installing and managing software, Ollama for pulling, running, configuring, and serving local models, Python and pip for virtual environments and package handling, Streamlit for launching and tuning web apps, and Git for version control. It closes with guidance for keeping generated and sensitive files out of source control so local model projects stay clean and reproducible.

A.8 Quick reference card

These are the most frequently used commands from this book, in the order in which you will typically use them:

FAQ

What command shows my current directory in the terminal?

Use pwd to print the current working directory. It tells you exactly where you are in the filesystem.

How do I list files, including hidden ones, with detailed information?

Use ls -la. It shows all files, including hidden files, along with permissions and other details.

What is the safest way to create nested folders for a project?

Use mkdir -p, for example mkdir -p src/components/ui. The -p flag creates any missing intermediate folders automatically.

How do I delete a folder and everything inside it?

Use rm -r to remove a directory recursively, such as rm -r old_folder/. Be careful, because it permanently deletes the folder and its contents.

What command searches for text inside files, and how can I search recursively?

Use grep to search file contents, such as grep "import" app.py. To search all files inside a directory, use grep -r "TODO" src/.

How do I check whether Ollama is running and see the models it has loaded?

Use ollama ps to show running models. You can also check the Ollama server with http://localhost:11434/, which returns a health check message when Ollama is running.

How do I install Ollama with Homebrew on macOS?

Use brew install ollama. Homebrew is the package manager used in the book for installing developer tools on macOS.

How do I create and activate a Python virtual environment?

Create it with python3.13 -m venv .venv, then activate it on macOS/Linux with source .venv/bin/activate. When you are done, run deactivate to exit the environment.

How do I launch a Streamlit app on a custom port?

Use streamlit run app.py --server.port 8080 to start the app on a specific port. You can also use --server.address 0.0.0.0 if you want it to bind to all interfaces.

How do I keep local AI project files out of Git?

Add common generated or sensitive files to .gitignore, such as .venv/, .env, models/, and *.gguf. This prevents virtual environments, secrets, and downloaded models from being tracked by Git.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Build Applications with Local AI Models on a Mac ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Build Applications with Local AI Models on a Mac ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Build Applications with Local AI Models on a Mac ebook for free