@cartesi/cli 2.0.0-alpha.3 → 2.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/base.d.ts +14 -0
  2. package/dist/base.d.ts.map +1 -0
  3. package/dist/base.js +77 -0
  4. package/dist/commands/address-book.d.ts +2 -8
  5. package/dist/commands/address-book.d.ts.map +1 -1
  6. package/dist/commands/address-book.js +15 -14
  7. package/dist/commands/build.d.ts +2 -11
  8. package/dist/commands/build.d.ts.map +1 -1
  9. package/dist/commands/build.js +16 -28
  10. package/dist/commands/clean.d.ts +2 -7
  11. package/dist/commands/clean.d.ts.map +1 -1
  12. package/dist/commands/clean.js +9 -10
  13. package/dist/commands/create.d.ts +2 -14
  14. package/dist/commands/create.d.ts.map +1 -1
  15. package/dist/commands/create.js +37 -51
  16. package/dist/commands/deploy/build.d.ts +2 -14
  17. package/dist/commands/deploy/build.d.ts.map +1 -1
  18. package/dist/commands/deploy/build.js +41 -47
  19. package/dist/commands/deploy.d.ts +3 -0
  20. package/dist/commands/deploy.d.ts.map +1 -0
  21. package/dist/commands/{deploy/index.js → deploy.js} +26 -28
  22. package/dist/commands/doctor.d.ts +2 -12
  23. package/dist/commands/doctor.d.ts.map +1 -1
  24. package/dist/commands/doctor.js +83 -90
  25. package/dist/commands/hash.d.ts +2 -9
  26. package/dist/commands/hash.d.ts.map +1 -1
  27. package/dist/commands/hash.js +14 -14
  28. package/dist/commands/run.d.ts +2 -20
  29. package/dist/commands/run.d.ts.map +1 -1
  30. package/dist/commands/run.js +49 -82
  31. package/dist/commands/send/erc20.d.ts +2 -13
  32. package/dist/commands/send/erc20.d.ts.map +1 -1
  33. package/dist/commands/send/erc20.js +55 -52
  34. package/dist/commands/send/erc721.d.ts +2 -13
  35. package/dist/commands/send/erc721.d.ts.map +1 -1
  36. package/dist/commands/send/erc721.js +49 -46
  37. package/dist/commands/send/ether.d.ts +2 -12
  38. package/dist/commands/send/ether.d.ts.map +1 -1
  39. package/dist/commands/send/ether.js +23 -21
  40. package/dist/commands/send/generic.d.ts +2 -14
  41. package/dist/commands/send/generic.d.ts.map +1 -1
  42. package/dist/commands/send/generic.js +91 -97
  43. package/dist/commands/send.d.ts +21 -0
  44. package/dist/commands/send.d.ts.map +1 -0
  45. package/dist/commands/send.js +67 -0
  46. package/dist/commands/shell.d.ts +2 -14
  47. package/dist/commands/shell.d.ts.map +1 -1
  48. package/dist/commands/shell.js +21 -43
  49. package/dist/config.d.ts +1 -1
  50. package/dist/config.js +1 -1
  51. package/dist/index.d.ts +2 -1
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +51 -1
  54. package/dist/node/docker-compose-anvil.yaml +2 -2
  55. package/dist/node/docker-compose-bundler.yaml +1 -1
  56. package/dist/node/docker-compose-database.yaml +1 -1
  57. package/dist/node/docker-compose-espresso.yaml +127 -0
  58. package/dist/node/docker-compose-explorer.yaml +1 -1
  59. package/dist/node/docker-compose-paymaster.yaml +1 -1
  60. package/package.json +8 -27
  61. package/bin/dev.cmd +0 -3
  62. package/bin/dev.js +0 -25
  63. package/bin/run.cmd +0 -3
  64. package/bin/run.js +0 -8
  65. package/dist/baseCommand.d.ts +0 -22
  66. package/dist/baseCommand.d.ts.map +0 -1
  67. package/dist/baseCommand.js +0 -92
  68. package/dist/commands/deploy/index.d.ts +0 -12
  69. package/dist/commands/deploy/index.d.ts.map +0 -1
  70. package/dist/commands/send/index.d.ts +0 -28
  71. package/dist/commands/send/index.d.ts.map +0 -1
  72. package/dist/commands/send/index.js +0 -102
  73. package/dist/flags.d.ts +0 -17
  74. package/dist/flags.d.ts.map +0 -1
  75. package/dist/flags.js +0 -28
  76. package/oclif.manifest.json +0 -876
@@ -0,0 +1,67 @@
1
+ import input from "@inquirer/input";
2
+ import select from "@inquirer/select";
3
+ import { isAddress } from "viem";
4
+ import { getApplicationAddress } from "../base.js";
5
+ import createClients, { supportedChains } from "../wallet.js";
6
+ import { registerErc20Command } from "./send/erc20.js";
7
+ import { registerErc721Command } from "./send/erc721.js";
8
+ import { registerEtherCommand } from "./send/ether.js";
9
+ import { registerGenericCommand } from "./send/generic.js";
10
+ export const connect = (options) => {
11
+ const { chainId, rpcUrl, mnemonic, mnemonicIndex } = options;
12
+ // create viem clients
13
+ return createClients({
14
+ chain: supportedChains({ includeDevnet: true }).find((c) => c.id == chainId),
15
+ rpcUrl,
16
+ mnemonicPassphrase: mnemonic,
17
+ mnemonicIndex,
18
+ });
19
+ };
20
+ export const getInputApplicationAddress = async (dapp) => {
21
+ if (dapp && isAddress(dapp)) {
22
+ // honor the flag
23
+ return dapp;
24
+ }
25
+ // get the running container dapp address
26
+ const nodeAddress = await getApplicationAddress();
27
+ // query for the address
28
+ const applicationAddress = await input({
29
+ message: "Application address",
30
+ validate: (value) => isAddress(value) || "Invalid address",
31
+ default: nodeAddress,
32
+ });
33
+ return applicationAddress;
34
+ };
35
+ export const addCommonOptions = (command) => {
36
+ return command
37
+ .option("--dapp <address>", "Application address")
38
+ .option("--chain-id <id>", "Chain ID", parseInt)
39
+ .option("--rpc-url <url>", "RPC URL")
40
+ .option("--mnemonic <phrase>", "Mnemonic passphrase")
41
+ .option("--mnemonic-index <index>", "Mnemonic account index", parseInt, 0);
42
+ };
43
+ export const registerSendCommand = (program) => {
44
+ const sendCommand = addCommonOptions(program
45
+ .command("send")
46
+ .description("Sends different kinds of input to the application in interactive mode.")).action(async (options, program) => {
47
+ // Get the registered subcommands from the program
48
+ const commands = program.commands;
49
+ // Create choices for the select prompt based on registered commands
50
+ const choices = commands.map((cmd) => ({
51
+ name: cmd.name(),
52
+ value: cmd,
53
+ description: cmd.description(),
54
+ }));
55
+ // Present the list of subcommands using @inquirer/select
56
+ const subcommand = await select({
57
+ message: "Select the type of input to send",
58
+ choices,
59
+ });
60
+ // Execute the selected subcommand
61
+ subcommand.parseAsync(program.args);
62
+ });
63
+ registerErc20Command(sendCommand);
64
+ registerErc721Command(sendCommand);
65
+ registerEtherCommand(sendCommand);
66
+ registerGenericCommand(sendCommand);
67
+ };
@@ -1,15 +1,3 @@
1
- import { BaseCommand } from "../baseCommand.js";
2
- export default class Shell extends BaseCommand<typeof Shell> {
3
- static description: string;
4
- static examples: string[];
5
- static args: {
6
- image: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
7
- };
8
- static flags: {
9
- command: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
- config: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
- "run-as-root": import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
12
- };
13
- run(): Promise<void>;
14
- }
1
+ import { Command } from "@commander-js/extra-typings";
2
+ export declare const registerShellCommand: (program: Command) => void;
15
3
  //# sourceMappingURL=shell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/commands/shell.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,WAAW,CAAC,OAAO,KAAK,CAAC;IACxD,MAAM,CAAC,WAAW,SAAqD;IAEvE,MAAM,CAAC,QAAQ,WAA2C;IAE1D,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,KAAK;;;;MAgBV;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA2CpC"}
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/commands/shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAOtD,eAAO,MAAM,oBAAoB,YAAa,OAAO,SAkDpD,CAAC"}
@@ -1,65 +1,43 @@
1
- import { Args, Flags } from "@oclif/core";
2
1
  import fs from "fs-extra";
3
2
  import path from "path";
4
- import { BaseCommand } from "../baseCommand.js";
3
+ import { getApplicationConfig, getContextPath } from "../base.js";
5
4
  import { bootMachine } from "../machine.js";
6
- class Shell extends BaseCommand {
7
- async run() {
8
- const { flags } = await this.parse(Shell);
5
+ export const registerShellCommand = (program) => {
6
+ program
7
+ .command("shell")
8
+ .argument("[image]", "image ID|name")
9
+ .option("--command <command>", "shell command to run", "/bin/sh")
10
+ .option("-c, --config <config>", "path to the configuration file", "cartesi.toml")
11
+ .option("--run-as-root", "run as root user", false)
12
+ .action(async (image, { command, config, runAsRoot }) => {
9
13
  // get application configuration from 'cartesi.toml'
10
- const config = this.getApplicationConfig(flags.config);
14
+ const c = getApplicationConfig(config);
11
15
  // destination directory for image and intermediate files
12
- const destination = path.resolve(this.getContextPath());
16
+ const destination = path.resolve(getContextPath());
13
17
  // check if all drives are built
14
- for (const [name, drive] of Object.entries(config.drives)) {
18
+ for (const [name, drive] of Object.entries(c.drives)) {
15
19
  const filename = `${name}.${drive.format}`;
16
- const pathname = this.getContextPath(filename);
20
+ const pathname = getContextPath(filename);
17
21
  if (!fs.existsSync(pathname)) {
18
- throw new Error(`drive '${name}' not built, run '${this.config.bin} build'`);
22
+ throw new Error(`drive '${name}' not built, run 'build'`);
19
23
  }
20
24
  }
21
25
  // create shell entrypoint
22
26
  const info = {
23
27
  cmd: [],
24
- entrypoint: [this.flags.command],
28
+ entrypoint: [command],
25
29
  env: [],
26
30
  workdir: "/",
27
31
  };
28
32
  // start with interactive mode on
29
- config.machine.interactive = true;
33
+ c.machine.interactive = true;
30
34
  // interactive mode can't have final hash
31
- config.machine.finalHash = false;
35
+ c.machine.finalHash = false;
32
36
  // do not store machine in interactive mode
33
- config.machine.store = undefined;
37
+ c.machine.store = undefined;
34
38
  // run as root if flag is set
35
- config.machine.user = flags["run-as-root"] ? "root" : undefined;
39
+ c.machine.user = runAsRoot ? "root" : undefined;
36
40
  // boot machine
37
- await bootMachine(config, info, destination);
38
- }
39
- }
40
- Shell.description = "Start a shell in cartesi machine of application";
41
- Shell.examples = ["<%= config.bin %> <%= command.id %>"];
42
- Shell.args = {
43
- image: Args.string({
44
- description: "image ID|name",
45
- required: false,
46
- }),
41
+ await bootMachine(c, info, destination);
42
+ });
47
43
  };
48
- Shell.flags = {
49
- command: Flags.string({
50
- default: "/bin/sh",
51
- description: "shell command to run",
52
- summary: "shell to run",
53
- }),
54
- config: Flags.file({
55
- char: "c",
56
- default: "cartesi.toml",
57
- summary: "path to the configuration file",
58
- }),
59
- "run-as-root": Flags.boolean({
60
- default: false,
61
- description: "run as root user",
62
- summary: "run the cartesi machine as the root user",
63
- }),
64
- };
65
- export default Shell;
package/dist/config.d.ts CHANGED
@@ -29,7 +29,7 @@ export declare class RequiredFieldError extends Error {
29
29
  export declare class InvalidStringArrayError extends Error {
30
30
  constructor();
31
31
  }
32
- export declare const DEFAULT_SDK = "cartesi/sdk:0.12.0-alpha.1";
32
+ export declare const DEFAULT_SDK = "cartesi/sdk:0.12.0-alpha.3";
33
33
  type DriveFormat = "ext2" | "sqfs";
34
34
  export type ImageInfo = {
35
35
  cmd: string[];
package/dist/config.js CHANGED
@@ -64,7 +64,7 @@ export class InvalidStringArrayError extends Error {
64
64
  const DEFAULT_FORMAT = "ext2";
65
65
  const DEFAULT_RAM = "128Mi";
66
66
  const DEFAULT_RAM_IMAGE = "/usr/share/cartesi-machine/images/linux.bin";
67
- export const DEFAULT_SDK = "cartesi/sdk:0.12.0-alpha.1";
67
+ export const DEFAULT_SDK = "cartesi/sdk:0.12.0-alpha.3";
68
68
  export const defaultRootDriveConfig = () => ({
69
69
  builder: "docker",
70
70
  context: ".",
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export { run } from "@oclif/core";
1
+ #!/usr/bin/env node
2
+ export {};
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js CHANGED
@@ -1 +1,51 @@
1
- export { run } from "@oclif/core";
1
+ #!/usr/bin/env node
2
+ import { Command } from "@commander-js/extra-typings";
3
+ import { createRequire } from "node:module";
4
+ import { registerAddressBookCommand } from "./commands/address-book.js";
5
+ import { registerBuildCommand } from "./commands/build.js";
6
+ import { registerCleanCommand } from "./commands/clean.js";
7
+ import { registerCreateCommand } from "./commands/create.js";
8
+ import { registerDeployCommand } from "./commands/deploy.js";
9
+ import { registerDoctorCommand } from "./commands/doctor.js";
10
+ import { registerHashCommand } from "./commands/hash.js";
11
+ import { registerRunCommand } from "./commands/run.js";
12
+ import { registerSendCommand } from "./commands/send.js";
13
+ import { registerShellCommand } from "./commands/shell.js";
14
+ // Use `createRequire` to import JSON in ESM
15
+ const require = createRequire(import.meta.url);
16
+ const pkg = require("../package.json");
17
+ const splash = String.raw ` .
18
+ / \
19
+ / \
20
+ \---/---\ /----\
21
+ \ X \
22
+ \----/ \---/---\
23
+ \ / CARTESI
24
+ \ / CLI
25
+ '`;
26
+ const program = new Command()
27
+ .name("cartesi")
28
+ .version(pkg.version)
29
+ .addHelpText("before", splash);
30
+ registerAddressBookCommand(program);
31
+ registerBuildCommand(program);
32
+ registerCleanCommand(program);
33
+ registerCreateCommand(program);
34
+ registerDeployCommand(program);
35
+ registerDoctorCommand(program);
36
+ registerHashCommand(program);
37
+ registerRunCommand(program);
38
+ registerSendCommand(program);
39
+ registerShellCommand(program);
40
+ // Global error handling
41
+ process.on("uncaughtException", (err) => {
42
+ if (process.env.NODE_ENV === "development") {
43
+ console.error(err);
44
+ }
45
+ else {
46
+ // in production, only print the error message, not the stack trace
47
+ console.error(err.message);
48
+ }
49
+ process.exit(1);
50
+ });
51
+ program.parse();
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  anvil:
3
- image: cartesi/sdk:0.12.0-alpha.1
3
+ image: cartesi/sdk:0.12.0-alpha.3
4
4
  command:
5
5
  [
6
6
  "devnet",
@@ -19,7 +19,7 @@ services:
19
19
  - 8545:8545
20
20
 
21
21
  dapp_deployer:
22
- image: cartesi/sdk:0.12.0-alpha.1
22
+ image: cartesi/sdk:0.12.0-alpha.3
23
23
  restart: on-failure
24
24
  depends_on:
25
25
  anvil:
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  alto:
3
- image: cartesi/sdk:0.12.0-alpha.1
3
+ image: cartesi/sdk:0.12.0-alpha.3
4
4
  command:
5
5
  - "alto"
6
6
  - "--entrypoints"
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  database:
3
- image: postgres:15-alpine
3
+ image: postgres:16-alpine
4
4
  healthcheck:
5
5
  test: ["CMD-SHELL", "pg_isready -U postgres || exit 1"]
6
6
  interval: 10s
@@ -0,0 +1,127 @@
1
+ services:
2
+ espresso_database_creator:
3
+ image: postgres:16-alpine
4
+ command: ["createdb", "sequencer"]
5
+ depends_on:
6
+ database:
7
+ condition: service_healthy
8
+ environment:
9
+ PGHOST: ${PGHOST:-database}
10
+ PGPORT: ${PGPORT:-5432}
11
+ PGUSER: ${PGUSER:-postgres}
12
+ PGPASSWORD: ${PGPASSWORD:-password}
13
+ PGDATABASE: ${PGDATABASE:-postgres}
14
+
15
+ validator:
16
+ environment:
17
+ CARTESI_FEATURE_INPUT_READER_ENABLED: false
18
+ espresso:
19
+ image: cartesi/sdk:0.12.0-alpha.3
20
+ command: ["/usr/local/bin/espresso-dev-node"]
21
+ deploy:
22
+ resources:
23
+ limits:
24
+ cpus: "4"
25
+ memory: "1G"
26
+ ports:
27
+ - 8770:8770
28
+ - 8771:8771
29
+ - 8772:8772
30
+ - 20000:20000
31
+ depends_on:
32
+ espresso_database_creator:
33
+ condition: service_completed_successfully
34
+ database:
35
+ condition: service_healthy
36
+ environment:
37
+ ESPRESSO_SEQUENCER_L1_PROVIDER: ${CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:-http://anvil:8545}
38
+ ESPRESSO_SEQUENCER_API_PORT: 8770
39
+ ESPRESSO_BUILDER_PORT: 8771
40
+ ESPRESSO_PROVER_PORT: 8772
41
+ ESPRESSO_DEV_NODE_PORT: 20000
42
+ ESPRESSO_SEQUENCER_POSTGRES_HOST: database
43
+ ESPRESSO_SEQUENCER_POSTGRES_PORT: 5432
44
+ ESPRESSO_SEQUENCER_POSTGRES_USER: postgres
45
+ ESPRESSO_SEQUENCER_POSTGRES_PASSWORD: password
46
+ ESPRESSO_SEQUENCER_POSTGRES_DATABASE: sequencer
47
+ ESPRESSO_SEQUENCER_ETH_MNEMONIC: ${CARTESI_AUTH_MNEMONIC:-test test test test test test test test test test test junk}
48
+
49
+ prompt:
50
+ image: debian:bookworm-slim
51
+ environment:
52
+ PROMPT_TXT_07_ESPRESSO: "Espresso running at http://localhost:${CARTESI_LISTEN_PORT}/espresso/"
53
+
54
+ traefik-config-generator:
55
+ environment:
56
+ TRAEFIK_CONFIG_ESPRESSO_DEV: |
57
+ http:
58
+ routers:
59
+ espresso-dev:
60
+ rule: "PathPrefix(`/espresso/dev`)"
61
+ middlewares:
62
+ - "remove-espresso-dev-prefix"
63
+ service: espresso-dev
64
+ middlewares:
65
+ remove-espresso-dev-prefix:
66
+ replacePathRegex:
67
+ regex: "^/espresso/dev/(.*)"
68
+ replacement: "/$1"
69
+ services:
70
+ espresso-dev:
71
+ loadBalancer:
72
+ servers:
73
+ - url: "http://espresso:20000"
74
+ TRAEFIK_CONFIG_ESPRESSO_SEQUENCER: |
75
+ http:
76
+ routers:
77
+ espresso-sequencer:
78
+ rule: "PathPrefix(`/espresso/sequencer`)"
79
+ middlewares:
80
+ - "remove-espresso-sequencer-prefix"
81
+ service: espresso-sequencer
82
+ middlewares:
83
+ remove-espresso-sequencer-prefix:
84
+ replacePathRegex:
85
+ regex: "^/espresso/sequencer/(.*)"
86
+ replacement: "/$1"
87
+ services:
88
+ espresso-sequencer:
89
+ loadBalancer:
90
+ servers:
91
+ - url: "http://espresso:8770"
92
+ TRAEFIK_CONFIG_ESPRESSO_BUILDER: |
93
+ http:
94
+ routers:
95
+ espresso-builder:
96
+ rule: "PathPrefix(`/espresso/builder`)"
97
+ middlewares:
98
+ - "remove-espresso-builder-prefix"
99
+ service: espresso-builder
100
+ middlewares:
101
+ remove-espresso-builder-prefix:
102
+ replacePathRegex:
103
+ regex: "^/espresso/builder/(.*)"
104
+ replacement: "/$1"
105
+ services:
106
+ espresso-builder:
107
+ loadBalancer:
108
+ servers:
109
+ - url: "http://espresso:8771"
110
+ TRAEFIK_CONFIG_ESPRESSO_PROVER: |
111
+ http:
112
+ routers:
113
+ espresso-prover:
114
+ rule: "PathPrefix(`/espresso/prover`)"
115
+ middlewares:
116
+ - "remove-espresso-prover-prefix"
117
+ service: espresso-prover
118
+ middlewares:
119
+ remove-espresso-prover-prefix:
120
+ replacePathRegex:
121
+ regex: "^/espresso/prover/(.*)"
122
+ replacement: "/$1"
123
+ services:
124
+ espresso-prover:
125
+ loadBalancer:
126
+ servers:
127
+ - url: "http://espresso:8772"
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  database_creator:
3
- image: postgres:15-alpine
3
+ image: postgres:16-alpine
4
4
  command: ["createdb", "squid"]
5
5
  depends_on:
6
6
  database:
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  mock-verifying-paymaster:
3
- image: cartesi/sdk:0.12.0-alpha.1
3
+ image: cartesi/sdk:0.12.0-alpha.3
4
4
  command: "mock-verifying-paymaster"
5
5
  environment:
6
6
  - ALTO_RPC=http://alto:4337
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@cartesi/cli",
3
- "version": "2.0.0-alpha.3",
3
+ "version": "2.0.0-alpha.5",
4
4
  "description": "Cartesi CLI",
5
5
  "author": "Danilo Tuler <tuler@pobox.com>",
6
6
  "bin": {
7
- "cartesi": "./bin/run.js"
7
+ "cartesi": "./dist/index.js"
8
8
  },
9
9
  "type": "module",
10
10
  "homepage": "https://github.com/cartesi/cli",
@@ -14,21 +14,19 @@
14
14
  "files": [
15
15
  "/bin",
16
16
  "/dist",
17
- "/npm-shrinkwrap.json",
18
- "/oclif.manifest.json"
17
+ "/npm-shrinkwrap.json"
19
18
  ],
20
19
  "dependencies": {
20
+ "@commander-js/extra-typings": "^13.1.0",
21
21
  "@inquirer/confirm": "^5.0.0",
22
22
  "@inquirer/core": "^10.0.0",
23
23
  "@inquirer/input": "^4.0.0",
24
24
  "@inquirer/select": "^4.0.0",
25
25
  "@inquirer/type": "^3.0.0",
26
- "@oclif/core": "^4.0.29",
27
- "@oclif/plugin-help": "^6.2.15",
28
- "@oclif/plugin-plugins": "^5.4.15",
29
26
  "bytes": "^3.1.2",
30
27
  "chalk": "^5.3.0",
31
28
  "cli-table3": "^0.6.5",
29
+ "commander": "^13.1.0",
32
30
  "execa": "^9.4.1",
33
31
  "fs-extra": "^11.2.0",
34
32
  "giget": "^1.2.3",
@@ -56,38 +54,20 @@
56
54
  "@wagmi/cli": "^2.1.16",
57
55
  "copyfiles": "^2.4.1",
58
56
  "eslint": "^8.57.0",
59
- "eslint-config-oclif": "^5.2.1",
60
- "eslint-config-oclif-typescript": "^3.1.12",
61
57
  "npm-run-all": "^4.1.5",
62
- "oclif": "^4.15.9",
63
58
  "rimraf": "^6.0.1",
64
59
  "ts-node": "^10.9.2",
65
60
  "tslib": "^2.8.0",
66
61
  "typescript": "^5.6.3",
67
62
  "vitest": "^2.1.3",
63
+ "@cartesi/devnet": "2.0.0-alpha.3",
68
64
  "@cartesi/eslint-config": "0.0.0",
69
- "tsconfig": "0.0.0",
70
- "@cartesi/devnet": "2.0.0-alpha.2"
71
- },
72
- "oclif": {
73
- "bin": "cartesi",
74
- "dirname": "cartesi",
75
- "commands": "./dist/commands",
76
- "plugins": [
77
- "@oclif/plugin-help"
78
- ],
79
- "topicSeparator": " ",
80
- "macos": {
81
- "identifier": "io.cartesi.cli"
82
- }
65
+ "tsconfig": "0.0.0"
83
66
  },
84
67
  "engines": {
85
68
  "node": ">=18.0.0"
86
69
  },
87
70
  "bugs": "https://github.com/cartesi/cli/issues",
88
- "keywords": [
89
- "oclif"
90
- ],
91
71
  "types": "dist/index.d.ts",
92
72
  "scripts": {
93
73
  "build": "run-s clean codegen compile copy-files",
@@ -95,6 +75,7 @@
95
75
  "codegen": "run-p codegen:wagmi",
96
76
  "codegen:wagmi": "wagmi generate",
97
77
  "compile": "tsc -p tsconfig.build.json",
78
+ "postcompile": "chmod +x dist/index.js",
98
79
  "copy-files": "copyfiles -u 1 \"src/**/*.yaml\" \"src/**/*.env\" \"src/**/*.txt\" dist",
99
80
  "lint": "eslint \"src/**/*.ts*\"",
100
81
  "posttest": "pnpm lint",
package/bin/dev.cmd DELETED
@@ -1,3 +0,0 @@
1
- @echo off
2
-
3
- node "%~dp0\dev" %*
package/bin/dev.js DELETED
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env node --no-warnings=ExperimentalWarning --loader ts-node/esm
2
-
3
- import oclif from "@oclif/core";
4
- import path from "node:path";
5
- import url from "node:url";
6
- import { register } from "ts-node";
7
-
8
- // In dev mode -> use ts-node and dev plugins
9
- process.env.NODE_ENV = "development";
10
-
11
- const project = path.join(
12
- path.dirname(url.fileURLToPath(import.meta.url)),
13
- "..",
14
- "tsconfig.json"
15
- );
16
- register({ project });
17
-
18
- // In dev mode, always show stack traces
19
- oclif.settings.debug = true;
20
-
21
- // Start the CLI
22
- oclif
23
- .run(process.argv.slice(2), import.meta.url)
24
- .then(oclif.flush)
25
- .catch(oclif.Errors.handle);
package/bin/run.cmd DELETED
@@ -1,3 +0,0 @@
1
- @echo off
2
-
3
- node "%~dp0\run" %*
package/bin/run.js DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import oclif from "@oclif/core";
4
-
5
- oclif
6
- .run(process.argv.slice(2), import.meta.url)
7
- .then(oclif.flush)
8
- .catch(oclif.Errors.handle);
@@ -1,22 +0,0 @@
1
- import { Command, Interfaces } from "@oclif/core";
2
- import { Address, Hash } from "viem";
3
- import { Config } from "./config.js";
4
- export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof BaseCommand)["baseFlags"] & T["flags"]>;
5
- export type Args<T extends typeof Command> = Interfaces.InferredArgs<T["args"]>;
6
- export type AddressBook = Record<string, Address>;
7
- export declare abstract class BaseCommand<T extends typeof Command> extends Command {
8
- protected flags: Flags<T>;
9
- protected args: Args<T>;
10
- protected getServiceState(projectName: string, serviceName: string): Promise<string | undefined>;
11
- protected getContextPath(...paths: string[]): string;
12
- protected getApplicationConfig(configPath: string): Config;
13
- protected getMachineHash(): Hash | undefined;
14
- protected logPrompt({ title, value }: {
15
- title: string;
16
- value: string;
17
- }): void;
18
- protected getApplicationAddress(): Promise<Address>;
19
- protected getAddressBook(): Promise<AddressBook>;
20
- init(): Promise<void>;
21
- }
22
- //# sourceMappingURL=baseCommand.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"baseCommand.d.ts","sourceRoot":"","sources":["../src/baseCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKlD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAsB,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAS,MAAM,aAAa,CAAC;AAiB5C,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,OAAO,OAAO,IAAI,UAAU,CAAC,aAAa,CAClE,CAAC,OAAO,WAAW,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CACjD,CAAC;AACF,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,OAAO,OAAO,IAAI,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAChF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAElD,8BAAsB,WAAW,CAAC,CAAC,SAAS,OAAO,OAAO,CAAE,SAAQ,OAAO;IACvE,SAAS,CAAC,KAAK,EAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3B,SAAS,CAAC,IAAI,EAAG,IAAI,CAAC,CAAC,CAAC,CAAC;cAET,eAAe,CAC3B,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAe9B,SAAS,CAAC,cAAc,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAIpD,SAAS,CAAC,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAM1D,SAAS,CAAC,cAAc,IAAI,IAAI,GAAG,SAAS;IAY5C,SAAS,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;cAItD,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC;cAKzC,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC;IAiCzC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAYrC"}