Skip to content

Command Line Interface

We provide a command line interface to interact with the Gallagher Command Centre. It uses the API client to communicate with the server, which doubly serves as a reference example of how to use the API client.

We use typer to construct the CLI, which in turn uses click. We also use rich to make the output nicer. The CLI is decoupled from the API client, and is not install by default.

We follow a git like command, sub-command pattern, so it should feel quite familiar.

poetry will install the alias gal for you to interact with the CLI. You can ask for help with:

app

gala is a command line interface for the gallagher security command centre.

It works by accessing and mutating objects on the command centre via it's

JSON API, directly or via the cloud gateway.

It's intent it to make available scriptable endpoints to ease automation.

Usage:

 [OPTIONS] COMMAND [ARGS]...

Options:

  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or
                        customize the installation.

ag

Query access groups on the command centre

Usage:

 ag [OPTIONS] COMMAND [ARGS]...

alarm

List, query, follow, act on alarms in the command centre

Usage:

 alarm [OPTIONS] COMMAND [ARGS]...

ack

Acknowledge alarms, optionally with a comment

Acknowledge one or more alarms, optionally with a comment

use this to bulk process alarms, handy for automation.

Usage:

 alarm ack [OPTIONS] IDS...

Options:

  IDS...              alarm id  [required]
  -m, --message TEXT  comment to add to history
  -y, --yes           acknowledge without confirmation

comment

Comment on an alarm

Leave a comment on a particular alarm, note that

this does not mark the alarm as acknowledged or processed

Usage:

 alarm comment [OPTIONS] ID

Options:

  ID                  alarm id  [required]
  -m, --message TEXT  comment to add to history  [required]

get

Get details of an alarm by ID

Fetches details of am alarm by the identifier and presents

the hrefs as clickable links.

Usage:

 alarm get [OPTIONS] ID

Options:

  ID      alarm id  [required]

history

Show history of an alarm

Usage:

 alarm history [OPTIONS] ID

Options:

  ID      alarm id  [required]

list

Lists current alarms

Provides a summary of alarms in the system, colour coded by severity,

use this to get an overview of your current alarms and use their IDs

in subsequent operations

Usage:

 alarm list [OPTIONS]

process

Mark one or more alarms as processed, optionally with a comment

Use this to mark an alarm as processed, this is useful when you

want to keep track of alarms that have been actioned by the team.

Usage:

 alarm process [OPTIONS] IDS...

Options:

  IDS...              alarm id  [required]
  -m, --message TEXT  comment to add to history
  -y, --yes           acknowledge without confirmation

tail

Watch for alarm updates

Keeps following an alarm for updates with you having to

Usage:

 alarm tail [OPTIONS]

view

Mark one or more alarm as viewed, optionally with a comment

Use this to mark an alarm as viewed, this is useful when you

want to keep track of alarms that have been seen by the team.

Usage:

 alarm view [OPTIONS] ID

Options:

  ID                  alarm id  [required]
  -m, --message TEXT  comment to add to history

az

Query access zones on the command centre

Usage:

 az [OPTIONS] COMMAND [ARGS]...

ch

List, query or manage or watch changes to cardholders

Usage:

 ch [OPTIONS] COMMAND [ARGS]...

find

find cardholders by name

Usage:

 ch find [OPTIONS] NAME

Options:

  NAME                        First or last name to search for  [required]
  --sort [id|-id|name|-name]  Sort order  [default: name]
  --desc TEXT                 Keywords to search in description
  --top INTEGER               Results to fetch from top  [default: 100]
  --div INTEGER               Division id for hierarchical search
  --ddiv INTEGER              Division id for direct search

get

get a cardholder by id

Usage:

 ch get [OPTIONS] ID

Options:

  ID      cardholder id  [required]

list

list all cardholders

Usage:

 ch list [OPTIONS]

comp

Events can queried

Usage:

 comp [OPTIONS] COMMAND [ARGS]...

day

Query or modify items on the command centre

Usage:

 day [OPTIONS] COMMAND [ARGS]...

div

query or modify divisions

Usage:

 div [OPTIONS] COMMAND [ARGS]...

get

get a division by id

Usage:

 div get [OPTIONS] ID

Options:

  ID      [required]

list

list all divisions

Usage:

 div list [OPTIONS]

door

Door category

Usage:

 door [OPTIONS] COMMAND [ARGS]...

elevator

Query or modify elevator group

Usage:

 elevator [OPTIONS] COMMAND [ARGS]...

event

Events can queried

Usage:

 event [OPTIONS] COMMAND [ARGS]...

fence

Query fence zone

Usage:

 fence [OPTIONS] COMMAND [ARGS]...

ilock

Interlock

Usage:

 ilock [OPTIONS] COMMAND [ARGS]...

item

Query or modify items on the command centre

Usage:

 item [OPTIONS] COMMAND [ARGS]...

locker

Events can queried

Usage:

 locker [OPTIONS] COMMAND [ARGS]...

macro

Macro search, summary

Usage:

 macro [OPTIONS] COMMAND [ARGS]...

output

Output

Usage:

 output [OPTIONS] COMMAND [ARGS]...

pdf

Query personal data definitions

Usage:

 pdf [OPTIONS] COMMAND [ARGS]...

reception

Receptions

Usage:

 reception [OPTIONS] COMMAND [ARGS]...

redaction

Redactions can queried

Usage:

 redaction [OPTIONS] COMMAND [ARGS]...

roles

Roles

Usage:

 roles [OPTIONS] COMMAND [ARGS]...

schedule

Schedule

Usage:

 schedule [OPTIONS] COMMAND [ARGS]...

visits

Visits

Usage:

 visits [OPTIONS] COMMAND [ARGS]...

Resources