Skip to content

zulip-cli: Replace harcoded zuliprc path with the one used in zulip_bots/run.py #696

Open

Description

@rht

Originally posted by @andersk in #663 (comment)

This is the PR for zulip-cli: #663.
We want to replace the hardcoded zuliprc path (currently ~/zuliprc) to use something along the line of

def exit_gracefully_if_zulip_config_is_missing(config_file: Optional[str]) -> None:
. The mechanism in run.py needs to be abstracted out and provided by the core library.

Activity

  1. NaniToka commented on Nov 12, 2026

    @NaniToka

    Hi @andersk @rht, I have picked this up and opened PR #943 to resolve it.

    Summary of implementation:

    • Abstracted zulip_env_vars_are_present() and exit_gracefully_if_zulip_config_is_missing() into the core zulip library (zulip/__init__.py), and updated zulip_bots to reuse them.
    • Refactored zulip-cli to accept --config-file / -c (defaulting to standard ~/.zuliprc / env vars) and moved client instantiation to lazy evaluation so that --help works without requiring existing credentials.
    • Added comprehensive unit tests in zulip/tests/test_cli.py and zulip/tests/test_config.py.
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