Local AI Assistant on Your Machine: Install, Configure, and Fully Uninstall

    A practical lifecycle guide to running a personal AI assistant locally: how the CLI, background gateway, and hidden data directories fit together; how to install, configure, and operate them; and how to stop services, remove binaries, and wipe configs, keys, and caches so nothing is left behind.

    Local AI Assistant on Your Machine: Install, Configure, and Fully Uninstall

    Running a personal AI assistant locally means hosting a combination of a command-line tool, a long-running background gateway, and hidden configuration and data. Many guides cover install only and skip a clean removal, so leftover API keys, databases, and background services keep using resources and can become a security risk. This article follows the full lifecycle—prepare, install, configure, operate, uninstall—and focuses on the three cleanup surfaces required for a complete uninstall.

    1. Before you deploy

    Understand the layout

    A typical local assistant has three parts:

    • CLI: the user-facing entry point that parses commands and calls the model
    • Gateway daemon: a background process for session state, task scheduling, and connections to external services
    • Hidden directories: API keys, config files, databases, and workspace caches

    Install usually only places the first two. Sensitive data lives in the third, which is what people most often forget to delete.

    Check network access

    Install needs access to package sources and model services. Confirm connectivity:

    1. # HTTP 200 or 302 means the host is reachable
    2. curl -I https://<software-source-or-dependency-repo>

    On timeout or connection reset, use a proxy or an internal mirror. After install, tighten network policy so runtime traffic only reaches required model endpoints and the attack surface stays small.

    Runtime and package manager

    These assistants usually depend on a JavaScript runtime. Prefer a current long-term support (LTS) release, not an end-of-life version:

    1. <runtime> -v
    2. <package-manager> -v

    If either is missing, install it through a supported channel. A version manager makes later upgrades and rollbacks easier.

    Directories and secrets

    • Install the CLI globally so you can run it from any directory.
    • For source installs, keep a fixed path such as ~/services/<project> so cleanup is obvious later.
    • Do not put API keys in files that might be committed. Prefer environment variables or the OS secret store. Restrict the config directory to the current user only (for example chmod 700).

    2. Two install methods

    Global install via the package manager (easiest for beginners)

    1. <package-manager> install -g <cli-package-name>

    Verify:

    1. <cli> --version
    2. <cli> gateway status

    Paths are consistent and uninstall is simple; version updates depend on the registry.

    Source install (customization or development builds)

    1. # 1. Get the source and enter the directory
    2. cd ~/services/<project>
    3. # 2. Install dependencies
    4. <package-manager> install
    5. # 3. Build if the project requires it
    6. <package-manager> run build

    Record the clone URL and directory so you do not leave the whole tree behind at uninstall.

    Post-install checklist

    • Version command prints successfully
    • Gateway status command reports the current service state
    • First-run setup can locate where config files are created

    3. Initial configuration and start

    Core settings

    First run usually opens an interactive wizard or writes a config file. Confirm:

    • Model endpoint and API key: note where the key is stored so you can remove it later
    • Listen address: bind to 127.0.0.1 for a personal assistant; do not expose it on the LAN unless you have a clear security boundary
    • Timeouts and retries: reduce crash loops when upstream services flap
    • Tool/plugin allowlist: enable only tools you actually need

    Start the gateway

    1. <cli> gateway start

    It stays in the background. Check the listen port and health:

    1. curl -s http://127.0.0.1:<port>/health

    Start on login

    If you want it available after reboot, register the gateway as a user-level system service. Many CLIs provide:

    1. <cli> gateway install # register as a login-time service

    The service manager then starts and restarts the process. Keep it user-level for the logged-in session; do not run it as a privileged system-wide service.

    4. Day-to-day operations

    • Logs: use <cli> gateway logs or the log directory. If request bodies appear in logs, redact them and rotate files.
    • Upgrades: stop the gateway, update the package or pull new source, rebuild if needed, then start again. Back up the config directory first.
    • Key rotation: refresh model API keys on a schedule and update local config.
    • Resources: watch memory and CPU of the resident process. Long-context sessions can use a lot of RAM; restart the gateway if needed.
    • Backups: chat history and state databases live in hidden directories. To move machines, back up that directory and reinstall the CLI.

    5. Complete uninstall (critical)

    A full removal must cover running background services, program files (CLI/libraries), and hidden config and data. Skipping any layer leaves residue.

    Stop and unregister the background service

    If the daemon is still running, files may be locked and the service may restart after you delete binaries:

    1. <cli> gateway stop
    2. <cli> gateway uninstall

    Older installs may have used a different name; run the matching uninstall command. If that fails, stop and remove the unit with the OS service manager.

    Remove program files

    Package-manager install:

    1. <package-manager> remove -g <cli-package-name>

    Source install—delete the whole tree only after you confirm the path:

    1. rm -rf ~/services/<project>

    Clean hidden config, data, and caches (easy to miss)

    This layer holds API keys, state databases, and workspace caches:

    1. # Remove config and state databases (replace with actual names)
    2. rm -rf ~/.<assistant-config-dir>
    3. rm -rf ~/.<legacy-config-dir-1>
    4. rm -rf ~/.<legacy-config-dir-2>
    5. # Remove workspace cache if present
    6. rm -rf ~/<workspace-cache-dir>

    Notes:

    • Back these directories up first if you need session history.
    • If they contain API keys, revoke the keys in the model provider console so leaked secrets cannot be reused.
    • Legacy config directory names may differ. Inspect with ls -la ~ | grep "^\." and remove project-related hidden dirs.

    Check leftover services

    If uninstall did not clear everything, inspect user-level service definitions:

    1. List related unit files:
    1. ls <user-level-service-directory> | grep -i "<service-keyword>"
    1. Unload, then delete leftovers:
    1. <service-manager> unload <user-level-service-directory>/<service-name>.plist
    2. rm <user-level-service-directory>/<service-name>.plist

    Final verification

    Confirm the CLI is gone:

    1. which <cli>

    Empty output (or “not found”) plus no hits on the following means a clean uninstall:

    1. # no leftover process
    2. ps aux | grep -i "<gateway-keyword>" | grep -v grep
    3. # no leftover directories
    4. ls -la ~ | grep "<assistant-keyword>"

    6. FAQ

    Q: Permission denied when stopping the service?
    User-level services usually do not need admin rights. If you see a permission error, the unit may have been installed system-wide; uninstall it with the matching privileged path.

    Q: A process is still running after uninstall?
    A service definition is still loaded and the manager is restarting it. Find and delete that unit as in section 5.4.

    Q: Disk use barely dropped?
    Hidden databases or caches were probably left behind. Model caches and session DBs can be several GB and must be removed by hand.

    Q: Config disappeared after reinstall?
    Config and data live in hidden directories; reinstalling the CLI does not restore them. Back up that directory before migrate or reinstall.

    Closing

    A local personal assistant is valuable for data control and low latency. The engineering difference is reversibility: documented install, backed-up config, and no leftovers. Follow the layers—stop the service, remove programs, then wipe hidden data—and verify a clean environment so you can deploy and remove the stack safely on a personal machine.