Add pc index import command group#91
Merged
Merged
Conversation
Implements start, describe, list, and cancel subcommands backed by IndexConnection.{StartImport,DescribeImport,ListImports,CancelImport}
ANSI escape bytes were inflating column widths in multi-column list tables, causing headers to misalign with data rows. Introduces printColorizedTable, which writes plain text to a buffered tabwriter for correct width calculation, then splices colorized values in at the column byte offsets read from the formatted header line. Updates PrintImportList, PrintBackupList, and PrintRestoreJobList to use it, and adds status colorization to the two backup list views which were missing it.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7bf60fa. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
The CLI has no support for bulk imports despite the Go SDK fully exposing them. Imports load vector data from a storage provider (S3, GCS, Azure) directly into a serverless index — a common data-loading path that currently requires dropping down to the API or SDK.
Solution
Adds
pc index importas a new subcommand group underpc index, alongside the existingbackup,restore, andcollectiongroups. Implements four subcommands backed byIndexConnection.{StartImport, DescribeImport, ListImports, CancelImport}.Fixes a tabwriter column alignment bug where ANSI color codes in status cells inflated column widths, causing headers to misalign with data rows in list views. Introduces
printColorizedTable, which buffers plain text through tabwriter for correct width calculation, then splices colorized values in at the byte offsets read from the formatted header line. Applies to import, backup, and restore job list tables.Commands
Start an import
Optional flags:
--error-mode continue|abort(default:continue),--integration-idfor private buckets.List imports for an index
Describe a specific import
Cancel an in-progress import
All commands support
--jsonfor machine-readable output.Notes
IndexConnection(requires the index host), unlikebackup/restorewhich are client-level operations. Each command resolves the host viasdk.NewIndexConnection.ImportServiceinterface is satisfied directly by*pinecone.IndexConnection— no adapter needed.Note
Medium Risk
New index data-loading operations can trigger large imports and cancel in-flight jobs; changes are mostly CLI/presentation with unit tests, but mistakes could affect production index data loads.
Overview
Adds
pc index importunder index management so users can start, describe, list, and cancel serverless bulk imports from storage URIs (with optional--integration-id,--error-mode, pagination, and--json). Commands use an index connection viasdk.NewIndexConnectionand a testableImportServicebacked by the Go SDK.Introduces
printColorizedTableso list tables can colorize status without breaking tab alignment; backup and restore job list output is switched to this helper, and new import list/detail presenters use it. Backup detail view drops the Metric row from the attribute table.Reviewed by Cursor Bugbot for commit 7bf60fa. Bugbot is set up for automated code reviews on this repo. Configure here.