Zulip supports integration with Perforce as a trigger that fires once a changelist is submitted and committed. To do this:

  1. Download and install our Python bindings on the server that hosts your Perforce depot. The Perforce trigger will be installed to a location like /usr/local/share/zulip/integrations/perforce
  2. Open integrations/perforce/zulip_perforce_config.py in your favorite editor, change the ZULIP_USER and ZULIP_API_KEY variables at the top of the file to the credentials for the bot you'd like to use for this integration.
  3. You should also change ZULIP_SITE to {{ external_api_path_subdomain }}
  4. Edit your trigger table with p4 triggers and add an entry something like the following:
    notify_zulip change-commit //depot/... "/usr/local/share/zulip/integrations/perforce/zulip_change-commit.py %change% %changeroot%"
  5. By default, this hook will send to streams of the form depot_subdirectory-commits. So, a changelist that modifies files in //depot/foo/bar/baz will result in a message to stream foo-commits. Messages about changelists that modify files in the depot root or files in multiple direct subdirectories of the depot root will be sent to depot-commits. If you'd prefer different behavior, such as all commits across your depot going to one stream, change it now in zulip_perforce_config.py. Make sure that everyone interested in getting these post-commit Zulips is subscribed to the relevant streams!

Congratulations! You're done!
When you commit to your Perforce depot the team can see updates in real time in Zulip: