Managing entries
Managing entries
Section titled “Managing entries”You can manage entries (translation terms) in a group from the terminal with the collingo entries command.
Use it to list entries, create new ones, update their data, move them to another group, or delete them.
Entries live inside groups; groups live inside a project. See Managing projects and Managing groups.
Project context: All entry 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 entries
Section titled “List entries”To list all entries in a group, run:
collingo entries listYou can also use the alias ls: collingo entries ls.
Parameters:
- The group: Set with
--group <path>(e.g.base.footer) or--group-id <id>(the ID of the group). You cannot use both. Omit both and you will be asked to choose a group interactively.
The command prints one line per entry: [technicalName] | baseTerm. If an entry has context info, a second line shows -> Context: .... If the group has no entries, the CLI prints “Group has no entries”. Use the technical name from this output when you call update or delete with flags.
Example:
collingo entries list --group base.footerCreate an entry
Section titled “Create an entry”To create a new entry in a group, run:
collingo entries createAlias: add.
Parameters:
- The group where the entry is added: 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. - Technical name (identifier for your code): Set with
--technical-name <name>, or omit and you will be asked to enter a technical name. - Base term (the term in the base language): Set with
--base-term <term>, or omit and you will be asked to enter the base term. - Context info (optional): Set with
--context-info <text>, or omit and you can optionally enter context info when prompted.
Example with flags:
collingo entries create --group base.footer --technical-name labelImprint --base-term "Imprint"When the entry is created, the CLI prints the entry’s technical name and the group id.
Update an entry
Section titled “Update an entry”To change an entry’s data or move it to another group, run:
collingo entries updateAlias: edit.
Parameters:
- The group that contains the entry: Set with
--group <path>or--group-id <id>. You cannot use both. Omit both and you will be asked to choose a group interactively. - The entry to edit (technical name): Set with
--entry <technicalName>, or omit and you will be asked to choose an entry from the group interactively. - The new technical name: Set with
--technical-name <name>, or omit and you will be asked whether to update it and then prompted. - The new base term: Set with
--base-term <term>, or omit and you will be asked whether to update it and then prompted. - Context info: Set with
--context <text>for new context, or--no-contextto remove it. You cannot use both. Omit both and you will be asked whether to update or remove context interactively. - Move to another group: Set with
--new-group <path>or--new-group-id <id>(the group to move the entry to). You cannot use both. Omit both and you will be asked whether to move the entry and then can choose a group interactively.
Example with flags:
collingo entries update --group base.footer --entry labelImprint --base-term "Legal Imprint"If you change the technical name or move the entry to another group, the CLI creates the entry in the new place and then deletes the old one.
Delete an entry
Section titled “Delete an entry”To delete an entry from a group, run:
collingo entries deleteAlias: rm.
Parameters:
- The ID of the group that contains the entry: Set with
--group <id>(use the group ID fromcollingo groups listor from the group’s context). Omit and you will be asked to choose a group interactively. - The technical name of the entry to delete: Set with
--technical-name <name>, or omit and you will be asked to enter the technical name. - Skip confirmation: Set
--yesto delete without being asked. If you omit it, the CLI shows the entry and asks you to confirm.
Example without confirmation prompt:
collingo entries delete --group <group-id> --technical-name labelImprint --yesDeleting an entry is irreversible.
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 entries commands.