alwaysai
Version:
The alwaysAI command-line interface (CLI)
35 lines (33 loc) • 998 B
text/typescript
import { CliLeaf, CliStringInput } from '@alwaysai/alwayscli';
import { yesCliInput } from '../../cli-inputs';
import { appReleasePullComponent } from '../../components/release';
import { echo } from '../../util';
export const pullAppReleaseCliLeaf = CliLeaf({
name: 'pull',
description: 'Retrieve a release of your application',
namedInputs: {
yes: yesCliInput,
project: CliStringInput({
description: 'Project ID',
required: true
}),
releaseHash: CliStringInput({
description: 'Hash of a particular cloud app release'
})
},
async action(_, opts) {
const { yes, project, releaseHash } = opts;
const retrievedReleaseHash = await appReleasePullComponent({
yes,
project,
releaseHash
});
echo(
`Downloaded ${
retrievedReleaseHash
? `released application ${retrievedReleaseHash}`
: 'most recently released application'
} for project ${project} to ${process.cwd()}`
);
}
});