@circleback/cli 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -40,26 +40,31 @@ cb meetings --json
40
40
 
41
41
  ## Commands
42
42
 
43
- | Command | Description |
44
- | -------------------------------- | --------------------------------------------------------------- |
45
- | `cb auth login` | Log in to Circleback with your browser |
46
- | `cb auth login --api-key` | Log in with an API key |
47
- | `cb auth logout` | Sign out on this device |
48
- | `cb update` | Update CLI to the latest version |
49
- | `cb meetings [search]` | Search meetings |
50
- | `cb meetings read <ids...>` | Read detailed meeting info, notes, and action items (max 50) |
51
- | `cb transcripts <search>` | Search transcript content |
52
- | `cb transcripts read <ids...>` | Read full transcripts (max 50) |
53
- | `cb calendar` | Search calendar events |
54
- | `cb people <names...>` | Search people by name |
55
- | `cb companies <terms...>` | Search companies by name or domain |
56
- | `cb emails [search]` | Search connected email accounts |
57
- | `cb support [search]` | Search Circleback support articles |
58
- | `cb action-items [search]` | Search action items |
59
- | `cb action-items create <title>` | Create an action item |
60
- | `cb action-items update <id>` | Update an action item's title, description, status, or assignee |
61
- | `cb action-items delete <id>` | Delete an action item |
62
- | `cb tags` | List tags |
43
+ | Command | Description |
44
+ | -------------------------------------- | --------------------------------------------------------------- |
45
+ | `cb auth login` | Log in to Circleback with your browser |
46
+ | `cb auth login --api-key` | Log in with an API key |
47
+ | `cb auth logout` | Sign out on this device |
48
+ | `cb update` | Update CLI to the latest version |
49
+ | `cb meetings [search]` | Search meetings |
50
+ | `cb meetings read <ids...>` | Read detailed meeting info, notes, and action items (max 50) |
51
+ | `cb transcripts <search>` | Search transcript content |
52
+ | `cb transcripts read <ids...>` | Read full transcripts (max 50) |
53
+ | `cb calendar` | Search calendar events |
54
+ | `cb people <names...>` | Search people by name |
55
+ | `cb companies <terms...>` | Search companies by name or domain |
56
+ | `cb emails [search]` | Search connected email accounts |
57
+ | `cb support [search]` | Search Circleback support articles |
58
+ | `cb action-items [search]` | Search action items |
59
+ | `cb action-items create <title>` | Create an action item |
60
+ | `cb action-items update <id>` | Update an action item's title, description, status, or assignee |
61
+ | `cb action-items delete <id>` | Delete an action item |
62
+ | `cb tags` | List tags |
63
+ | `cb tags create <name>` | Create a tag |
64
+ | `cb tags update <id>` | Update a tag's name, description, or color |
65
+ | `cb tags delete <id>` | Delete a tag |
66
+ | `cb tags apply <id> <meetingIds...>` | Add a tag to meetings |
67
+ | `cb tags unapply <id> <meetingIds...>` | Remove a tag from meetings |
63
68
 
64
69
  Run `cb --help` or `cb <command> --help` for full usage details.
65
70
 
@@ -110,7 +115,7 @@ For stateless automation, set `CIRCLEBACK_API_KEY` instead of logging in:
110
115
  CIRCLEBACK_API_KEY=cb_your_api_key cb meetings --json
111
116
  ```
112
117
 
113
- Creating, updating, and deleting action items needs write access. Browser logins from before v0.5.0 only granted read access, so run `cb auth login` again; read-only API keys can't make changes.
118
+ Changing action items or tags needs write access. Browser logins from before v0.5.0 don't include it, so run `cb auth login` again; read-only API keys can't make changes.
114
119
 
115
120
  `CIRCLEBACK_API_KEY` takes precedence over stored credentials. Unset it before running `cb auth login`; `cb auth logout` cannot clear an environment variable from your shell.
116
121
 
@@ -62,8 +62,15 @@ const commandGroups = [
62
62
  },
63
63
  {
64
64
  name: 'tags',
65
- description: 'List tags.',
66
- subcommands: [tags_1.listTagsCommand],
65
+ description: 'List and manage tags.',
66
+ subcommands: [
67
+ tags_1.listTagsCommand,
68
+ tags_1.createTagCommand,
69
+ tags_1.updateTagCommand,
70
+ tags_1.deleteTagCommand,
71
+ tags_1.applyTagCommand,
72
+ tags_1.unapplyTagCommand,
73
+ ],
67
74
  },
68
75
  ];
69
76
  const buildCommandGroup = (definition) => definition.subcommands.reduce((group, command, index) => group.addCommand(command, index === 0 ? { isDefault: true } : undefined), new commander_1.Command(definition.name).description(definition.description));
@@ -1,7 +1,59 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listTagsCommand = void 0;
3
+ exports.unapplyTagCommand = exports.applyTagCommand = exports.deleteTagCommand = exports.updateTagCommand = exports.createTagCommand = exports.listTagsCommand = void 0;
4
4
  const commander_1 = require("commander");
5
5
  const command_1 = require("../helpers/command");
6
+ const parse_1 = require("../helpers/parse");
6
7
  const types_1 = require("../types");
8
+ const createColorOption = () => new commander_1.Option('--color <color>', 'Set the display color').choices([
9
+ 'neutral',
10
+ 'red',
11
+ 'rose',
12
+ 'orange',
13
+ 'amber',
14
+ 'emerald',
15
+ 'sky',
16
+ 'blue',
17
+ 'indigo',
18
+ 'purple',
19
+ ]);
20
+ const getTagColor = (color) => color ? `bg-tag-${color}` : undefined;
21
+ const getTagAssignment = (identifier, meetingIds) => ({
22
+ tagId: (0, parse_1.parseIntOption)(identifier, 'id'),
23
+ meetingIds,
24
+ });
7
25
  exports.listTagsCommand = (0, command_1.defineToolCommand)(new commander_1.Command('list').description('List all tags.'), types_1.ToolName.ListTags, () => ({ intent: 'Listing all tags.' }));
26
+ exports.createTagCommand = (0, command_1.defineToolCommand)(new commander_1.Command('create')
27
+ .description('Create a tag.')
28
+ .argument('<name>', 'Tag name')
29
+ .option('--description <description>', 'Set the description')
30
+ .addOption(createColorOption()), types_1.ToolName.CreateTag, (name, options) => ({
31
+ name,
32
+ description: options.description,
33
+ color: getTagColor(options.color),
34
+ }));
35
+ exports.updateTagCommand = (0, command_1.defineToolCommand)(new commander_1.Command('update')
36
+ .description('Update a tag.')
37
+ .argument('<id>', 'Tag ID')
38
+ .option('--name <name>', 'Set the name')
39
+ .option('--description <description>', 'Set the description')
40
+ .addOption(createColorOption()), types_1.ToolName.UpdateTag, (identifier, options) => {
41
+ if (!Object.values(options).some((value) => value !== undefined)) {
42
+ throw new Error('Provide at least one field to update.');
43
+ }
44
+ return {
45
+ tagId: (0, parse_1.parseIntOption)(identifier, 'id'),
46
+ name: options.name,
47
+ description: options.description,
48
+ color: getTagColor(options.color),
49
+ };
50
+ });
51
+ exports.deleteTagCommand = (0, command_1.defineToolCommand)(new commander_1.Command('delete').description('Delete a tag.').argument('<id>', 'Tag ID'), types_1.ToolName.DeleteTag, (identifier) => ({ tagId: (0, parse_1.parseIntOption)(identifier, 'id') }));
52
+ exports.applyTagCommand = (0, command_1.defineToolCommand)(new commander_1.Command('apply')
53
+ .description('Add a tag to meetings.')
54
+ .argument('<id>', 'Tag ID')
55
+ .argument('<meetingIds...>', 'Meeting IDs'), types_1.ToolName.AddTagToMeetings, getTagAssignment);
56
+ exports.unapplyTagCommand = (0, command_1.defineToolCommand)(new commander_1.Command('unapply')
57
+ .description('Remove a tag from meetings.')
58
+ .argument('<id>', 'Tag ID')
59
+ .argument('<meetingIds...>', 'Meeting IDs'), types_1.ToolName.RemoveTagFromMeetings, getTagAssignment);
@@ -19,6 +19,14 @@ const formatActionItemChange = (verb, data) => {
19
19
  const { id, title, status } = result.data;
20
20
  return `${verb} action item ${id}: ${title} (${status})`;
21
21
  };
22
+ const TagChangeSchema = zod_1.z.object({ id: zod_1.z.number(), name: zod_1.z.string() });
23
+ const formatTagChange = (verb, data) => {
24
+ const result = TagChangeSchema.safeParse(data);
25
+ if (!result.success)
26
+ return;
27
+ const { id, name } = result.data;
28
+ return `${verb} tag ${id}: ${name}`;
29
+ };
22
30
  const formatForTool = (toolName, data) => {
23
31
  switch (toolName) {
24
32
  case types_1.ToolName.CreateActionItem:
@@ -27,6 +35,12 @@ const formatForTool = (toolName, data) => {
27
35
  return formatActionItemChange('Updated', data);
28
36
  case types_1.ToolName.DeleteActionItem:
29
37
  return formatActionItemChange('Deleted', data);
38
+ case types_1.ToolName.CreateTag:
39
+ return formatTagChange('Created', data);
40
+ case types_1.ToolName.UpdateTag:
41
+ return formatTagChange('Updated', data);
42
+ case types_1.ToolName.DeleteTag:
43
+ return formatTagChange('Deleted', data);
30
44
  }
31
45
  if (!Array.isArray(data))
32
46
  return;
@@ -53,6 +67,9 @@ const formatForTool = (toolName, data) => {
53
67
  return (0, table_1.formatActionItems)(data);
54
68
  case types_1.ToolName.ListTags:
55
69
  return (0, table_1.formatTags)(data);
70
+ case types_1.ToolName.AddTagToMeetings:
71
+ case types_1.ToolName.RemoveTagFromMeetings:
72
+ return;
56
73
  default: {
57
74
  const _absurd = toolName;
58
75
  return _absurd;
package/dist/types.js CHANGED
@@ -28,6 +28,11 @@ var ToolName;
28
28
  ToolName["CreateActionItem"] = "CreateActionItem";
29
29
  ToolName["UpdateActionItem"] = "UpdateActionItem";
30
30
  ToolName["DeleteActionItem"] = "DeleteActionItem";
31
+ ToolName["CreateTag"] = "CreateTag";
32
+ ToolName["UpdateTag"] = "UpdateTag";
33
+ ToolName["DeleteTag"] = "DeleteTag";
34
+ ToolName["AddTagToMeetings"] = "AddTagToMeetings";
35
+ ToolName["RemoveTagFromMeetings"] = "RemoveTagFromMeetings";
31
36
  })(ToolName || (exports.ToolName = ToolName = {}));
32
37
  var ActionItemStatus;
33
38
  (function (ActionItemStatus) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@circleback/cli",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Circleback CLI. Search and access meetings, emails, calendar events, and more.",
5
5
  "license": "MIT",
6
6
  "author": "Circleback <support@circleback.ai> (https://circleback.ai)",