Skip to content

Add new API commands (1) - #101

Open
hi-rai wants to merge 1 commit into
mainfrom
dev/himanshu/add-new-api-commands-1
Open

hi-rai wants to merge 1 commit into
mainfrom
dev/himanshu/add-new-api-commands-1

Conversation

@hi-rai

@hi-rai hi-rai commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Adds CLI commands for new QA Sphere public API endpoints: folders, test cases, trash, tags, requirements, shared steps and preconditions, projects, AI rules and configurations. This is the first of a series; later PRs add the remaining commands.

Important

Wait for the next QA Sphere release before merging. Most of these commands call endpoints that aren't live yet.

Resource New commands
ai-rules list
configurations list, get, create, update, delete
folders get, tree, path, create, update, move, copy, delete
projects update, users list
requirements get, create, update, delete
shared-preconditions create, update, delete
shared-steps create, update, delete
tags create, update, rename, delete
test-cases get-version, rollback, move, copy, delete, update-priority, update-tags, update-requirements, results list
trash list, restore
Convention Example
One command per action; bulk actions take comma-separated IDs test-cases delete --tcase-ids 12,13
New resources take --<resource>-id; shared steps and preconditions keep --id, like their existing get configurations get --configuration-id <id>
--tcase-version, since --version is yargs' global flag test-cases rollback --tcase-id 12 --tcase-version 2
  • test-cases create/update gain --requirements, --links and --title-suffix-params, and create gains --pos, so every field can be set without --body.
  • The command trees in the README and skills/qas-cli/SKILL.md list each command's required options, with a note that every command sending a body also accepts --body or --body-file.
  • Every new command has mocked tests. The live-server tests need the new endpoints deployed.

🤖 Generated with Claude Code

Add CLI commands for the new public API endpoints for folders, test
cases, trash, tags, requirements, shared steps and preconditions,
projects, AI rules and configurations.

New commands:
- ai-rules list
- configurations list, get, create, update, delete
- folders get, tree, path, create, update, move, copy, delete
- projects update, users list
- requirements get, create, update, delete
- shared-preconditions create, update, delete
- shared-steps create, update, delete
- tags create, update, rename, delete
- test-cases get-version, rollback, move, copy, delete, update-priority,
  update-tags, update-requirements, results list
- trash list, restore

test-cases create and update gain --requirements, --links and
--title-suffix-params, and create gains --pos, so every field can be set
without --body.

Conventions:
- One command per action. Bulk actions take comma-separated IDs and call
  the multi-item endpoint (--tcase-ids, --folder-ids, --tag-ids).
- New resources take --<resource>-id; shared steps and preconditions keep
  --id, like their existing get.
- --tcase-version instead of --version, which is yargs' global flag.
- Helpers for integer ID params and comma-separated lists are shared in
  manifests/utils.ts.

The command trees in the README and the agent skill list each command's
required options, with a note that every command sending a body also
accepts --body or --body-file.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T10:33:29.181425Z 0cbd327 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@hi-rai
hi-rai requested a review from satvik007 October 20, 2026 10:30
@hi-rai hi-rai self-assigned this Oct 20, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0cbd327d20

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +39 to +41
export const intListSchema = z
.string()
.regex(/^\s*\d+\s*(,\s*\d+\s*)*$/, 'must be comma-separated positive integers')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject zero in positive-integer lists before auth

The regex accepts 0, despite describing positive integers. Consequently, commands such as tags delete --tag-ids 0 and folders delete --folder-ids 0 pass manifest validation and reach resolveAuth() before their API schemas reject the value; without configured credentials, users receive an authentication error instead of the argument error that should be reported first. Require each item to start with [1-9] so this validation happens before credential resolution.

AGENTS.md reference: AGENTS.md:L84-L88

Useful? React with 👍 / 👎.

Comment thread src/api/tcases.ts
Comment on lines +332 to +336
export const UpdateTCasesTagsRequestSchema = z.object({
tcaseIds: tcaseRefsSchema,
add: z.array(tagTitleSchema).optional(),
remove: z.array(tagTitleSchema).optional(),
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require an actual bulk tag or requirement change

When callers use --body, the manifest's requireTCaseIdsAndChange check returns immediately, while this schema accepts a request containing only tcaseIds; it also accepts empty add/remove arrays. Thus --body '{"tcaseIds":["12"]}' and --add '' can reach the bulk-update endpoint without any requested change, and UpdateTCasesRequirementsRequestSchema has the same defect. Refine both request schemas to require at least one non-empty change array so API-level request validation enforces the same contract as the CLI.

AGENTS.md reference: AGENTS.md:L96-L97

Useful? React with 👍 / 👎.

@satvik007 satvik007 added this to the 26W46 milestone Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants