Skip to content

Normalize --index-name flag and shorthand conventions#92

Merged
austin-denoble merged 2 commits into
mainfrom
adenoble/clean-up-flags
Jun 8, 2026
Merged

Normalize --index-name flag and shorthand conventions#92
austin-denoble merged 2 commits into
mainfrom
adenoble/clean-up-flags

Conversation

@austin-denoble

@austin-denoble austin-denoble commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Problem

The CLI had two different flag names for the same concept depending on context. Core index lifecycle commands (describe, delete, configure) used --name to identify the index, while every other command that operated on an index (vector ops, imports, namespaces, backups, stats) used --index-name. This meant users had to remember which "mode" they were in, and made scripting inconsistent.

A secondary issue: --index-name had -n as its shorthand on most commands, which doesn't correspond to the first letter of either word in the flag name and conflicted with the mental model that -n = --name.

Solution

Introduce a clear semantic split enforced uniformly across all index subcommands:

  • --index-name (-i) — always refers to an existing index being operated on
  • --name (-n) — always names a resource being created or labeled (new index, backup name, namespace name, etc.)

Changes by group

index describe, index delete, index configure (breaking for these three):

  • Primary flag renamed from --name to --index-name with shorthand -i
  • --name / -n kept as a deprecated alias via MarkDeprecated — prints a warning but continues to work, validated via PreRunE so either flag satisfies the required check
  • Example strings and post-success hints updated to use --index-name

All other --index-name commands (stats, vector/*, record/*, import/*, namespace/*, backup/*):

  • Shorthand changed from -n to -i to match the new convention

--id on vector query, import cancel, import describe:

  • Shorthand -i removed to free it up for --index-name; these flags take UUIDs that are always pasted, not typed, so the shorthand had no ergonomic value, alongside being 2 fewer characters than the full flag.

Type of Change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Test Plan

  • just test-unit passes
  • Manually verify deprecated alias: pc index describe --name <idx> should print a deprecation warning and still return results
  • Manually verify new flag: pc index describe --index-name <idx> and pc index describe -i <idx> work as expected
  • e2e suite updated to use --index-name on all describe/delete calls

Introduce a semantic split: --index-name (-i) always refers to an existing index; --name always names a resource being created. Apply this consistently across all index subcommands.

- describe/delete/configure: rename --name to --index-name (-i); keep --name (-n) as a deprecated alias for the transition period
- All other --index-name flags: drop the -n shorthand in favor of -i
- Remove -i from --id on vector query and import cancel/describe to free up -i for --index-name

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 91d709d. Configure here.

Comment thread internal/pkg/cli/command/index/vector/fetch.go
@austin-denoble austin-denoble merged commit 31f652c into main Jun 8, 2026
8 checks passed
@austin-denoble austin-denoble deleted the adenoble/clean-up-flags branch June 8, 2026 23:45
@austin-denoble austin-denoble mentioned this pull request Jun 9, 2026
4 tasks
austin-denoble added a commit that referenced this pull request Jun 9, 2026
## Problem

`AGENTS.md` and `README.md` were last updated before several significant
PRs landed (#84#92) and still carried public-preview language, stale
command references, and large gaps in coverage.

## Solution

**`README.md`**
- Removed the public-preview warning banner
- Fixed two legacy `pc config set-api-key` references → `pc config set
api-key`
- Fixed `pc index upsert` → `pc index vector upsert` in the
working-with-data intro
- Expanded the data-plane overview: reorganized `pc index vector`
commands under a "dense/sparse vectors" subheading, added `pc index
record` (integrated indexes) and `pc index namespace` entries
- Added a new "Index management commands" section covering `pc index
backup`, `pc index restore`, `pc index import`, and `pc index
collection`

**`AGENTS.md`**
- Removed "public preview" from the project description
- Corrected the VectorDB root group (collection/backup/restore now live
under `pc index`, not at the root)
- Added `pc index` internal subgroup table (Data, Namespace, Index
Management including the new `import`)
- Documented the canonical `pc config` key-based interface
(`get`/`set`/`unset`/`list`/`describe`)
- Added `scripts/` to the key directories table
- Added a new "Patterns for writing commands" section covering:
output/error/exit packages (`msg`, `style`, `exit`, `text`), help-text
helpers, custom JSON flag types, the narrow-interface testability
pattern, target org/project access, and logging
- Added a "Notable environment variables" table (`PINECONE_API_KEY`,
`PINECONE_ENVIRONMENT`, `PINECONE_LOG_LEVEL`,
`PINECONE_CLI_MAX_JSON_BYTES`)

## Type of Change
- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [X] Non-code change (docs, etc)
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.

1 participant