Repository navigation
capy project create, delete and restore, with agent questions - #404
Merged
Merged
Conversation
…wser sign-in, and find secrets with capy secrets
…the human answers in chat
…ests for create-project
…ng what a branch is Agent mode: no name -> PROJECT_NAME_REQUIRED, name but no --branch -> BRANCH_NAME_REQUIRED; both exit 3 with one form asking for name and branch (branch default development, with a description). The branch name is checked against the service's rule first (BRANCH_NAME_INVALID). A project made without its branch is reported as BRANCH_CREATE_FAILED with the project.
…at matches nothing delete-project / restore-project: a name several projects share now asks which one (terminal: arrow-key list; agent: PROJECT_AMBIGUOUS exit 3 with a pick-one elicitation, options labelled name, variable count and how long ago it was created). --yes never chooses. A name that matches no project is refused with PROJECT_NOT_FOUND before anything is read or asked; an id still goes to the service. The agent line for deleting by name now holds even when this folder's own project is deleted.
…on ask, as for delete
…ents writes both AGENTS.md and CLAUDE.md The display table goes in the reply; the short question is asked as an elicitation with the agent's question tool (in chat only when there is none). capy agents now always writes the block to both AGENTS.md and CLAUDE.md, creating whichever is missing, since Claude Code reads CLAUDE.md.
… approved branch wording Same yes/no as capy checkout -b, in the terminal and as an elicitation field (options yes/no, default no); --protected yes|no; BRANCH_PROTECTION_REQUIRED / BRANCH_PROTECTION_INVALID. Each elicitation field can carry its own question. Branch question and description use Vince's approved wording.
…eate-project|delete-project|restore-project Never released (npm latest is 0.9.14), so no aliases. capy projects stays the listing command. org is back to switching organization only.
…ent mode for delete and restore; approved first-branch question in the terminal
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.
Adds
capy project create|delete|restore. Each one asks the human before it acts: in a terminal with a prompt, and for an agent with anelicitationthe agent puts to the human.What changes
New
capy projectcommand group.capy project create,capy project deleteandcapy project restorereplacecapy org delete-projectandcapy org restore-project, which never shipped in a release.capy projectsstill lists projects, andcapy org projects --deletedstill lists deleted ones.capy orgnow only switches organization.capy project create [name] --branch <name> --protected yes|no(new).elicitationholding only the missing fields (PROJECT_NAME_REQUIRED,BRANCH_NAME_REQUIREDorBRANCH_PROTECTION_REQUIRED), and thereruncommand to run with the answers.BRANCH_CREATE_FAILEDand still returns the project.--dry-runchecks the values and creates nothing.capy project delete <name-or-id>.--yes, an agent getsCONFIRMATION_REQUIRED(exit 3) with a confirmelicitationand changes nothing.--forcedeletes despite live deploy tokens.capy project restore <name-or-id>. Asks the same way: a yes/no prompt in a terminal, or a confirmelicitationfor an agent.--dry-runnames the project that would come back and restores nothing.A name shared by several projects. Delete and restore ask which one. A terminal shows an arrow list. An agent gets
PROJECT_AMBIGUOUS(exit 3) with a pick-one elicitation, whose options are each project's name, variable count and creation time ("created 3 days ago", once the service returnscreated_at). A name that matches nothing is refused withPROJECT_NOT_FOUND, and nothing is sent.Agent mode is
--json,--non-tty, or no terminal. It applies to all three commands. Theelicitationandcodecome back as JSON with--json; without it, the refusal is a message on stderr with the same exit code. In agent mode they never open a prompt, including the organization picker. With no organization in the folder and several to choose from, they exit 3 withORG_SELECTION_REQUIRED.Agent instructions (the AGENTS.md block and
capy help --json):elicitation, put itsdisplaytable in the reply, then ask with the agent's question tool, one question per field. Ask in chat only when there is no question tool.--yeson its own.PROJECT_DELETEDmeans stop and point the human atcapy project restore <id>. This concerns the folder's own project only, never a delete or restore asked for by name.capy info --json. Stop on a browser sign-in. Look up a secret withcapy secrets --json --name NAME.capy agentswrites both AGENTS.md and CLAUDE.md.capy info --jsonreportsproject.state:live,deletedorunknown.New codes:
PROJECT_NAME_REQUIRED,PROJECT_NAME_INVALID,PROJECT_NAME_EXISTS,BRANCH_NAME_REQUIRED,BRANCH_NAME_INVALID,BRANCH_PROTECTION_REQUIRED,BRANCH_PROTECTION_INVALID,BRANCH_CREATE_FAILEDORG_SELECTION_REQUIREDChecks
--yes:capy project create --json, andcapy project create billing-api --branch staging --json, which then asked only the protected questioncapy info --jsonthen reportedstate: "deleted", and barecapyrefused with the restore command.All new user-facing wording is marked
COPY-FLAGfor review.