Skip to content

Host integration: choose the CLI settings file with an environment variable (ZCODE_CLI_SETTINGS_FILE) #198

Closed

Description

@glmn

Problem

A host that runs several zcode processes side by side (one per terminal pane or agent card) needs to give each process its own hooks, MCP servers and tool permissions without editing the user's ~/.zcode/cli/setting.json. The other per-user files already have overrides — ZCODE_SESSION_DB_PATH, ZCODE_PERSONAL_PROVIDER_CONFIG_FILE, ZCODE_CLI_CREDENTIALS_FILE — but the settings file is always resolved from the home directory (loadFileConfig / the settings path getter in the runtime, cliSettingsPath() in the launcher), so the only options today are to rewrite the user's file or to redirect fs calls with a --require preload.

Proposal

A ZCODE_CLI_SETTINGS_FILE environment variable, documented in docs/HOST_INTEGRATION.md:

  • when set, the launcher and the runtime read and write that file instead of ~/.zcode/cli/setting.json;
  • explicit paths and project config files (zcode.json, .zcode/config.json) behave as before;
  • Desktop settings are still read from the home directory; the settings migration marker lives next to the chosen file.

It follows the existing ZCODE_CLI_CREDENTIALS_FILE runtime patch. I have an implementation with tests and will open a PR that references this issue — happy to change the name or shape if you prefer something else.

Context

We run zcode as one of the agents in NeuroSquad (a desktop app that hosts several agent CLIs side by side), where each card currently gets its settings through a preload that redirects the settings path; this variable would make that unnecessary.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions