Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Latest commit

 

History

History

catalog

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Example catalog

To get started:

  1. Clone this repo.
  2. Open a shell session.
  3. cd into the examples/catalog directory.
  4. Try any of the example jac query commands below.

Groups in this example

With jac, groups are the primary way to organize people. They can be used to model different concepts such as departments, streams, teams, roles, etc. It's really up to you how you want to use them depending on your organization's needs. Groups do not have to be mutually exclusive, for example a person can belong to multiple teams, streams, and roles.

It defines groups of different types: role, team and stream, but feel free to model your own organization's structure via group types that have meaning to you. You can use groups to represent any set of people, such as a department, a project, a team, etc.

Here stream groups are used to represent different "value streams" (or products) and are a superset of team groups, which are used to represent different teams working on those value streams. role groups are used to represent different roles that people can have, such as backend, frontend, devops, etc.

Group parenting

The team groups are parented to specific stream groups, which means that all people belonging to a team group automatically also belong to the stream group it is parented to. For example, all people belonging to team-incredibles automatically belong to stream-development.

Group name prefixing

Group names have been prefixed with the type of group they are, for example team- for team groups, role- for role groups, etc. This is not required, but it can be useful to make it easier to identify the type of group when looking at the list of groups. It also prevents name collisions between groups of different types (eg: there's a role-devops, a team-devops and a stream-devops).

Example people commands

List all people

$ jac people
$ jac people
  NAME              FIRST NAME  LAST NAME   EMAIL                 GROUPS                          INHERITED GROUPS
  alice-wonderland  Alice       Wonderland  alice@example.com     Manager Support Specialist
                                                                  Tech Support
  buzz-lightyear    Buzz        Lightyear   buzz@example.com      Frontend Developer              Development
                                                                  Incredibles Team
  dash-parr         Dash        Parr        dash@example.com      DevOps Incredibles Team         Development
  elsa              Elsa                    elsa@example.com      Backend Developer Fairies Team  Development

  helen-parr        Helen       Parr        helen@example.com     Manager Incredibles Team        Development
  jack-sparrow      Jack        Sparrow     jack@example.com      DevOps Dragons Team             Tech Support
  maui              Maui                    maui@example.com      Backend Developer Moana's Team  Marketing

  mickey-mouse      Mickey      Mouse       mickey@example.com    Frontend Developer              Tech Support
                                                                  Unicorns Team
  moana             Moana                   moana@example.com     Support Specialist              Marketing
                                                                  Moana's Team
  peter-pan         Peter       Pan         peter@example.com     Backend Developer Dragons Team  Tech Support

  pua               Pua                     pua@example.com       Frontend Developer              Marketing
                                                                  Moana's Team
  rapunzel          Rapunzel                rapunzel@example.com  Manager Support Specialist
                                                                  Development
  tinker-bell       Tinker      Bell        tinker@example.com    DevOps Fairies Team             Development
  violet-parr       Violet      Parr        violet@example.com    Frontend Developer              Development
                                                                  Incredibles Team
  woody             Woody                   woody@example.com     Manager Incredibles Team        Development
 ———
 Count: 15

List specific people

$ jac people elsa,rapunzel
$ jac people elsa,rapunzel
  NAME      FIRST NAME  LAST NAME  EMAIL                 GROUPS                          INHERITED GROUPS
  elsa      Elsa                   elsa@example.com      Backend Developer Fairies Team  Development

  rapunzel  Rapunzel               rapunzel@example.com  Manager Support Specialist
                                                         Development
 ———
 Count: 2

Find people with free-text search

$ jac people -f alice

Use --find or -f to find people with free-text search in their first or last name, email or name identifier:

$ jac people -f alice
  NAME              FIRST NAME  LAST NAME   EMAIL              GROUPS                          INHERITED GROUPS
  alice-wonderland  Alice       Wonderland  alice@example.com  Manager Support Specialist
                                                               Tech Support
 ———
 Count: 1

List people belonging to any of given groups

$ jac people -g team-incredibles,role-frontend

Use --group or -g to filter by group:

$ jac people -g team-incredibles,role-frontend
  NAME            FIRST NAME  LAST NAME  EMAIL               GROUPS                          INHERITED GROUPS
  buzz-lightyear  Buzz        Lightyear  buzz@example.com    Frontend Developer              Development
                                                             Incredibles Team
  dash-parr       Dash        Parr       dash@example.com    DevOps Incredibles Team         Development
  helen-parr      Helen       Parr       helen@example.com   Manager Incredibles Team        Development
  mickey-mouse    Mickey      Mouse      mickey@example.com  Frontend Developer              Tech Support
                                                             Unicorns Team
  pua             Pua                    pua@example.com     Frontend Developer              Marketing
                                                             Moana's Team
  violet-parr     Violet      Parr       violet@example.com  Frontend Developer              Development
                                                             Incredibles Team
  woody           Woody                  woody@example.com   Manager Incredibles Team        Development
 ———
 Count: 7

List people, hiding group columns

$ jac people -G

Use --hide-groups or -G to hide group columns (eg: if your terminal is too narrow):

$ jac people -G
  NAME              FIRST NAME  LAST NAME   EMAIL
  alice-wonderland  Alice       Wonderland  alice@example.com
  buzz-lightyear    Buzz        Lightyear   buzz@example.com
  dash-parr         Dash        Parr        dash@example.com
  elsa              Elsa                    elsa@example.com
  helen-parr        Helen       Parr        helen@example.com
  jack-sparrow      Jack        Sparrow     jack@example.com
  maui              Maui                    maui@example.com
  mickey-mouse      Mickey      Mouse       mickey@example.com
  moana             Moana                   moana@example.com
  peter-pan         Peter       Pan         peter@example.com
  pua               Pua                     pua@example.com
  rapunzel          Rapunzel                rapunzel@example.com
  tinker-bell       Tinker      Bell        tinker@example.com
  violet-parr       Violet      Parr        violet@example.com
  woody             Woody                   woody@example.com
 ———
 Count: 15

List people, displaying names

$ jac people -N Use `--show-names` or `-N` to display identifier names instead of full names:
$ jac people -N
  NAME              FIRST NAME  LAST NAME   EMAIL                 GROUPS                          INHERITED GROUPS
  alice-wonderland  Alice       Wonderland  alice@example.com     role-manager role-support
                                                                  stream-tech-support
  buzz-lightyear    Buzz        Lightyear   buzz@example.com      role-frontend team-incredibles  stream-development

  dash-parr         Dash        Parr        dash@example.com      role-devops team-incredibles    stream-development
  elsa              Elsa                    elsa@example.com      role-backend team-fairies       stream-development
  helen-parr        Helen       Parr        helen@example.com     role-manager team-incredibles   stream-development
  jack-sparrow      Jack        Sparrow     jack@example.com      role-devops team-dragons        stream-tech-support
  maui              Maui                    maui@example.com      role-backend team-moana         stream-marketing
  mickey-mouse      Mickey      Mouse       mickey@example.com    role-frontend team-unicorns     stream-tech-support
  moana             Moana                   moana@example.com     role-support team-moana         stream-marketing
  peter-pan         Peter       Pan         peter@example.com     role-backend team-dragons       stream-tech-support
  pua               Pua                     pua@example.com       role-frontend team-moana        stream-marketing
  rapunzel          Rapunzel                rapunzel@example.com  role-manager role-support
                                                                  stream-development
  tinker-bell       Tinker      Bell        tinker@example.com    role-devops team-fairies        stream-development
  violet-parr       Violet      Parr        violet@example.com    role-frontend team-incredibles  stream-development

  woody             Woody                   woody@example.com     role-manager team-incredibles   stream-development
 ———
 Count: 15

Output results as YAML

$ jac people -y Use `--yaml` or `-y` to output results as YAML instead of the default table format:
$ jac people -y
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: alice-wonderland
spec:
  firstName: Alice
  lastName: Wonderland
  email: alice@example.com
  groups:
    - role-support
    - role-manager
    - stream-tech-support
  parent: jack-sparrow
  values:
    githubUser: alicewonderland
---
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: buzz-lightyear
spec:
  firstName: Buzz
  lastName: Lightyear
  email: buzz@example.com
  groups:
    - role-frontend
    - team-incredibles
  parent: alice-wonderland
  values:
    githubUser: buzzlightyear
---
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: dash-parr
spec:
  firstName: Dash
  lastName: Parr
  email: dash@example.com
  groups:
    - role-devops
    - team-incredibles
  values:
    githubUser: dashparr
---
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: elsa
spec:
  firstName: Elsa
  lastName: null
  email: elsa@example.com
  groups:
    - role-backend
    - team-fairies
  values:
    githubUser: elsa
---
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: helen-parr
spec:
  firstName: Helen
  lastName: Parr
  email: helen@example.com
  groups:
    - role-manager
    - team-incredibles
  values:
    githubUser: helenparr
---
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: jack-sparrow
spec:
  firstName: Jack
  lastName: Sparrow
  email: jack@example.com
    groups:                                                                                                                                                                                                                                                                                                                                                         [55/998]
    - role-devops
    - team-dragons
  values:
    githubUser: jacksparrow
---
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: maui
spec:
  firstName: Maui
  lastName: null
  email: maui@example.com
  groups:
    - role-backend
    - team-moana
  values:
    githubUser: maui
---
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: mickey-mouse
spec:
  firstName: Mickey
  lastName: Mouse
  email: mickey@example.com
  groups:
    - role-frontend
    - team-unicorns
  values:
    githubUser: mickeymouse
---
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: moana
spec:
  firstName: Moana
  lastName: null
  email: moana@example.com
  groups:
    - role-support
    - team-moana
  values:
    githubUser: moana
---
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: peter-pan
spec:
  firstName: Peter
  lastName: Pan
  email: peter@example.com
  groups:
    - role-backend
    - team-dragons
  values:
    githubUser: peterpan
---
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: pua
spec:
  firstName: Pua
  lastName: null
  email: pua@example.com
  groups:
    - role-frontend
    - team-moana
  values:
    githubUser: pua
---
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: rapunzel
spec:
  firstName: Rapunzel
  lastName: null
  email: rapunzel@example.com
  groups:
    - role-support
    - role-manager
    - stream-development
  parent: elsa
  values:
    githubUser: rapunzel
---
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: tinker-bell
spec:
  firstName: Tinker
  lastName: Bell
  email: tinker@example.com
  groups:
    - role-devops
    - team-fairies
  values:
    githubUser: tinkerbelle
---
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: violet-parr
spec:
  firstName: Violet
  lastName: Parr
  email: violet@example.com
  groups:
    - role-frontend
    - team-incredibles
  values:
    githubUser: violetparr
---
apiVersion: jac.nesto.ca/v1alpha1
kind: Person
metadata:
  name: woody
spec:
  firstName: Woody
  lastName: null
  email: woody@example.com
  groups:
    - role-manager
    - team-incredibles
  parent: alice-wonderland
  values:
    githubUser: woody

Output results as tree

$ jac people -t Use `--tree` or `-t` to output results as YAML instead of the default table format:
$ jac people -t

├─ Dash Parr
├─ Elsa
│  └─ Rapunzel
├─ Helen Parr
├─ Jack Sparrow
│  └─ Alice Wonderland
│     ├─ Buzz Lightyear
│     └─ Woody
├─ Maui
├─ Mickey Mouse
├─ Moana
├─ Peter Pan
├─ Pua
├─ Tinker Bell
└─ Violet Parr
 ———
 Count: 15

Highlight specific people in tree

$ jac people --show-all --tree --find alice Use `--show-all` or `-A` to show all people in tree, highlighting specific people with free-text search:
# $ jac people --show-all --tree --find alice
$ jac people -Atf alice

├─ Dash Parr
├─ Elsa
│  └─ Rapunzel
├─ Helen Parr
├─ Jack Sparrow
│  └─ Alice Wonderland <-- This will be highlighted in yellow in your CLI
│     ├─ Buzz Lightyear
│     └─ Woody
├─ Maui
├─ Mickey Mouse
├─ Moana
├─ Peter Pan
├─ Pua
├─ Tinker Bell
└─ Violet Parr
 ———
 Count: 1

Without --show-all, only people matching the search will be shown, along with their parents.

Highlight people of a specific team in tree

$ jac people --show-all --tree --group "team-unicorns"
# $ jac people --show-all --tree --group "team-unicorns"
$ jac people -Atg "team-unicorns"

├─ Dash Parr
├─ Elsa
│ └─ Rapunzel
├─ Helen Parr
├─ Jack Sparrow
│ └─ Alice Wonderland
│ ├─ Buzz Lightyear
│ └─ Woody
├─ Maui
├─ Mickey Mouse
├─ Moana
├─ Peter Pan
├─ Pua
├─ Tinker Bell
└─ Violet Parr
———
Count: 1

Example group commands

List all groups

$ jac groups
$ jac groups
  NAME                 FULL NAME           EMAIL  TYPE    PARENT
  role-backend         Backend Developer          role
  role-devops          DevOps                     role
  role-frontend        Frontend Developer         role
  role-manager         Manager                    role
  role-support         Support Specialist         role
  stream-development   Development                stream
  stream-marketing     Marketing                  stream
  stream-tech-support  Tech Support               stream
  team-dragons         Dragons Team               team    stream-tech-support
  team-fairies         Fairies Team               team    stream-development
  team-incredibles     Incredibles Team           team    stream-development
  team-moana           Moana's Team               team    stream-marketing
  team-unicorns        Unicorns Team              team    stream-tech-support
 ———
 Count: 13

List specific groups

$ jac groups role-frontend,team-unicorns
$ jac groups role-frontend,team-unicorns
  NAME           FULL NAME           EMAIL  TYPE  PARENT
  role-frontend  Frontend Developer         role
  team-unicorns  Unicorns Team              team  stream-tech-support
 ———
 Count: 2

List groups of specific types

$ jac groups --type stream,role

Use --type to filter by group type:

# $ jac groups --type stream,role
$ jac groups -T stream,role
  NAME                 FULL NAME           EMAIL  TYPE    PARENT
  role-backend         Backend Developer          role
  role-devops          DevOps                     role
  role-frontend        Frontend Developer         role
  role-manager         Manager                    role
  role-support         Support Specialist         role
  stream-development   Development                stream
  stream-marketing     Marketing                  stream
  stream-tech-support  Tech Support               stream
 ———
 Count: 8

Pull latest version of git repo

$ jac pull
$ jac pull
Already up to date.

Pattern syntax

You can use the following syntax to specify the pattern for groups and people commands:

Use * to match any number of characters

$ jac people "*oa*"
$ jac people "*oa*"
  NAME   FIRST NAME  LAST NAME  EMAIL              GROUPS                          INHERITED GROUPS
  moana  Moana                  moana@example.com  Support Specialist              Marketing
                                                   Moana's Team
 ———
 Count: 1

Specify multiple ,-separated patterns to match any of them

$ jac people -g role-frontend,team-unicorns
$ jac people -g role-frontend,team-unicorns
  NAME            FIRST NAME  LAST NAME  EMAIL               GROUPS                          INHERITED GROUPS
  buzz-lightyear  Buzz        Lightyear  buzz@example.com    Frontend Developer              Development
                                                             Incredibles Team
  mickey-mouse    Mickey      Mouse      mickey@example.com  Frontend Developer              Tech Support
                                                             Unicorns Team
  pua             Pua                    pua@example.com     Frontend Developer              Marketing
                                                             Moana's Team
  violet-parr     Violet      Parr       violet@example.com  Frontend Developer              Development
                                                             Incredibles Team
 ———
 Count: 4

Specify multiple &-separated patterns to match all of them

$ jac people -g "role-frontend&team-unicorns"
$ jac people -g "role-frontend&team-unicorns"
  NAME          FIRST NAME  LAST NAME  EMAIL               GROUPS                          INHERITED GROUPS
  mickey-mouse  Mickey      Mouse      mickey@example.com  Frontend Developer              Tech Support
                                                           Unicorns Team
 ———
 Count: 1

Prefix a pattern with ! to negate it

$ jac people -g '!role-frontend'
$ jac people -g '!role-frontend'
  NAME              FIRST NAME  LAST NAME   EMAIL                 GROUPS                          INHERITED GROUPS
  alice-wonderland  Alice       Wonderland  alice@example.com     Manager Support Specialist
                                                                  Tech Support
  dash-parr         Dash        Parr        dash@example.com      DevOps Incredibles Team         Development
  elsa              Elsa                    elsa@example.com      Backend Developer Fairies Team  Development

  helen-parr        Helen       Parr        helen@example.com     Manager Incredibles Team        Development
  jack-sparrow      Jack        Sparrow     jack@example.com      DevOps Dragons Team             Tech Support
  maui              Maui                    maui@example.com      Backend Developer Moana's Team  Marketing

  moana             Moana                   moana@example.com     Support Specialist              Marketing
                                                                  Moana's Team
  peter-pan         Peter       Pan         peter@example.com     Backend Developer Dragons Team  Tech Support

  rapunzel          Rapunzel                rapunzel@example.com  Manager Support Specialist
                                                                  Development
  tinker-bell       Tinker      Bell        tinker@example.com    DevOps Fairies Team             Development
  woody             Woody                   woody@example.com     Manager Incredibles Team        Development
 ———
 Count: 11