ster pairs edit
Change one pair's sides, or the set's trait name, by the zero-based index remove takes.
Invocation and purpose#
ster pairs edit --pairs <PAIRS> --index <INDEX> [--positive <POSITIVE>] [--negative <NEGATIVE>] [--trait <TRAIT>]The counterpart of `ster pairs add` for one pair already in the set: only the sides given change, and the rest of the file is written back as it was. No model is loaded.
Inputs and options#
| Input | Required | Meaning |
|---|---|---|
--pairs <PAIRS> | yes | Existing pair-set JSON. |
--index <INDEX> | yes | Zero-based position of the pair, as `ster pairs inspect` reports it. |
--positive <POSITIVE> | no | New text of the positive side; must not be blank. |
--negative <NEGATIVE> | no | New text of the negative side; must not be blank. |
--trait <TRAIT> | no | Sets or replaces the set's trait_name. |
Output and state#
Rewrites the file as pretty-printed JSON with a trailing newline. Stdout is a pretty JSON document with path, pair_count, and edited carrying the index, positive, and negative of the pair as it now stands.
Refusals#
- An edit naming none of
--positive,--negativeand--traitis refused aspairs edit changes nothing without --positive, --negative or --trait(nothing-to-change, exit 2), and a side given as empty or whitespace-only text as--<side> is empty or only whitespace, and every pair needs text on both sides(side-empty, exit 2); both before the set is read. - The set is then loaded, so the load refusals apply:
failed to read pair set <PATH>,invalid pair set JSON in <PATH>,pair set <PATH> contains no pairs, andpair set <PATH> contains an empty positive or negative prompt. - An index at or past the end is refused as
pair index <N> is outside the set: <PATH> holds <COUNT> pair(s), indexed from 0(index-outside), naming the last index there is; the file is left untouched.