Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 04:45 UTC
| 1 | import { Argument, Command, Flag } from 'effect/cli'; |
| 2 | import { runUpgrade } from './upgrade.handler'; |
| 3 | |
| 4 | const betaOpt = Flag.Boolean('beta').pipe( |
| 5 | Flag.withAlias('b'), |
| 6 | Flag.withDefault(false), |
| 7 | Flag.withDescription('Upgrade to the latest beta CLI release instead of the stable channel') |
| 8 | ); |
| 9 | |
| 10 | const versionArg = Argument.String('version').pipe( |
| 11 | Argument.withDescription( |
| 12 | 'Install a specific CLI release (e.g. "0.13.1", "0.13.1-beta.42", or full tag "@composio/cli@0.13.1"). If omitted, installs the latest release.' |
| 13 | ), |
| 14 | Argument.optional |
| 15 | ); |
| 16 | |
| 17 | /** |
| 18 | * CLI command to upgrade the CLI to the latest available version, |
| 19 | * or to install a specific version when one is provided. |
| 20 | * |
| 21 | * @example |
| 22 | * ```bash |
| 23 | * composio upgrade |
| 24 | * composio upgrade 0.13.1 |
| 25 | * composio upgrade 0.13.1-beta.42 |
| 26 | * composio upgrade --beta |
| 27 | * ``` |
| 28 | */ |
| 29 | export const upgradeCmd = Command.make( |
| 30 | 'upgrade', |
| 31 | { beta: betaOpt, version: versionArg }, |
| 32 | runUpgrade |
| 33 | ).pipe( |
| 34 | Command.withDescription( |
| 35 | 'Upgrade your Composio CLI. Pass a version (e.g. "0.13.1" or "0.13.1-beta.42") to install a specific release, or omit it to install the latest.' |
| 36 | ) |
| 37 | ); |