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
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
push:
branches:
- main
workflow_dispatch:

jobs:
build:
Expand All @@ -28,7 +29,7 @@ jobs:

integration:
runs-on: ubuntu-latest
if: github.event_name == 'push'
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ export default tseslint.config(
},
},
{
ignores: ["dist/", "node_modules/", "**/*.cjs"],
ignores: ["dist/", "node_modules/", "**/*.cjs", "src/command-registry.ts"],
},
);
2 changes: 1 addition & 1 deletion src/lib/access-keys/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default async function remove(options: Record<string, unknown>) {
const format = getFormat(options);

const id = getOption<string>(options, ['id']);
const force = getOption<boolean>(options, ['yes', 'y']);
const force = getOption<boolean>(options, ['yes', 'y', 'force']);

if (!id) {
failWithError(context, 'Access key ID is required');
Expand Down
2 changes: 1 addition & 1 deletion src/lib/buckets/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default async function deleteBucket(options: Record<string, unknown>) {
const format = getFormat(options);

const names = getOption<string | string[]>(options, ['name']);
const force = getOption<boolean>(options, ['yes', 'y']);
const force = getOption<boolean>(options, ['yes', 'y', 'force']);

if (!names) {
failWithError(context, 'Bucket name is required');
Expand Down
2 changes: 1 addition & 1 deletion src/lib/iam/policies/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async function del(options: Record<string, unknown>) {
const format = getFormat(options);

let resource = getOption<string>(options, ['resource']);
const force = getOption<boolean>(options, ['yes', 'y']);
const force = getOption<boolean>(options, ['yes', 'y', 'force']);

const iamConfig = await getOAuthIAMConfig(context);

Expand Down
2 changes: 1 addition & 1 deletion src/lib/iam/users/remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async function removeUser(options: Record<string, unknown>) {
const format = getFormat(options);

const resourceOption = getOption<string | string[]>(options, ['resource']);
const force = getOption<boolean>(options, ['yes', 'y']);
const force = getOption<boolean>(options, ['yes', 'y', 'force']);

if (isFlyOrganization()) return;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/iam/users/revoke-invitation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default async function revokeInvitation(
const format = getFormat(options);

const resourceOption = getOption<string | string[]>(options, ['resource']);
const force = getOption<boolean>(options, ['yes', 'y']);
const force = getOption<boolean>(options, ['yes', 'y', 'force']);

if (isFlyOrganization()) return;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/mv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let _jsonMode = false;
export default async function mv(options: Record<string, unknown>) {
const src = getOption<string>(options, ['src']);
const dest = getOption<string>(options, ['dest']);
const force = getOption<boolean>(options, ['yes', 'y']);
const force = getOption<boolean>(options, ['yes', 'y', 'force', 'f']);
const recursive = !!getOption<boolean>(options, ['recursive', 'r']);
const format = getFormat(options);
_jsonMode = format === 'json';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/objects/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default async function deleteObject(options: Record<string, unknown>) {

const bucket = getOption<string>(options, ['bucket']);
const keys = getOption<string | string[]>(options, ['key']);
const force = getOption<boolean>(options, ['yes', 'y']);
const force = getOption<boolean>(options, ['yes', 'y', 'force']);

if (!bucket) {
failWithError(context, 'Bucket name is required');
Expand Down
2 changes: 1 addition & 1 deletion src/lib/rm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let _jsonMode = false;

export default async function rm(options: Record<string, unknown>) {
const pathString = getOption<string>(options, ['path']);
const force = getOption<boolean>(options, ['yes', 'y']);
const force = getOption<boolean>(options, ['yes', 'y', 'force', 'f']);
const recursive = !!getOption<boolean>(options, ['recursive', 'r']);
const format = getFormat(options);
_jsonMode = format === 'json';
Expand Down
61 changes: 36 additions & 25 deletions src/specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ definitions:
global_arguments: &global_arguments
- name: format
description: Output format
alias: f
options: [json, table]
default: table
- name: json
Expand Down Expand Up @@ -280,7 +279,6 @@ commands:
alias: snapshot
- name: format
description: Output format
alias: f
options: [json, table, xml]
default: table

Expand Down Expand Up @@ -386,7 +384,6 @@ commands:
- t3://my-bucket/my-object.json
- name: format
description: Output format
alias: f
options: [json, table, xml]
default: table
- name: snapshot-version
Expand Down Expand Up @@ -426,7 +423,6 @@ commands:
description: Access key ID to use for signing. If not provided, resolved from credentials or prompted interactively
- name: format
description: Output format
alias: f
options: [url, json]
default: url

Expand Down Expand Up @@ -496,6 +492,10 @@ commands:
type: flag
alias: r
description: Move directories recursively
- name: force
type: flag
alias: f
description: Skip confirmation prompts (alias for --yes)

# rm
- name: rm
Expand All @@ -522,6 +522,10 @@ commands:
type: flag
alias: r
description: Remove directories recursively
- name: force
type: flag
alias: f
description: Skip confirmation prompts (alias for --yes)

#########################
# Manage organizations
Expand Down Expand Up @@ -549,7 +553,6 @@ commands:
arguments:
- name: format
description: Output format
alias: f
options: [json, table, xml, select]
default: select
- name: select
Expand Down Expand Up @@ -626,7 +629,6 @@ commands:
arguments:
- name: format
description: Output format
alias: f
options: [json, table, xml]
default: table
- name: forks-of
Expand Down Expand Up @@ -715,16 +717,15 @@ commands:
- my-bucket
- name: format
description: Output format
alias: f
options: [json, table, xml]
default: table
# delete
- name: delete
description: Delete one or more buckets by name. The bucket must be empty or delete-protection must be off
alias: d
examples:
- "tigris buckets delete my-bucket --force"
- "tigris buckets delete bucket-a,bucket-b --force"
- "tigris buckets delete my-bucket --yes"
- "tigris buckets delete bucket-a,bucket-b --yes"
messages:
onStart: 'Deleting bucket...'
onSuccess: "Bucket '{{name}}' deleted successfully"
Expand All @@ -740,6 +741,9 @@ commands:
multiple: true
examples:
- my-bucket
- name: force
type: flag
description: Skip confirmation prompts (alias for --yes)
# set
- name: set
description: Update settings on an existing bucket such as access level, location, caching, or custom domain
Expand Down Expand Up @@ -1027,7 +1031,6 @@ commands:
- my-bucket
- name: format
description: Output format
alias: f
options: [json, table, xml]
default: table
# create
Expand Down Expand Up @@ -1091,7 +1094,6 @@ commands:
- my-bucket
- name: format
description: Output format
alias: f
options: [json, table, xml]
default: table
# take
Expand Down Expand Up @@ -1156,7 +1158,6 @@ commands:
alias: p
- name: format
description: Output format
alias: f
options: [json, table, xml]
default: table
- name: snapshot-version
Expand Down Expand Up @@ -1238,16 +1239,15 @@ commands:
alias: t
- name: format
description: Output format
alias: f
options: [json, table, xml]
default: table
# delete
- name: delete
description: Delete one or more objects by key from the given bucket
alias: d
examples:
- "tigris objects delete my-bucket old-file.txt --force"
- "tigris objects delete my-bucket file-a.txt,file-b.txt --force"
- "tigris objects delete my-bucket old-file.txt --yes"
- "tigris objects delete my-bucket file-a.txt,file-b.txt --yes"
messages:
onStart: 'Deleting object...'
onSuccess: "Object '{{key}}' deleted successfully"
Expand All @@ -1269,6 +1269,9 @@ commands:
multiple: true
examples:
- my-file.txt
- name: force
type: flag
description: Skip confirmation prompts (alias for --yes)
# set
- name: set
description: Update settings on an existing object such as access level
Expand Down Expand Up @@ -1322,7 +1325,6 @@ commands:
arguments:
- name: format
description: Output format
alias: f
options: [json, table, xml]
default: table
- name: create
Expand All @@ -1348,7 +1350,7 @@ commands:
description: Permanently delete an access key by its ID. This revokes all access immediately
alias: d
examples:
- "tigris access-keys delete tid_AaBbCcDdEeFf --force"
- "tigris access-keys delete tid_AaBbCcDdEeFf --yes"
messages:
onStart: 'Deleting access key...'
onSuccess: 'Access key deleted'
Expand All @@ -1360,6 +1362,9 @@ commands:
required: true
examples:
- tid_AaBbCcDdEeFf
- name: force
type: flag
description: Skip confirmation prompts (alias for --yes)
- name: get
description: Show details for an access key including its name, creation date, and assigned bucket roles
alias: g
Expand Down Expand Up @@ -1447,7 +1452,6 @@ commands:
arguments:
- name: format
description: Output format
alias: f
options: [json, table, xml]
default: table
- name: get
Expand All @@ -1470,7 +1474,6 @@ commands:
- arn:aws:iam::org_id:policy/my-policy
- name: format
description: Output format
alias: f
options: [json, table, xml]
default: table
- name: create
Expand Down Expand Up @@ -1528,7 +1531,7 @@ commands:
alias: d
examples:
- "tigris iam policies delete"
- "tigris iam policies delete arn:aws:iam::org_id:policy/my-policy --force"
- "tigris iam policies delete arn:aws:iam::org_id:policy/my-policy --yes"
messages:
onStart: 'Deleting policy...'
onSuccess: "Policy '{{resource}}' deleted"
Expand All @@ -1541,6 +1544,9 @@ commands:
required: false
examples:
- arn:aws:iam::org_id:policy/my-policy
- name: force
type: flag
description: Skip confirmation prompts (alias for --yes)

- name: users
description: Manage organization users and invitations
Expand All @@ -1564,7 +1570,6 @@ commands:
arguments:
- name: format
description: Output format
alias: f
options: [json, table, xml]
default: table
- name: invite
Expand Down Expand Up @@ -1597,8 +1602,8 @@ commands:
alias: ri
examples:
- "tigris iam users revoke-invitation"
- "tigris iam users revoke-invitation invitation_id --force"
- "tigris iam users revoke-invitation id1,id2,id3 --force"
- "tigris iam users revoke-invitation invitation_id --yes"
- "tigris iam users revoke-invitation id1,id2,id3 --yes"
messages:
onStart: 'Revoking invitation...'
onSuccess: "Invitation(s) revoked"
Expand All @@ -1610,6 +1615,9 @@ commands:
type: positional
required: false
multiple: true
- name: force
type: flag
description: Skip confirmation prompts (alias for --yes)
- name: update-role
description: Update user roles in the organization. If no user ID provided, shows interactive selection
alias: ur
Expand Down Expand Up @@ -1640,8 +1648,8 @@ commands:
alias: rm
examples:
- "tigris iam users remove"
- "tigris iam users remove user@example.com --force"
- "tigris iam users remove user@example.com,user@example.net --force"
- "tigris iam users remove user@example.com --yes"
- "tigris iam users remove user@example.com,user@example.net --yes"
messages:
onStart: 'Removing user...'
onSuccess: "User(s) removed"
Expand All @@ -1653,3 +1661,6 @@ commands:
type: positional
required: false
multiple: true
- name: force
type: flag
description: Skip confirmation prompts (alias for --yes)
5 changes: 1 addition & 4 deletions src/utils/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ export function getFormat(
): string {
const json = getOption<boolean>(options, ['json']);
if (json) return 'json';
return (
getOption<string>(options, ['format', 'f', 'F'], defaultFormat) ??
defaultFormat
);
return getOption<string>(options, ['format'], defaultFormat) ?? defaultFormat;
}

/**
Expand Down
Loading
Loading