Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.14
0.9.15
57 changes: 56 additions & 1 deletion docs/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# capy CLI reference

Version `0.9.14`. Generated from `capy help --json`.
Version `0.9.15`. Generated from `capy help --json`.

## Commands

Expand Down Expand Up @@ -482,6 +482,54 @@ capy org [options]

JSON support: no

### `capy org delete-project`

Delete a project (owners only; hidden, not destroyed; an owner can restore it)

```
capy org delete-project <name-or-id> [options]
```

| Option | Description | Default |
|---|---|---|
| `--force` | delete even if the project has live deploy tokens (those deploys stop on their next restart) | |
| `--yes` | skip the confirmation question | |
| `--non-tty` | treat stdin as not a terminal: refuse unless --yes is passed | |
| `--json` | emit machine-readable JSON instead of the human UI | |

JSON support: yes (`--json`)

### `capy org restore-project`

Restore a deleted project (owners only)

```
capy org restore-project <name-or-id> [options]
```

| Option | Description | Default |
|---|---|---|
| `--yes` | skip the confirmation question | |
| `--non-tty` | treat stdin as not a terminal: refuse unless --yes is passed | |
| `--json` | emit machine-readable JSON instead of the human UI | |

JSON support: yes (`--json`)

### `capy org projects`

List projects in the active organization; --deleted also lists deleted ones (owners only)

```
capy org projects [options]
```

| Option | Description | Default |
|---|---|---|
| `--deleted` | also list deleted projects, marked as deleted, with the date | |
| `--json` | emit machine-readable JSON instead of the human UI | |

JSON support: yes (`--json`)

## `capy info`

Show current session info
Expand Down Expand Up @@ -1059,6 +1107,13 @@ Every refusal carries a stable `code` — branch on it, never on message text.
- `SECRET_NOT_FOUND`
- `SECRETS_NOTHING_SELECTED`
- `SECRETS_PARTIAL`
- `PROJECT_DELETED`
- `PROJECT_DELETE_OWNER_ONLY`
- `PROJECT_HAS_LIVE_DEPLOY_TOKENS`
- `PROJECT_NOT_DELETED`
- `SYSTEM_STORE_IMMUTABLE`
- `PROJECT_AMBIGUOUS`
- `CONFIRMATION_REQUIRED`
- `REPO_LINKS_UNSUPPORTED`
- `DRY_RUN_UNSUPPORTED`
- `GITHUB_TIMEOUT`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@capysc/cli",
"version": "0.9.14",
"version": "0.9.15",
"description": "Capy CLI - SecretOps for the AI age",
"main": "dist/index.js",
"bin": {
Expand Down
8 changes: 8 additions & 0 deletions src/commands/capyCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { excludeSystemProject, assertProjectNameAllowed } from '../system/reserv
import { isLocalOnly } from '../config/profileConfig';
import { resolveLocalProjectKey } from '../core/localUnlock';
import { isMembershipRevokedError } from '../errors/membershipRevoked';
import { isProjectDeletedError } from '../errors/projectDeleted';
import { cleanupOrgData } from '../cleanup/orgCleanup';
import { formatSnippet } from './statusCommand';
import { compareSecrets, hashValue, type DiffResult } from '../sync/compareSecrets';
Expand Down Expand Up @@ -1476,6 +1477,11 @@ export class CapyCommand {
return { currentKeep: bootstrappedKeep, networkAvailable: true, remotePlaintext, remoteHashes, seenSnapshot: snapshot };
} catch (err: any) {
this.debugError('remote fetch failed', err);
// CAP-729: a deleted project is not "offline". Stop here: the error screen names it and says how to restore it.
if (isProjectDeletedError(err)) {
fetchSpinner.stop();
throw err;
}
// 403 may be one of two different cases:
// (a) User was kicked from the org — confirmed by an explicit
// `code: 'MEMBERSHIP_REVOKED'` from the server. Destructive
Expand Down Expand Up @@ -1610,6 +1616,7 @@ export class CapyCommand {
return { ...localMatches, ...fetched };
} catch (err) {
this.debugError('pinned fetch failed', err);
if (isProjectDeletedError(err)) throw err;
return localMatches;
}
})()
Expand Down Expand Up @@ -1776,6 +1783,7 @@ export class CapyCommand {
return { kind: 'proceed', finalEnv: fetchedEnv };
} catch (err) {
this.debugError('retrieve_pinned fetch failed', err);
if (isProjectDeletedError(err)) throw err;
console.log('Could not fetch pinned values from remote.');
return { kind: 'abort' };
}
Expand Down
Loading
Loading