Skip to content

[ARI-2159] CLI → Move to @team-plain/graphql and release 1.0.0 - #34

Merged
revett merged 2 commits into
mainfrom
ari-2159-cli-move-off-the-deprecated-sdk-and-release-100
Oct 7, 2026
Merged

revett merged 2 commits into
mainfrom
ari-2159-cli-move-off-the-deprecated-sdk-and-release-100

Conversation

@revett

@revett revett commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Resolves ARI-2159

Problem

  • The CLI depends on @team-plain/typescript-sdk, which is deprecated
  • The README and --help say the API key needs indexedDocument:create, but the API checks knowledgeSource:create, so keys set up by following them can't create knowledge sources
  • No Node.js version is declared, there are no tests, and auth or network failures would surface as raw unhandled errors

Changes

  • Swap to @team-plain/graphql, the same client team-plain/sdk publishes, and move to the latest commander
  • Convert the CLI to ESM and require Node.js 22.12 or later through engines
  • Fix the permission in --help and the README, and point the success message at the current knowledge sources docs
  • Print every failure as one line with the error code, and exit 1
  • Add node:test tests that run the real CLI against a mock API, on Node.js 22.12.0, 22 and 24 in CI
  • Ship only src in the npm package; it previously included workflows and config
  • Refresh the README with a CI example that pins @team-plain/cli@1, and add a major changeset for 1.0.0

Why

  • Node.js 22.12 rather than 24 keeps Node 22 users working, including Plain's own docs indexing, which installs @latest on Node 22
  • The tests lock in the commands, flags and output customers rely on, so future SDK and commander bumps from Dependabot are checked before they merge
  • The npm trusted publisher for @team-plain/cli must be set up before the Version Packages PR from this merges, or the publish fails

Note

Medium Risk
Major breaking release (Node minimum, ESM, SDK API) affects all CLI installs and CI; behavior changes are covered by new integration tests but customers on Node 18/20 or old permission names must migrate.

Overview
Major 1.0 release that replaces the deprecated @team-plain/typescript-sdk with @team-plain/graphql, bumps commander to v15, and converts the CLI to ESM with engines.node ≥ 22.12.0.

Indexing commands now call PlainClient.mutation.createKnowledgeSource via a shared helper, with failures emitted as a single stderr line (message + error code, no request ID or stack). Docs and --help now require knowledgeSource:create instead of the incorrect indexedDocument:create, and success messages link to the current knowledge-sources docs.

CI runs node --test on Node 22.12.0, 22, and 24 after packing the CLI; the npm tarball is limited to src. README adds a pinned @team-plain/cli@1 CI example.

Reviewed by Cursor Bugbot for commit fb3faf6. Bugbot is set up for automated code reviews on this repo. Configure here.

@socket-security

socket-security Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​team-plain/​graphql@​3.2.07210010099100
Updatedcommander@​12.1.0 ⏵ 15.0.0100100100 +184100

View full report

@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High risk] Replaces core SDK dependency and bumps Node.js requirement.

The PR appears safe to merge; the previous test-path issue is fixed and no new blocking issue was found.

What we checked:

  • Tests in spaced checkout paths: fileURLToPath converts the file URL into a filesystem path before spawn passes it to Node.

Reviews (2) · Last reviewed commit: "Address comment" · Reviewed by Greptile

Comment thread test/cli.test.js Outdated
@revett
revett requested a review from mpsq October 7, 2026 13:49
@revett revett mentioned this pull request Oct 7, 2026

@mpsq mpsq left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@revett
revett merged commit 1f7051a into main Oct 7, 2026
11 checks passed
@revett
revett deleted the ari-2159-cli-move-off-the-deprecated-sdk-and-release-100 branch October 7, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants