Devtools-Extensible-CLI README
This is a CLI for LayerZero Devtools - which is extensible by defining new operations.
Operations are of the class Type INewOperation
and are defined in the types/index.d.ts
file.
When you go to type your new operation, the args will have -
instead of _
.
For example, oapp_config
will be --oapp-config
on the command line.
import { build as buildMove } from '../../tasks/move/build'
import { INewOperation } from './NewOperation'
class MoveBuildOperation implements INewOperation {
vm = 'move'
operation = 'build'
reqArgs = ['oapp_config', 'named_addresses', 'move_deploy_script']
addArgs = []
async impl(args: any): Promise<void> {
await buildMove(args)
}
}
const NewOperation = new MoveBuildOperation()
export { NewOperation }
You can attach new operations to this via
- Paths
await sdk.extendOperationFromPath('./operations/move-build')
- example: packages/devtools-movement/operations/init.ts
- Providing an implementation of the
INewOperation
interface await sdk.extendOperation(NewOperation)
- example: examples/oft-aptos-move/scripts/cli.ts