@doist/comms-cli 0.0.1 → 1.0.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/CHANGELOG.md +8 -0
- package/README.md +165 -29
- package/dist/commands/account/index.d.ts +3 -0
- package/dist/commands/account/index.d.ts.map +1 -0
- package/dist/commands/account/index.js +104 -0
- package/dist/commands/account/index.js.map +1 -0
- package/dist/commands/auth/helpers.d.ts +22 -0
- package/dist/commands/auth/helpers.d.ts.map +1 -0
- package/dist/commands/auth/helpers.js +29 -0
- package/dist/commands/auth/helpers.js.map +1 -0
- package/dist/commands/auth/index.d.ts +3 -0
- package/dist/commands/auth/index.d.ts.map +1 -0
- package/dist/commands/auth/index.js +32 -0
- package/dist/commands/auth/index.js.map +1 -0
- package/dist/commands/auth/login.d.ts +4 -0
- package/dist/commands/auth/login.d.ts.map +1 -0
- package/dist/commands/auth/login.js +29 -0
- package/dist/commands/auth/login.js.map +1 -0
- package/dist/commands/auth/logout.d.ts +11 -0
- package/dist/commands/auth/logout.d.ts.map +1 -0
- package/dist/commands/auth/logout.js +16 -0
- package/dist/commands/auth/logout.js.map +1 -0
- package/dist/commands/auth/status.d.ts +16 -0
- package/dist/commands/auth/status.d.ts.map +1 -0
- package/dist/commands/auth/status.js +102 -0
- package/dist/commands/auth/status.js.map +1 -0
- package/dist/commands/auth/store-wrap.d.ts +4 -0
- package/dist/commands/auth/store-wrap.d.ts.map +1 -0
- package/dist/commands/auth/store-wrap.js +24 -0
- package/dist/commands/auth/store-wrap.js.map +1 -0
- package/dist/commands/auth/token.d.ts +2 -0
- package/dist/commands/auth/token.d.ts.map +1 -0
- package/dist/commands/auth/token.js +56 -0
- package/dist/commands/auth/token.js.map +1 -0
- package/dist/commands/changelog.d.ts +3 -0
- package/dist/commands/changelog.d.ts.map +1 -0
- package/dist/commands/changelog.js +16 -0
- package/dist/commands/changelog.js.map +1 -0
- package/dist/commands/channel/create.d.ts +11 -0
- package/dist/commands/channel/create.d.ts.map +1 -0
- package/dist/commands/channel/create.js +35 -0
- package/dist/commands/channel/create.js.map +1 -0
- package/dist/commands/channel/helpers.d.ts +9 -0
- package/dist/commands/channel/helpers.d.ts.map +1 -0
- package/dist/commands/channel/helpers.js +51 -0
- package/dist/commands/channel/helpers.js.map +1 -0
- package/dist/commands/channel/index.d.ts +3 -0
- package/dist/commands/channel/index.d.ts.map +1 -0
- package/dist/commands/channel/index.js +104 -0
- package/dist/commands/channel/index.js.map +1 -0
- package/dist/commands/channel/list.d.ts +8 -0
- package/dist/commands/channel/list.d.ts.map +1 -0
- package/dist/commands/channel/list.js +144 -0
- package/dist/commands/channel/list.js.map +1 -0
- package/dist/commands/channel/threads.d.ts +11 -0
- package/dist/commands/channel/threads.d.ts.map +1 -0
- package/dist/commands/channel/threads.js +100 -0
- package/dist/commands/channel/threads.js.map +1 -0
- package/dist/commands/channel/update.d.ts +12 -0
- package/dist/commands/channel/update.d.ts.map +1 -0
- package/dist/commands/channel/update.js +84 -0
- package/dist/commands/channel/update.js.map +1 -0
- package/dist/commands/comment/delete.d.ts +5 -0
- package/dist/commands/comment/delete.d.ts.map +1 -0
- package/dist/commands/comment/delete.js +33 -0
- package/dist/commands/comment/delete.js.map +1 -0
- package/dist/commands/comment/index.d.ts +3 -0
- package/dist/commands/comment/index.d.ts.map +1 -0
- package/dist/commands/comment/index.js +49 -0
- package/dist/commands/comment/index.js.map +1 -0
- package/dist/commands/comment/update.d.ts +5 -0
- package/dist/commands/comment/update.d.ts.map +1 -0
- package/dist/commands/comment/update.js +37 -0
- package/dist/commands/comment/update.js.map +1 -0
- package/dist/commands/comment/view.d.ts +3 -0
- package/dist/commands/comment/view.d.ts.map +1 -0
- package/dist/commands/comment/view.js +31 -0
- package/dist/commands/comment/view.js.map +1 -0
- package/dist/commands/completion/helpers.d.ts +14 -0
- package/dist/commands/completion/helpers.d.ts.map +1 -0
- package/dist/commands/completion/helpers.js +37 -0
- package/dist/commands/completion/helpers.js.map +1 -0
- package/dist/commands/completion/index.d.ts +3 -0
- package/dist/commands/completion/index.d.ts.map +1 -0
- package/dist/commands/completion/index.js +22 -0
- package/dist/commands/completion/index.js.map +1 -0
- package/dist/commands/completion/install.d.ts +2 -0
- package/dist/commands/completion/install.d.ts.map +1 -0
- package/dist/commands/completion/install.js +19 -0
- package/dist/commands/completion/install.js.map +1 -0
- package/dist/commands/completion/server.d.ts +3 -0
- package/dist/commands/completion/server.d.ts.map +1 -0
- package/dist/commands/completion/server.js +35 -0
- package/dist/commands/completion/server.js.map +1 -0
- package/dist/commands/completion/uninstall.d.ts +2 -0
- package/dist/commands/completion/uninstall.d.ts.map +1 -0
- package/dist/commands/completion/uninstall.js +19 -0
- package/dist/commands/completion/uninstall.js.map +1 -0
- package/dist/commands/config/index.d.ts +3 -0
- package/dist/commands/config/index.d.ts.map +1 -0
- package/dist/commands/config/index.js +29 -0
- package/dist/commands/config/index.js.map +1 -0
- package/dist/commands/config/set.d.ts +3 -0
- package/dist/commands/config/set.d.ts.map +1 -0
- package/dist/commands/config/set.js +41 -0
- package/dist/commands/config/set.js.map +1 -0
- package/dist/commands/config/view.d.ts +6 -0
- package/dist/commands/config/view.d.ts.map +1 -0
- package/dist/commands/config/view.js +121 -0
- package/dist/commands/config/view.js.map +1 -0
- package/dist/commands/conversation/done.d.ts +3 -0
- package/dist/commands/conversation/done.d.ts.map +1 -0
- package/dist/commands/conversation/done.js +23 -0
- package/dist/commands/conversation/done.js.map +1 -0
- package/dist/commands/conversation/helpers.d.ts +28 -0
- package/dist/commands/conversation/helpers.d.ts.map +1 -0
- package/dist/commands/conversation/helpers.js +119 -0
- package/dist/commands/conversation/helpers.js.map +1 -0
- package/dist/commands/conversation/index.d.ts +3 -0
- package/dist/commands/conversation/index.d.ts.map +1 -0
- package/dist/commands/conversation/index.js +107 -0
- package/dist/commands/conversation/index.js.map +1 -0
- package/dist/commands/conversation/mute.d.ts +3 -0
- package/dist/commands/conversation/mute.d.ts.map +1 -0
- package/dist/commands/conversation/mute.js +30 -0
- package/dist/commands/conversation/mute.js.map +1 -0
- package/dist/commands/conversation/reply.d.ts +3 -0
- package/dist/commands/conversation/reply.d.ts.map +1 -0
- package/dist/commands/conversation/reply.js +37 -0
- package/dist/commands/conversation/reply.js.map +1 -0
- package/dist/commands/conversation/unmute.d.ts +3 -0
- package/dist/commands/conversation/unmute.d.ts.map +1 -0
- package/dist/commands/conversation/unmute.js +28 -0
- package/dist/commands/conversation/unmute.js.map +1 -0
- package/dist/commands/conversation/unread.d.ts +3 -0
- package/dist/commands/conversation/unread.d.ts.map +1 -0
- package/dist/commands/conversation/unread.js +56 -0
- package/dist/commands/conversation/unread.js.map +1 -0
- package/dist/commands/conversation/view.d.ts +3 -0
- package/dist/commands/conversation/view.d.ts.map +1 -0
- package/dist/commands/conversation/view.js +77 -0
- package/dist/commands/conversation/view.js.map +1 -0
- package/dist/commands/conversation/with.d.ts +3 -0
- package/dist/commands/conversation/with.d.ts.map +1 -0
- package/dist/commands/conversation/with.js +48 -0
- package/dist/commands/conversation/with.js.map +1 -0
- package/dist/commands/doctor.d.ts +9 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +325 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/groups/create.d.ts +8 -0
- package/dist/commands/groups/create.d.ts.map +1 -0
- package/dist/commands/groups/create.js +27 -0
- package/dist/commands/groups/create.js.map +1 -0
- package/dist/commands/groups/delete.d.ts +7 -0
- package/dist/commands/groups/delete.d.ts.map +1 -0
- package/dist/commands/groups/delete.js +30 -0
- package/dist/commands/groups/delete.js.map +1 -0
- package/dist/commands/groups/index.d.ts +3 -0
- package/dist/commands/groups/index.d.ts.map +1 -0
- package/dist/commands/groups/index.js +98 -0
- package/dist/commands/groups/index.js.map +1 -0
- package/dist/commands/groups/list.d.ts +7 -0
- package/dist/commands/groups/list.d.ts.map +1 -0
- package/dist/commands/groups/list.js +42 -0
- package/dist/commands/groups/list.js.map +1 -0
- package/dist/commands/groups/members.d.ts +4 -0
- package/dist/commands/groups/members.d.ts.map +1 -0
- package/dist/commands/groups/members.js +90 -0
- package/dist/commands/groups/members.js.map +1 -0
- package/dist/commands/groups/rename.d.ts +3 -0
- package/dist/commands/groups/rename.d.ts.map +1 -0
- package/dist/commands/groups/rename.js +28 -0
- package/dist/commands/groups/rename.js.map +1 -0
- package/dist/commands/groups/view.d.ts +7 -0
- package/dist/commands/groups/view.d.ts.map +1 -0
- package/dist/commands/groups/view.js +52 -0
- package/dist/commands/groups/view.js.map +1 -0
- package/dist/commands/inbox.d.ts +3 -0
- package/dist/commands/inbox.d.ts.map +1 -0
- package/dist/commands/inbox.js +147 -0
- package/dist/commands/inbox.js.map +1 -0
- package/dist/commands/mentions.d.ts +3 -0
- package/dist/commands/mentions.d.ts.map +1 -0
- package/dist/commands/mentions.js +23 -0
- package/dist/commands/mentions.js.map +1 -0
- package/dist/commands/msg/delete.d.ts +5 -0
- package/dist/commands/msg/delete.d.ts.map +1 -0
- package/dist/commands/msg/delete.js +31 -0
- package/dist/commands/msg/delete.js.map +1 -0
- package/dist/commands/msg/index.d.ts +3 -0
- package/dist/commands/msg/index.d.ts.map +1 -0
- package/dist/commands/msg/index.js +47 -0
- package/dist/commands/msg/index.js.map +1 -0
- package/dist/commands/msg/update.d.ts +5 -0
- package/dist/commands/msg/update.d.ts.map +1 -0
- package/dist/commands/msg/update.js +37 -0
- package/dist/commands/msg/update.js.map +1 -0
- package/dist/commands/msg/view.d.ts +3 -0
- package/dist/commands/msg/view.d.ts.map +1 -0
- package/dist/commands/msg/view.js +31 -0
- package/dist/commands/msg/view.js.map +1 -0
- package/dist/commands/react.d.ts +3 -0
- package/dist/commands/react.d.ts.map +1 -0
- package/dist/commands/react.js +149 -0
- package/dist/commands/react.js.map +1 -0
- package/dist/commands/search.d.ts +3 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +30 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/skill/index.d.ts +3 -0
- package/dist/commands/skill/index.d.ts.map +1 -0
- package/dist/commands/skill/index.js +29 -0
- package/dist/commands/skill/index.js.map +1 -0
- package/dist/commands/skill/install.d.ts +3 -0
- package/dist/commands/skill/install.d.ts.map +1 -0
- package/dist/commands/skill/install.js +16 -0
- package/dist/commands/skill/install.js.map +1 -0
- package/dist/commands/skill/list.d.ts +6 -0
- package/dist/commands/skill/list.d.ts.map +1 -0
- package/dist/commands/skill/list.js +22 -0
- package/dist/commands/skill/list.js.map +1 -0
- package/dist/commands/skill/uninstall.d.ts +3 -0
- package/dist/commands/skill/uninstall.d.ts.map +1 -0
- package/dist/commands/skill/uninstall.js +15 -0
- package/dist/commands/skill/uninstall.js.map +1 -0
- package/dist/commands/skill/update.d.ts +3 -0
- package/dist/commands/skill/update.d.ts.map +1 -0
- package/dist/commands/skill/update.js +37 -0
- package/dist/commands/skill/update.js.map +1 -0
- package/dist/commands/thread/create.d.ts +8 -0
- package/dist/commands/thread/create.d.ts.map +1 -0
- package/dist/commands/thread/create.js +70 -0
- package/dist/commands/thread/create.js.map +1 -0
- package/dist/commands/thread/delete.d.ts +7 -0
- package/dist/commands/thread/delete.d.ts.map +1 -0
- package/dist/commands/thread/delete.js +38 -0
- package/dist/commands/thread/delete.js.map +1 -0
- package/dist/commands/thread/helpers.d.ts +24 -0
- package/dist/commands/thread/helpers.d.ts.map +1 -0
- package/dist/commands/thread/helpers.js +45 -0
- package/dist/commands/thread/helpers.js.map +1 -0
- package/dist/commands/thread/index.d.ts +3 -0
- package/dist/commands/thread/index.d.ts.map +1 -0
- package/dist/commands/thread/index.js +134 -0
- package/dist/commands/thread/index.js.map +1 -0
- package/dist/commands/thread/mutate.d.ts +5 -0
- package/dist/commands/thread/mutate.d.ts.map +1 -0
- package/dist/commands/thread/mutate.js +23 -0
- package/dist/commands/thread/mutate.js.map +1 -0
- package/dist/commands/thread/mute.d.ts +8 -0
- package/dist/commands/thread/mute.d.ts.map +1 -0
- package/dist/commands/thread/mute.js +63 -0
- package/dist/commands/thread/mute.js.map +1 -0
- package/dist/commands/thread/rename.d.ts +3 -0
- package/dist/commands/thread/rename.d.ts.map +1 -0
- package/dist/commands/thread/rename.js +29 -0
- package/dist/commands/thread/rename.js.map +1 -0
- package/dist/commands/thread/reply.d.ts +9 -0
- package/dist/commands/thread/reply.d.ts.map +1 -0
- package/dist/commands/thread/reply.js +85 -0
- package/dist/commands/thread/reply.js.map +1 -0
- package/dist/commands/thread/update.d.ts +5 -0
- package/dist/commands/thread/update.d.ts.map +1 -0
- package/dist/commands/thread/update.js +45 -0
- package/dist/commands/thread/update.js.map +1 -0
- package/dist/commands/thread/view.d.ts +9 -0
- package/dist/commands/thread/view.d.ts.map +1 -0
- package/dist/commands/thread/view.js +171 -0
- package/dist/commands/thread/view.js.map +1 -0
- package/dist/commands/update/index.d.ts +3 -0
- package/dist/commands/update/index.d.ts.map +1 -0
- package/dist/commands/update/index.js +14 -0
- package/dist/commands/update/index.js.map +1 -0
- package/dist/commands/user.d.ts +3 -0
- package/dist/commands/user.d.ts.map +1 -0
- package/dist/commands/user.js +90 -0
- package/dist/commands/user.js.map +1 -0
- package/dist/commands/view.d.ts +3 -0
- package/dist/commands/view.d.ts.map +1 -0
- package/dist/commands/view.js +68 -0
- package/dist/commands/view.js.map +1 -0
- package/dist/commands/workspace.d.ts +3 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +56 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +190 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api.d.ts +35 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +306 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/auth-constants.d.ts +3 -0
- package/dist/lib/auth-constants.d.ts.map +1 -0
- package/dist/lib/auth-constants.js +3 -0
- package/dist/lib/auth-constants.js.map +1 -0
- package/dist/lib/auth-pages.d.ts +3 -0
- package/dist/lib/auth-pages.d.ts.map +1 -0
- package/dist/lib/auth-pages.js +707 -0
- package/dist/lib/auth-pages.js.map +1 -0
- package/dist/lib/auth-provider.d.ts +74 -0
- package/dist/lib/auth-provider.d.ts.map +1 -0
- package/dist/lib/auth-provider.js +238 -0
- package/dist/lib/auth-provider.js.map +1 -0
- package/dist/lib/auth.d.ts +39 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +57 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/comms-account.d.ts +22 -0
- package/dist/lib/comms-account.d.ts.map +1 -0
- package/dist/lib/comms-account.js +23 -0
- package/dist/lib/comms-account.js.map +1 -0
- package/dist/lib/completion.d.ts +31 -0
- package/dist/lib/completion.d.ts.map +1 -0
- package/dist/lib/completion.js +173 -0
- package/dist/lib/completion.js.map +1 -0
- package/dist/lib/config.d.ts +61 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +184 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/dates.d.ts +3 -0
- package/dist/lib/dates.d.ts.map +1 -0
- package/dist/lib/dates.js +44 -0
- package/dist/lib/dates.js.map +1 -0
- package/dist/lib/errors.d.ts +28 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +34 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/global-args.d.ts +52 -0
- package/dist/lib/global-args.d.ts.map +1 -0
- package/dist/lib/global-args.js +124 -0
- package/dist/lib/global-args.js.map +1 -0
- package/dist/lib/input.d.ts +3 -0
- package/dist/lib/input.d.ts.map +1 -0
- package/dist/lib/input.js +80 -0
- package/dist/lib/input.js.map +1 -0
- package/dist/lib/markdown.d.ts +3 -0
- package/dist/lib/markdown.d.ts.map +1 -0
- package/dist/lib/markdown.js +15 -0
- package/dist/lib/markdown.js.map +1 -0
- package/dist/lib/options.d.ts +16 -0
- package/dist/lib/options.d.ts.map +1 -0
- package/dist/lib/options.js +2 -0
- package/dist/lib/options.js.map +1 -0
- package/dist/lib/output.d.ts +41 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +184 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/permissions.d.ts +4 -0
- package/dist/lib/permissions.d.ts.map +1 -0
- package/dist/lib/permissions.js +41 -0
- package/dist/lib/permissions.js.map +1 -0
- package/dist/lib/progress.d.ts +29 -0
- package/dist/lib/progress.d.ts.map +1 -0
- package/dist/lib/progress.js +86 -0
- package/dist/lib/progress.js.map +1 -0
- package/dist/lib/public-channels.d.ts +4 -0
- package/dist/lib/public-channels.d.ts.map +1 -0
- package/dist/lib/public-channels.js +32 -0
- package/dist/lib/public-channels.js.map +1 -0
- package/dist/lib/refs.d.ts +62 -0
- package/dist/lib/refs.d.ts.map +1 -0
- package/dist/lib/refs.js +378 -0
- package/dist/lib/refs.js.map +1 -0
- package/dist/lib/search-api.d.ts +25 -0
- package/dist/lib/search-api.d.ts.map +1 -0
- package/dist/lib/search-api.js +93 -0
- package/dist/lib/search-api.js.map +1 -0
- package/dist/lib/search-helpers.d.ts +32 -0
- package/dist/lib/search-helpers.d.ts.map +1 -0
- package/dist/lib/search-helpers.js +183 -0
- package/dist/lib/search-helpers.js.map +1 -0
- package/dist/lib/skills/content.d.ts +8 -0
- package/dist/lib/skills/content.d.ts.map +1 -0
- package/dist/lib/skills/content.js +410 -0
- package/dist/lib/skills/content.js.map +1 -0
- package/dist/lib/skills/create-installer.d.ts +9 -0
- package/dist/lib/skills/create-installer.d.ts.map +1 -0
- package/dist/lib/skills/create-installer.js +65 -0
- package/dist/lib/skills/create-installer.js.map +1 -0
- package/dist/lib/skills/index.d.ts +7 -0
- package/dist/lib/skills/index.d.ts.map +1 -0
- package/dist/lib/skills/index.js +54 -0
- package/dist/lib/skills/index.js.map +1 -0
- package/dist/lib/skills/types.d.ts +30 -0
- package/dist/lib/skills/types.d.ts.map +1 -0
- package/dist/lib/skills/types.js +2 -0
- package/dist/lib/skills/types.js.map +1 -0
- package/dist/lib/skills/update-installed.d.ts +9 -0
- package/dist/lib/skills/update-installed.d.ts.map +1 -0
- package/dist/lib/skills/update-installed.js +20 -0
- package/dist/lib/skills/update-installed.js.map +1 -0
- package/dist/lib/spinner.d.ts +3 -0
- package/dist/lib/spinner.d.ts.map +1 -0
- package/dist/lib/spinner.js +10 -0
- package/dist/lib/spinner.js.map +1 -0
- package/dist/lib/threads.d.ts +4 -0
- package/dist/lib/threads.d.ts.map +1 -0
- package/dist/lib/threads.js +6 -0
- package/dist/lib/threads.js.map +1 -0
- package/dist/lib/update.d.ts +13 -0
- package/dist/lib/update.d.ts.map +1 -0
- package/dist/lib/update.js +23 -0
- package/dist/lib/update.js.map +1 -0
- package/dist/lib/user-records.d.ts +15 -0
- package/dist/lib/user-records.d.ts.map +1 -0
- package/dist/lib/user-records.js +84 -0
- package/dist/lib/user-records.js.map +1 -0
- package/dist/lib/validation.d.ts +2 -0
- package/dist/lib/validation.d.ts.map +1 -0
- package/dist/lib/validation.js +7 -0
- package/dist/lib/validation.js.map +1 -0
- package/dist/postinstall.d.ts +2 -0
- package/dist/postinstall.d.ts.map +1 -0
- package/dist/postinstall.js +4 -0
- package/dist/postinstall.js.map +1 -0
- package/package.json +77 -8
- package/scripts/check-skill-sync.js +40 -0
- package/scripts/postinstall.js +12 -0
- package/scripts/sync-skill.js +29 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## 1.0.0 (2026-05-25)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- add channel create and update commands ([#4](https://github.com/Doist/comms-cli/issues/4)) ([f097378](https://github.com/Doist/comms-cli/commit/f097378ed4dfa3c743ec33b31665d30bb4eae60c))
|
|
6
|
+
- adopt cli-core DCR provider + account command attachers ([#5](https://github.com/Doist/comms-cli/issues/5)) ([4749a07](https://github.com/Doist/comms-cli/commit/4749a0707a798a5bd6c1ff2f6194553d9454ffef))
|
|
7
|
+
- bootstrap Comms CLI from twist-cli ([ea28735](https://github.com/Doist/comms-cli/commit/ea28735784af503e9275b2ff14b6a31d1f5f19d7))
|
|
8
|
+
- upgrade to @doist/comms-sdk@0.2.0 ([#2](https://github.com/Doist/comms-cli/issues/2)) ([ae4d6e1](https://github.com/Doist/comms-cli/commit/ae4d6e1de901d027dcbf8ed441597f1e36a25139))
|
package/README.md
CHANGED
|
@@ -1,45 +1,181 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="icons/comms-cli.png" alt="Comms CLI" width="150" height="150" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
# Comms CLI
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
A command-line interface for Comms.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
## Installation
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
> ```bash
|
|
12
|
+
> npm install -g @doist/comms-cli
|
|
13
|
+
> ```
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
1. Configure OIDC trusted publishing for the package name `@doist/comms-cli`
|
|
13
|
-
2. Enable secure, token-less publishing from CI/CD workflows
|
|
14
|
-
3. Establish provenance for packages published under this name
|
|
15
|
+
### Agent Skills
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
Install skills for your coding agent:
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
```bash
|
|
20
|
+
tdc skill install claude-code
|
|
21
|
+
tdc skill install codex
|
|
22
|
+
tdc skill install cursor
|
|
23
|
+
tdc skill install gemini
|
|
24
|
+
tdc skill install pi
|
|
25
|
+
tdc skill install universal
|
|
26
|
+
```
|
|
19
27
|
|
|
20
|
-
|
|
28
|
+
Skills are installed to `~/<agent-dir>/skills/comms-cli/SKILL.md` (e.g. `~/.claude/` for claude-code, `~/.agents/` for universal, etc.). When updating the CLI, installed skills are updated automatically. The `universal` agent is compatible with Amp, OpenCode, and other agents that read from `~/.agents/`.
|
|
21
29
|
|
|
22
|
-
|
|
30
|
+
```bash
|
|
31
|
+
tdc skill list
|
|
32
|
+
tdc skill uninstall <agent>
|
|
33
|
+
```
|
|
23
34
|
|
|
24
|
-
|
|
25
|
-
2. Configure the trusted publisher (e.g., GitHub Actions)
|
|
26
|
-
3. Specify the repository and workflow that should be allowed to publish
|
|
27
|
-
4. Use the configured workflow to publish your actual package
|
|
35
|
+
## Uninstallation
|
|
28
36
|
|
|
29
|
-
|
|
37
|
+
First, remove any installed agent skills:
|
|
30
38
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- Should not be installed as a dependency
|
|
35
|
-
- Exists only for administrative purposes
|
|
39
|
+
```bash
|
|
40
|
+
tdc skill uninstall <agent>
|
|
41
|
+
```
|
|
36
42
|
|
|
37
|
-
|
|
43
|
+
Then uninstall the CLI:
|
|
38
44
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
```bash
|
|
46
|
+
npm uninstall -g @doist/comms-cli
|
|
47
|
+
```
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
## Local Setup
|
|
44
50
|
|
|
45
|
-
|
|
51
|
+
```bash
|
|
52
|
+
git clone https://github.com/Doist/comms-cli.git
|
|
53
|
+
cd comms-cli
|
|
54
|
+
npm install
|
|
55
|
+
npm run build
|
|
56
|
+
npm link
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This makes the `tdc` command available globally.
|
|
60
|
+
|
|
61
|
+
## Setup
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
tdc auth login
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
This opens your browser to authenticate with Comms. Once approved, the token is stored in your OS credential manager:
|
|
68
|
+
|
|
69
|
+
- macOS: Keychain
|
|
70
|
+
- Windows: Credential Manager
|
|
71
|
+
- Linux: Secret Service/libsecret
|
|
72
|
+
|
|
73
|
+
If secure storage is unavailable, the CLI warns and falls back to `~/.config/comms-cli/config.json`. Non-secret settings such as the current workspace remain in the config file.
|
|
74
|
+
|
|
75
|
+
### Alternative methods
|
|
76
|
+
|
|
77
|
+
**Manual token:**
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
tdc auth token
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The CLI prompts for the token without echoing it. Do **not** pass the token as a positional argument — it would be visible in `ps` / shell history.
|
|
84
|
+
|
|
85
|
+
**Environment variable:**
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
export COMMS_API_TOKEN="your-token"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`COMMS_API_TOKEN` always takes priority over the stored token.
|
|
92
|
+
|
|
93
|
+
### Staging / alternate hosts
|
|
94
|
+
|
|
95
|
+
Point the CLI at a non-production Comms instance with `COMMS_BASE_URL`:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
export COMMS_BASE_URL=https://comms.staging.todoist.com
|
|
99
|
+
export COMMS_API_TOKEN=<staging-token>
|
|
100
|
+
tdc user
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The base URL is threaded through both the SDK and the search endpoint. You need a token issued by that environment — production tokens are rejected.
|
|
104
|
+
|
|
105
|
+
### Auth commands
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
tdc auth status # check if authenticated
|
|
109
|
+
tdc auth logout # remove saved token
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Usage
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
tdc inbox # inbox threads
|
|
116
|
+
tdc inbox --unread # unread threads only
|
|
117
|
+
tdc mentions # content mentioning you
|
|
118
|
+
tdc mentions --since 2026-04-01 --all --json
|
|
119
|
+
tdc thread view <ref> # view thread with comments
|
|
120
|
+
tdc thread view <ref> --comment 123 # view a specific comment
|
|
121
|
+
tdc thread reply <ref> # reply to a thread
|
|
122
|
+
tdc thread rename <ref> "New title" # rename a thread
|
|
123
|
+
tdc thread update <ref> "New body" # edit a thread's body (first post)
|
|
124
|
+
tdc conversation unread # list unread conversations
|
|
125
|
+
tdc conversation view <ref> # view conversation messages
|
|
126
|
+
tdc msg view <ref> # view a conversation message
|
|
127
|
+
tdc search "keyword" # search across workspace
|
|
128
|
+
tdc search "keyword" --all # fetch all result pages
|
|
129
|
+
tdc react thread <ref> 👍 # add reaction
|
|
130
|
+
tdc away # show away status
|
|
131
|
+
tdc away set vacation 2026-03-20 # set away until date
|
|
132
|
+
tdc away clear # clear away status
|
|
133
|
+
tdc groups # list groups in a workspace
|
|
134
|
+
tdc groups view <ref> # show a group with members
|
|
135
|
+
tdc groups create "Frontend" # create a group
|
|
136
|
+
tdc groups create "FE" --users alice@doist.com,bob@doist.com
|
|
137
|
+
tdc groups rename <ref> "New name" # rename a group
|
|
138
|
+
tdc groups delete <ref> --yes # delete a group
|
|
139
|
+
tdc groups add-user <ref> alice@doist.com bob@doist.com
|
|
140
|
+
tdc groups remove-user <ref> id:123,id:456
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
References accept IDs (`123` or `id:123`), Comms URLs, or fuzzy names (for workspaces/users).
|
|
144
|
+
|
|
145
|
+
Run `tdc --help` or `tdc <command> --help` for more options.
|
|
146
|
+
|
|
147
|
+
## Shell Completions
|
|
148
|
+
|
|
149
|
+
Tab completion is available for bash, zsh, and fish:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
tdc completion install # prompts for shell
|
|
153
|
+
tdc completion install bash # or: zsh, fish
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Restart your shell or source your config file to activate. To remove:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
tdc completion uninstall
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Machine-readable output
|
|
163
|
+
|
|
164
|
+
All list/view commands support `--json` and `--ndjson` flags for scripting:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
tdc inbox --json # JSON array
|
|
168
|
+
tdc inbox --ndjson # newline-delimited JSON
|
|
169
|
+
tdc inbox --json --full # include all fields
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Development
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
npm install
|
|
176
|
+
npm run build # compile
|
|
177
|
+
npm run dev # watch mode
|
|
178
|
+
npm run type-check # type check
|
|
179
|
+
npm run format # format code
|
|
180
|
+
npm test # run tests
|
|
181
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/account/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA0BnC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2F7D"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { emitView } from '@doist/cli-core';
|
|
2
|
+
import { attachAccountCurrentCommand, attachAccountListCommand, attachAccountRemoveCommand, attachAccountUseCommand, } from '@doist/cli-core/auth';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { createCommsTokenStore, isManualTokenAccount, } from '../../lib/auth-provider.js';
|
|
5
|
+
import { TOKEN_ENV_VAR } from '../../lib/auth.js';
|
|
6
|
+
import { CliError } from '../../lib/errors.js';
|
|
7
|
+
import { logStoredTokenRemoval } from '../auth/helpers.js';
|
|
8
|
+
/**
|
|
9
|
+
* Hide identity-less manual-token snapshots (from `tdc auth token`) from `list`:
|
|
10
|
+
* they can't be the target of `use` / `remove` and would render as blank
|
|
11
|
+
* id/label rows. `account current` surfaces the active manual-token state
|
|
12
|
+
* separately via its renderers. cli-core's list attacher reads the roster
|
|
13
|
+
* through the store, so the filter lives in a store wrapper.
|
|
14
|
+
*/
|
|
15
|
+
function hideManualTokens(store) {
|
|
16
|
+
return Object.assign(Object.create(store), {
|
|
17
|
+
async list() {
|
|
18
|
+
const records = await store.list();
|
|
19
|
+
return records.filter(({ account }) => !isManualTokenAccount(account));
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export function registerAccountCommand(program) {
|
|
24
|
+
const account = program.command('account').description('Manage stored CLI accounts');
|
|
25
|
+
const store = createCommsTokenStore();
|
|
26
|
+
attachAccountListCommand(account, {
|
|
27
|
+
store: hideManualTokens(store),
|
|
28
|
+
description: 'List stored CLI accounts',
|
|
29
|
+
renderText: (ctx) => {
|
|
30
|
+
if (ctx.accounts.length === 0) {
|
|
31
|
+
return 'No stored accounts. Run `tdc auth login` to add one.';
|
|
32
|
+
}
|
|
33
|
+
const lines = [`Stored accounts (${ctx.accounts.length}):`];
|
|
34
|
+
for (const { account: acc, isDefault } of ctx.accounts) {
|
|
35
|
+
const marker = isDefault ? chalk.green('*') : ' ';
|
|
36
|
+
lines.push(` ${marker} ${chalk.dim(`id:${acc.id}`)} ${acc.label}`);
|
|
37
|
+
}
|
|
38
|
+
const def = ctx.accounts.find((entry) => entry.isDefault);
|
|
39
|
+
if (def) {
|
|
40
|
+
lines.push(`Default: ${chalk.dim(`id:${def.account.id}`)} ${def.account.label}`);
|
|
41
|
+
}
|
|
42
|
+
return lines;
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
attachAccountUseCommand(account, {
|
|
46
|
+
store,
|
|
47
|
+
description: 'Set the default stored account (id, id:<n>, or display name)',
|
|
48
|
+
});
|
|
49
|
+
attachAccountRemoveCommand(account, {
|
|
50
|
+
store,
|
|
51
|
+
description: 'Remove a stored account (clears keyring + config entry)',
|
|
52
|
+
onRemoved: (ctx) => logStoredTokenRemoval(store, ctx.view),
|
|
53
|
+
});
|
|
54
|
+
// env-token sessions resolve as `null` from `store.activeAccount()` (see
|
|
55
|
+
// auth-provider.ts), so the env notice lives in `onNotAuthenticated` — the
|
|
56
|
+
// one async hook. A manual-token snapshot stays a resolved account and is
|
|
57
|
+
// special-cased in the renderers; a real account renders as `config`.
|
|
58
|
+
attachAccountCurrentCommand(account, {
|
|
59
|
+
store,
|
|
60
|
+
description: 'Show the currently active account (honours COMMS_API_TOKEN)',
|
|
61
|
+
renderText: ({ account: acc }) => {
|
|
62
|
+
if (isManualTokenAccount(acc)) {
|
|
63
|
+
return [
|
|
64
|
+
'Active token saved via `tdc auth token` (no associated identity).',
|
|
65
|
+
chalk.dim('Run `tdc auth login` to attach an account to the token.'),
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
const lines = [
|
|
69
|
+
`Active account: ${chalk.dim(`id:${acc.id}`)} ${acc.label}`,
|
|
70
|
+
` Mode: ${acc.authMode}`,
|
|
71
|
+
];
|
|
72
|
+
if (acc.authScope)
|
|
73
|
+
lines.push(` Scope: ${acc.authScope}`);
|
|
74
|
+
return lines;
|
|
75
|
+
},
|
|
76
|
+
renderJson: ({ account: acc }) => isManualTokenAccount(acc)
|
|
77
|
+
? { source: 'token-only' }
|
|
78
|
+
: {
|
|
79
|
+
id: acc.id,
|
|
80
|
+
label: acc.label,
|
|
81
|
+
authMode: acc.authMode,
|
|
82
|
+
authScope: acc.authScope || undefined,
|
|
83
|
+
source: 'config',
|
|
84
|
+
},
|
|
85
|
+
async onNotAuthenticated({ view }) {
|
|
86
|
+
if (process.env[TOKEN_ENV_VAR]) {
|
|
87
|
+
emitView(view, { source: 'env' }, () => [
|
|
88
|
+
`Active token sourced from environment variable ${TOKEN_ENV_VAR} (no stored account).`,
|
|
89
|
+
]);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
throw new CliError('NO_TOKEN', 'No stored account is currently active.', [
|
|
93
|
+
'Run: tdc auth login',
|
|
94
|
+
]);
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
account._defaultCommandName = 'list';
|
|
98
|
+
account.addHelpText('after', `
|
|
99
|
+
Examples:
|
|
100
|
+
tdc account # list stored accounts (default subcommand)
|
|
101
|
+
tdc account use "Alan Grant" # pin Alan as the default account (id, id:N, or name)
|
|
102
|
+
tdc account remove id:42 # forget id:42 (clears keyring + config entry)`);
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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A;gBACF,OAAM;YACV,CAAC;YACD,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,wCAAwC,EAAE;gBACrE,qBAAqB;aACxB,CAAC,CAAA;QACN,CAAC;KACJ,CAAC,CAID;IAAC,OAAsD,CAAC,mBAAmB,GAAG,MAAM,CAAA;IAErF,OAAO,CAAC,WAAW,CACf,OAAO,EACP;;;;mFAI2E,CAC9E,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TokenStorageResult } from '@doist/cli-core/auth';
|
|
2
|
+
/**
|
|
3
|
+
* Surface a `TokenStorageResult` from a save/clear operation: the
|
|
4
|
+
* human-readable confirmation goes to stdout, any keyring-fallback warning
|
|
5
|
+
* goes to stderr. Pass `isMachineOutput: true` when the command is in
|
|
6
|
+
* `--json` / `--ndjson` mode so the stdout confirmation is suppressed and
|
|
7
|
+
* the warning still reaches the operator on stderr.
|
|
8
|
+
*/
|
|
9
|
+
export declare function logTokenStorageResult(result: TokenStorageResult, secureStoreMessage: string, isMachineOutput?: boolean): void;
|
|
10
|
+
/**
|
|
11
|
+
* Surface the result of a token-store `clear()` (stashed on the adapter via
|
|
12
|
+
* `getLastClearResult`, since cli-core's `clear` can't return it directly).
|
|
13
|
+
* Shared by `auth logout`'s `onCleared` and `account remove`'s `onRemoved` so
|
|
14
|
+
* the confirmation/warning UX can't drift between the two.
|
|
15
|
+
*/
|
|
16
|
+
export declare function logStoredTokenRemoval(store: {
|
|
17
|
+
getLastClearResult(): TokenStorageResult | undefined;
|
|
18
|
+
}, view: {
|
|
19
|
+
json?: boolean;
|
|
20
|
+
ndjson?: boolean;
|
|
21
|
+
}): void;
|
|
22
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAG9D;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACjC,MAAM,EAAE,kBAAkB,EAC1B,kBAAkB,EAAE,MAAM,EAC1B,eAAe,UAAQ,GACxB,IAAI,CAON;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACjC,KAAK,EAAE;IAAE,kBAAkB,IAAI,kBAAkB,GAAG,SAAS,CAAA;CAAE,EAC/D,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAC3C,IAAI,CAQN"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
/**
|
|
3
|
+
* Surface a `TokenStorageResult` from a save/clear operation: the
|
|
4
|
+
* human-readable confirmation goes to stdout, any keyring-fallback warning
|
|
5
|
+
* goes to stderr. Pass `isMachineOutput: true` when the command is in
|
|
6
|
+
* `--json` / `--ndjson` mode so the stdout confirmation is suppressed and
|
|
7
|
+
* the warning still reaches the operator on stderr.
|
|
8
|
+
*/
|
|
9
|
+
export function logTokenStorageResult(result, secureStoreMessage, isMachineOutput = false) {
|
|
10
|
+
if (!isMachineOutput && result.storage === 'secure-store') {
|
|
11
|
+
console.log(chalk.dim(secureStoreMessage));
|
|
12
|
+
}
|
|
13
|
+
if (result.warning) {
|
|
14
|
+
console.error(chalk.yellow('Warning:'), result.warning);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Surface the result of a token-store `clear()` (stashed on the adapter via
|
|
19
|
+
* `getLastClearResult`, since cli-core's `clear` can't return it directly).
|
|
20
|
+
* Shared by `auth logout`'s `onCleared` and `account remove`'s `onRemoved` so
|
|
21
|
+
* the confirmation/warning UX can't drift between the two.
|
|
22
|
+
*/
|
|
23
|
+
export function logStoredTokenRemoval(store, view) {
|
|
24
|
+
const result = store.getLastClearResult();
|
|
25
|
+
if (!result)
|
|
26
|
+
return;
|
|
27
|
+
logTokenStorageResult(result, 'Stored token removed from the system credential manager', view.json || view.ndjson);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/commands/auth/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACjC,MAA0B,EAC1B,kBAA0B,EAC1B,eAAe,GAAG,KAAK;IAEvB,IAAI,CAAC,eAAe,IAAI,MAAM,CAAC,OAAO,KAAK,cAAc,EAAE,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAA;IAC9C,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IAC3D,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACjC,KAA+D,EAC/D,IAA0C;IAE1C,MAAM,MAAM,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAA;IACzC,IAAI,CAAC,MAAM;QAAE,OAAM;IACnB,qBAAqB,CACjB,MAAM,EACN,yDAAyD,EACzD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,CAC3B,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAUnC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0B1D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { attachTokenViewCommand } from '@doist/cli-core/auth';
|
|
2
|
+
import { createCommsTokenStore } from '../../lib/auth-provider.js';
|
|
3
|
+
import { TOKEN_ENV_VAR } from '../../lib/auth.js';
|
|
4
|
+
import { getRequestedUserRef } from '../../lib/global-args.js';
|
|
5
|
+
import { attachCommsLoginCommand } from './login.js';
|
|
6
|
+
import { attachCommsLogoutCommand } from './logout.js';
|
|
7
|
+
import { attachCommsStatusCommand } from './status.js';
|
|
8
|
+
import { withUserRefAware } from './store-wrap.js';
|
|
9
|
+
import { loginWithToken } from './token.js';
|
|
10
|
+
export function registerAuthCommand(program) {
|
|
11
|
+
const auth = program.command('auth').description('Manage authentication');
|
|
12
|
+
const store = createCommsTokenStore();
|
|
13
|
+
const refAware = withUserRefAware(store, getRequestedUserRef());
|
|
14
|
+
attachCommsLoginCommand(auth, store);
|
|
15
|
+
attachCommsLogoutCommand(auth, refAware);
|
|
16
|
+
attachCommsStatusCommand(auth, refAware);
|
|
17
|
+
// `token` is a hybrid: bare `tdc auth token` prompts interactively to save
|
|
18
|
+
// a token, and the `view` subcommand prints it. Tokens are never accepted
|
|
19
|
+
// as positional/CLI arguments — that would leak them via process lists
|
|
20
|
+
// and shell history (Doist Secrets Management Standard).
|
|
21
|
+
const tokenCmd = auth
|
|
22
|
+
.command('token')
|
|
23
|
+
.description('Save API token for CLI authentication (or use a subcommand: `view`)')
|
|
24
|
+
.action(() => loginWithToken());
|
|
25
|
+
attachTokenViewCommand(tokenCmd, {
|
|
26
|
+
name: 'view',
|
|
27
|
+
store: refAware,
|
|
28
|
+
envVarName: TOKEN_ENV_VAR,
|
|
29
|
+
description: 'Print the stored API token for the active user (or --user <ref>) to stdout for use in scripts',
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,EAGH,KAAK,eAAe,EACvB,MAAM,4BAA4B,CAAA;AAKnC,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CA0BxF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { attachLoginCommand } from '@doist/cli-core/auth';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { renderError, renderSuccess } from '../../lib/auth-pages.js';
|
|
4
|
+
import { createCommsAuthProvider, getScopes, } from '../../lib/auth-provider.js';
|
|
5
|
+
import { logTokenStorageResult } from './helpers.js';
|
|
6
|
+
const PREFERRED_CALLBACK_PORT = 8766;
|
|
7
|
+
export function attachCommsLoginCommand(parent, store) {
|
|
8
|
+
const provider = createCommsAuthProvider();
|
|
9
|
+
return attachLoginCommand(parent, {
|
|
10
|
+
provider,
|
|
11
|
+
store,
|
|
12
|
+
preferredPort: PREFERRED_CALLBACK_PORT,
|
|
13
|
+
resolveScopes: ({ readOnly }) => getScopes(readOnly),
|
|
14
|
+
renderSuccess,
|
|
15
|
+
renderError,
|
|
16
|
+
onSuccess({ view, account }) {
|
|
17
|
+
const isMachineOutput = view.json || view.ndjson;
|
|
18
|
+
if (!isMachineOutput) {
|
|
19
|
+
console.log(chalk.green('✓'), 'OAuth authentication successful!');
|
|
20
|
+
console.log(chalk.dim(`Logged in as ${account.label}`));
|
|
21
|
+
}
|
|
22
|
+
const result = store.getLastStorageResult();
|
|
23
|
+
if (result) {
|
|
24
|
+
logTokenStorageResult(result, 'Token stored securely in the system credential manager', isMachineOutput);
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
}).description('Authenticate using OAuth (opens browser)');
|
|
28
|
+
}
|
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D,EACxD,eAAe,CAClB,CAAA;YACL,CAAC;QACL,CAAC;KACJ,CAAC,CAAC,WAAW,CAAC,0CAA0C,CAAC,CAAA;AAC9D,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
import type { CommsTokenStore } from '../../lib/auth-provider.js';
|
|
3
|
+
/**
|
|
4
|
+
* Attach `tdc auth logout` via cli-core's generic `attachLogoutCommand`. The
|
|
5
|
+
* registrar emits the success line (`✓ Logged out` / `{ok:true}` / silent
|
|
6
|
+
* ndjson); `onCleared` only surfaces the keyring-fallback warning carried by
|
|
7
|
+
* `TokenStorageResult` — cli-core's `TokenStore.clear: void` contract can't
|
|
8
|
+
* expose it directly, so we stash it on the adapter (`getLastClearResult`).
|
|
9
|
+
*/
|
|
10
|
+
export declare function attachCommsLogoutCommand(auth: Command, store: CommsTokenStore): Command;
|
|
11
|
+
//# sourceMappingURL=logout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/logout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAG/E;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAKvF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { attachLogoutCommand } from '@doist/cli-core/auth';
|
|
2
|
+
import { logStoredTokenRemoval } from './helpers.js';
|
|
3
|
+
/**
|
|
4
|
+
* Attach `tdc auth logout` via cli-core's generic `attachLogoutCommand`. The
|
|
5
|
+
* registrar emits the success line (`✓ Logged out` / `{ok:true}` / silent
|
|
6
|
+
* ndjson); `onCleared` only surfaces the keyring-fallback warning carried by
|
|
7
|
+
* `TokenStorageResult` — cli-core's `TokenStore.clear: void` contract can't
|
|
8
|
+
* expose it directly, so we stash it on the adapter (`getLastClearResult`).
|
|
9
|
+
*/
|
|
10
|
+
export function attachCommsLogoutCommand(auth, store) {
|
|
11
|
+
return attachLogoutCommand(auth, {
|
|
12
|
+
store,
|
|
13
|
+
onCleared: ({ view }) => logStoredTokenRemoval(store, view),
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=logout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../src/commands/auth/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAG1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAEpD;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAa,EAAE,KAAsB;IAC1E,OAAO,mBAAmB,CAAe,IAAI,EAAE;QAC3C,KAAK;QACL,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC;KAC9D,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
import type { CommsTokenStore } from '../../lib/auth-provider.js';
|
|
3
|
+
/**
|
|
4
|
+
* Attach `tdc auth status` via cli-core's generic `attachStatusCommand`.
|
|
5
|
+
*
|
|
6
|
+
* `CommsTokenStore.active()` returns a snapshot whenever a token resolves
|
|
7
|
+
* (per the adapter's documented contract — see `auth-provider.ts`), so
|
|
8
|
+
* `fetchLive` covers every token-present path: secure-store, plaintext
|
|
9
|
+
* config fallback, env-token mode, and manual `tdc auth token`. The
|
|
10
|
+
* snapshot's token is reused inside `gatherStatusData` so credentials are
|
|
11
|
+
* read once per invocation. `onNotAuthenticated` only fires when nothing
|
|
12
|
+
* is stored — it throws `NoTokenError` so the standard CliError envelope
|
|
13
|
+
* reaches the operator unchanged.
|
|
14
|
+
*/
|
|
15
|
+
export declare function attachCommsStatusCommand(auth: Command, store: CommsTokenStore): Command;
|
|
16
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/status.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAiE/E;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CA+BvF"}
|