Skip to content

Commit 2043275

Browse files
committed
Improve Xata CLI command help messages (#2534)
Synced from monorepo@27c1ea8412ed3c0115ba54400b74ec6d34659a32
1 parent 8ab91f1 commit 2043275

15 files changed

Lines changed: 28 additions & 19 deletions

File tree

.sync-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19f931a84902e351aa5b75118561635b69d0e8cb
1+
27c1ea8412ed3c0115ba54400b74ec6d34659a32

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
"@xata.io/ai": "0.1.0",
4040
"@xata.io/api": "0.1.0",
4141
"@xata.io/config": "0.0.0",
42+
"@xata.io/lang": "0.0.1",
4243
"@xata.io/pgroll": "0.9.0",
4344
"@xata.io/pgstream": "0.2.0",
4445
"@xata.io/sql": "0.1.3",
4546
"@xata.io/test-utils": "0.0.0",
4647
"@xata.io/tsconfig": "0.0.1",
47-
"@xata.io/utils": "0.1.0",
48-
"@xata.io/lang": "0.0.1"
48+
"@xata.io/utils": "0.1.0"
4949
},
5050
"scripts": {
5151
"dev": "bun src/bin/cli.ts",

src/commands/auth/access-token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const AuthAccessTokenCommand = buildCommand({
2727
profile: {
2828
kind: 'parsed',
2929
parse: String,
30-
brief: 'The profile to log in to',
30+
brief: 'The profile to use',
3131
default: 'default'
3232
}
3333
}

src/commands/auth/refresh-token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const AuthRefreshTokenCommand = buildCommand({
3737
profile: {
3838
kind: 'parsed',
3939
parse: String,
40-
brief: 'The profile to log in to',
40+
brief: 'The profile to use',
4141
default: 'default'
4242
}
4343
}

src/commands/auth/status.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const AuthStatusCommand = buildCommand({
3535
profile: {
3636
kind: 'parsed',
3737
parse: String,
38-
brief: 'The profile to log in to',
38+
brief: 'The profile to check',
3939
optional: true
4040
}
4141
}

src/commands/branch/delete.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ export async function implementation(this: LocalContext, flags: Flags, branchNam
3131
}
3232

3333
if (!flags.yes) {
34+
if (!this.isInteractive) {
35+
// In an interactive terminal, declining the confirmation is an intentional
36+
// user cancellation, so it exits successfully below. In CI or agentic
37+
// contexts prompts are disabled, so there is no opportunity to confirm;
38+
// returning success would make automation think the branch was deleted.
39+
this.process.stderr.write(chalk.red(`Cannot delete branch without confirmation. Pass --yes to confirm.\n`));
40+
this.process.exit(1);
41+
}
42+
3443
const confirmFromPrompt = await this.enquirer.confirmPrompt(
3544
this.isInteractive,
3645
`Are you sure you want to delete the branch ${branchToDelete.name} with id ${branchToDelete.id}?`
@@ -50,7 +59,7 @@ export async function implementation(this: LocalContext, flags: Flags, branchNam
5059

5160
export const BranchDeleteCommand = buildCommand({
5261
docs: {
53-
brief: 'Delete new branch'
62+
brief: 'Delete a branch'
5463
},
5564
parameters: {
5665
flags: {
@@ -87,7 +96,7 @@ export const BranchDeleteCommand = buildCommand({
8796
kind: 'tuple',
8897
parameters: [
8998
{
90-
brief: 'The branch to switch to',
99+
brief: 'The branch to delete',
91100
parse: String,
92101
placeholder: 'branch name',
93102
optional: true

src/commands/branch/tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export const BranchTreeCommand = buildCommand({
115115
},
116116
'show-id': {
117117
kind: 'boolean',
118-
brief: 'Project ID',
118+
brief: 'Show branch IDs in the tree',
119119
default: false
120120
}
121121
}

src/commands/branch/wait-ready.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const BranchWaitReadyCommand = buildCommand({
9393
kind: 'tuple',
9494
parameters: [
9595
{
96-
brief: 'The branch to switch to',
96+
brief: 'The branch to wait for',
9797
parse: String,
9898
placeholder: 'branch name',
9999
optional: true

src/commands/clone/stream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export const CloneStreamCommand = buildCommand({
270270
},
271271
role: {
272272
kind: 'parsed',
273-
brief: 'Postgres role to use for streaming (it should have atleast REPLICATION privilege)',
273+
brief: 'Postgres role to use for streaming (it should have at least REPLICATION privilege)',
274274
parse: String,
275275
optional: true
276276
},

src/commands/organization/delete.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export async function implementation(this: LocalContext, flags: Flags) {
2222
`Are you sure you want to delete the organization ${organization.name}?`
2323
);
2424
if (!confirmFromPrompt) {
25-
this.process.stdout.write(`Aborted as there was no confirmation. Organzation not deleted.`);
25+
this.process.stdout.write(`Aborted as there was no confirmation. Organization not deleted.`);
2626
return;
2727
}
2828
}
@@ -40,7 +40,7 @@ export async function implementation(this: LocalContext, flags: Flags) {
4040

4141
export const OrganizationDeleteCommand = buildCommand({
4242
docs: {
43-
brief: 'Delete a Organization'
43+
brief: 'Delete an organization'
4444
},
4545
parameters: {
4646
flags: {

0 commit comments

Comments
 (0)