Managing groups
Managing groups
Section titled “Managing groups”You can manage groups in a project from the terminal with the collingo groups command.
Use it to list groups, create new ones, update their data, or delete them.
Groups live inside a project; entries live inside groups. See Managing projects and Managing entries.
Project context: All group commands require a project context. Run the CLI from a directory that contains a .collingo.json workspace config (for example after running collingo init in your app repo), or pass --working-dir <dir> to point to such a directory. The workspace config links the directory to a project.
List groups
Section titled “List groups”To list all groups in the current project, run:
collingo groups listYou can also use the alias ls: collingo groups ls.
The command prints one line per group in the form [id] breadcrumb > displayName (technicalName).
Use the id or the technical name (and group path where relevant) when you call update or delete with flags.
Create a group
Section titled “Create a group”To create a new group, run:
collingo groups createAlias: add.
Parameters:
- Display name (human-readable name): Set with
--display-name <name>, or omit and you will be asked to enter a name. - Technical name (identifier for your code): Set with
--technical-name <name>, or omit and you will be asked to enter a technical name. - Parent group: Set with
--parent <path>(group path, e.g.base.footer) or--parent-id <id>(the ID of the parent group). You cannot use both. Omit both and you will be asked whether to select a parent group; if you choose yes, you pick one interactively. Leave both unset to create a top-level group.
Example with all values passed by flags:
collingo groups create --display-name "Footer" --technical-name footer --parent baseWhen the group is created, the CLI prints the new group’s display name and its id.
Update a group
Section titled “Update a group”To change a group’s data, run:
collingo groups updateAlias: edit.
Parameters:
- The group to edit: Set with
--group <path>(e.g.base.footer) or--group-id <id>. You cannot use both. Omit both and you will be asked to choose a group interactively. - The new display name: Set with
--display-name <name>, or omit and you will be asked whether to update it and then prompted. - The new technical name: Set with
--technical-name <name>, or omit and you will be asked whether to update it and then prompted. - Parent group: Set with
--parent <id>(the ID of the new parent) to move the group under another group, or--root-groupto make it a top-level group (no parent). You cannot use--parentand--root-grouptogether. Omit both and you will be asked whether to change the parent (or remove it) interactively.
Example with flags:
collingo groups update --group-id <id> --display-name "New Display Name"If there is nothing to update, the CLI prints “Nothing to update”.
Delete a group
Section titled “Delete a group”To delete a group, run:
collingo groups deleteAlias: rm.
Parameters:
- The group to delete: Set with
--group <path>(e.g.main.footer) or--group-id <id>. You cannot use both. Omit both and you will be asked to choose a group interactively. - Skip confirmation: Set
--yesto delete without being asked. If you omit it, the CLI shows the group and asks you to confirm.
Example without confirmation prompt:
collingo groups delete --group-id <id> --yesDeleting a group is irreversible and removes the group and its data (including sub groups and entries).
Working directory
Section titled “Working directory”If you run the CLI from a different directory and need to use a specific workspace config, pass the global flag --working-dir <dir>. That directory must contain a .collingo.json with the project ID. This applies to all groups commands.