hetzner-cli 2.0.0

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 (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +907 -0
  3. package/dist/auction/client.d.ts +4 -0
  4. package/dist/auction/client.js +103 -0
  5. package/dist/auction/commands.d.ts +2 -0
  6. package/dist/auction/commands.js +138 -0
  7. package/dist/auction/formatter.d.ts +3 -0
  8. package/dist/auction/formatter.js +87 -0
  9. package/dist/cli.d.ts +2 -0
  10. package/dist/cli.js +39 -0
  11. package/dist/client.d.ts +2 -0
  12. package/dist/client.js +4 -0
  13. package/dist/cloud/client.d.ts +511 -0
  14. package/dist/cloud/client.js +706 -0
  15. package/dist/cloud/commands/certificate.d.ts +2 -0
  16. package/dist/cloud/commands/certificate.js +77 -0
  17. package/dist/cloud/commands/context.d.ts +2 -0
  18. package/dist/cloud/commands/context.js +78 -0
  19. package/dist/cloud/commands/datacenter.d.ts +2 -0
  20. package/dist/cloud/commands/datacenter.js +20 -0
  21. package/dist/cloud/commands/firewall.d.ts +2 -0
  22. package/dist/cloud/commands/firewall.js +77 -0
  23. package/dist/cloud/commands/floating-ip.d.ts +2 -0
  24. package/dist/cloud/commands/floating-ip.js +83 -0
  25. package/dist/cloud/commands/image.d.ts +2 -0
  26. package/dist/cloud/commands/image.js +60 -0
  27. package/dist/cloud/commands/index.d.ts +2 -0
  28. package/dist/cloud/commands/index.js +41 -0
  29. package/dist/cloud/commands/iso.d.ts +2 -0
  30. package/dist/cloud/commands/iso.js +22 -0
  31. package/dist/cloud/commands/load-balancer-type.d.ts +2 -0
  32. package/dist/cloud/commands/load-balancer-type.js +20 -0
  33. package/dist/cloud/commands/load-balancer.d.ts +2 -0
  34. package/dist/cloud/commands/load-balancer.js +177 -0
  35. package/dist/cloud/commands/location.d.ts +2 -0
  36. package/dist/cloud/commands/location.js +20 -0
  37. package/dist/cloud/commands/network.d.ts +2 -0
  38. package/dist/cloud/commands/network.js +96 -0
  39. package/dist/cloud/commands/placement-group.d.ts +2 -0
  40. package/dist/cloud/commands/placement-group.js +53 -0
  41. package/dist/cloud/commands/primary-ip.d.ts +2 -0
  42. package/dist/cloud/commands/primary-ip.js +83 -0
  43. package/dist/cloud/commands/server-type.d.ts +2 -0
  44. package/dist/cloud/commands/server-type.js +20 -0
  45. package/dist/cloud/commands/server.d.ts +2 -0
  46. package/dist/cloud/commands/server.js +260 -0
  47. package/dist/cloud/commands/ssh-key.d.ts +2 -0
  48. package/dist/cloud/commands/ssh-key.js +63 -0
  49. package/dist/cloud/commands/volume.d.ts +2 -0
  50. package/dist/cloud/commands/volume.js +92 -0
  51. package/dist/cloud/context.d.ts +28 -0
  52. package/dist/cloud/context.js +172 -0
  53. package/dist/cloud/formatter.d.ts +37 -0
  54. package/dist/cloud/formatter.js +413 -0
  55. package/dist/cloud/helpers.d.ts +18 -0
  56. package/dist/cloud/helpers.js +48 -0
  57. package/dist/cloud/types.d.ts +398 -0
  58. package/dist/cloud/types.js +5 -0
  59. package/dist/config.d.ts +1 -0
  60. package/dist/config.js +2 -0
  61. package/dist/formatter.d.ts +3 -0
  62. package/dist/formatter.js +6 -0
  63. package/dist/index.d.ts +10 -0
  64. package/dist/index.js +17 -0
  65. package/dist/robot/client.d.ts +256 -0
  66. package/dist/robot/client.js +656 -0
  67. package/dist/robot/commands/auth.d.ts +2 -0
  68. package/dist/robot/commands/auth.js +54 -0
  69. package/dist/robot/commands/boot.d.ts +2 -0
  70. package/dist/robot/commands/boot.js +72 -0
  71. package/dist/robot/commands/cancel.d.ts +2 -0
  72. package/dist/robot/commands/cancel.js +36 -0
  73. package/dist/robot/commands/failover.d.ts +2 -0
  74. package/dist/robot/commands/failover.js +42 -0
  75. package/dist/robot/commands/firewall.d.ts +2 -0
  76. package/dist/robot/commands/firewall.js +66 -0
  77. package/dist/robot/commands/index.d.ts +2 -0
  78. package/dist/robot/commands/index.js +36 -0
  79. package/dist/robot/commands/interactive.d.ts +2 -0
  80. package/dist/robot/commands/interactive.js +134 -0
  81. package/dist/robot/commands/ip.d.ts +2 -0
  82. package/dist/robot/commands/ip.js +52 -0
  83. package/dist/robot/commands/key.d.ts +2 -0
  84. package/dist/robot/commands/key.js +64 -0
  85. package/dist/robot/commands/order.d.ts +2 -0
  86. package/dist/robot/commands/order.js +33 -0
  87. package/dist/robot/commands/rdns.d.ts +2 -0
  88. package/dist/robot/commands/rdns.js +41 -0
  89. package/dist/robot/commands/reset.d.ts +2 -0
  90. package/dist/robot/commands/reset.js +77 -0
  91. package/dist/robot/commands/server.d.ts +2 -0
  92. package/dist/robot/commands/server.js +29 -0
  93. package/dist/robot/commands/storagebox.d.ts +2 -0
  94. package/dist/robot/commands/storagebox.js +116 -0
  95. package/dist/robot/commands/subnet.d.ts +2 -0
  96. package/dist/robot/commands/subnet.js +21 -0
  97. package/dist/robot/commands/traffic.d.ts +2 -0
  98. package/dist/robot/commands/traffic.js +20 -0
  99. package/dist/robot/commands/vswitch.d.ts +2 -0
  100. package/dist/robot/commands/vswitch.js +64 -0
  101. package/dist/robot/commands/wol.d.ts +2 -0
  102. package/dist/robot/commands/wol.js +20 -0
  103. package/dist/robot/formatter.d.ts +58 -0
  104. package/dist/robot/formatter.js +500 -0
  105. package/dist/robot/types.d.ts +352 -0
  106. package/dist/robot/types.js +5 -0
  107. package/dist/shared/config.d.ts +86 -0
  108. package/dist/shared/config.js +273 -0
  109. package/dist/shared/formatter.d.ts +29 -0
  110. package/dist/shared/formatter.js +118 -0
  111. package/dist/shared/helpers.d.ts +17 -0
  112. package/dist/shared/helpers.js +72 -0
  113. package/dist/shared/reference.d.ts +2 -0
  114. package/dist/shared/reference.js +626 -0
  115. package/dist/types.d.ts +75 -0
  116. package/dist/types.js +1 -0
  117. package/package.json +112 -0
@@ -0,0 +1,75 @@
1
+ export type { Server, ServerSubnet, ServerDetails, Cancellation, ResetType, Reset, BootConfig, RescueConfig, LinuxConfig, VncConfig, WindowsConfig, PleskConfig, CpanelConfig, IP, Mac, Subnet, Failover, Rdns, SshKey, Firewall, FirewallRule, FirewallTemplate, VSwitch, VSwitchServer, VSwitchSubnet, VSwitchCloudNetwork, StorageBox, StorageBoxSnapshot, StorageBoxSnapshotPlan, StorageBoxSubaccount, Traffic, TrafficData, Wol, ServerProduct, ProductPrice, ServerMarketProduct, ServerTransaction, ServerTransactionProduct, ApiResponse, ApiError, } from './robot/types.js';
2
+ export interface AuctionDiskData {
3
+ nvme: number[];
4
+ sata: number[];
5
+ hdd: number[];
6
+ general: number[];
7
+ }
8
+ export interface AuctionIpPrice {
9
+ Monthly: number;
10
+ Hourly: number;
11
+ Amount: number;
12
+ }
13
+ export interface AuctionServer {
14
+ id: number;
15
+ key: number;
16
+ name: string;
17
+ description: string[];
18
+ information: string[] | null;
19
+ cpu: string;
20
+ cpu_count: number;
21
+ is_highio: boolean;
22
+ is_ecc: boolean;
23
+ traffic: string;
24
+ bandwidth: number;
25
+ ram: string[];
26
+ ram_size: number;
27
+ price: number;
28
+ setup_price: number;
29
+ hourly_price: number;
30
+ hdd_arr: string[];
31
+ hdd_hr: string[];
32
+ hdd_size: number;
33
+ hdd_count: number;
34
+ serverDiskData: AuctionDiskData;
35
+ datacenter: string;
36
+ datacenter_hr: string;
37
+ specials: string[];
38
+ dist: string[];
39
+ fixed_price: boolean;
40
+ next_reduce: number;
41
+ next_reduce_hr: boolean;
42
+ next_reduce_timestamp: number;
43
+ ip_price: AuctionIpPrice;
44
+ category?: string;
45
+ cat_id?: number;
46
+ }
47
+ export interface AuctionFilterOptions {
48
+ minPrice?: number;
49
+ maxPrice?: number;
50
+ maxHourlyPrice?: number;
51
+ minRam?: number;
52
+ maxRam?: number;
53
+ cpu?: string;
54
+ datacenter?: string;
55
+ minDiskSize?: number;
56
+ maxDiskSize?: number;
57
+ minDiskCount?: number;
58
+ maxDiskCount?: number;
59
+ diskType?: 'nvme' | 'sata' | 'hdd';
60
+ ecc?: boolean;
61
+ gpu?: boolean;
62
+ inic?: boolean;
63
+ highio?: boolean;
64
+ specials?: string;
65
+ fixedPrice?: boolean;
66
+ maxSetupPrice?: number;
67
+ minCpuCount?: number;
68
+ maxCpuCount?: number;
69
+ minBandwidth?: number;
70
+ text?: string;
71
+ }
72
+ export interface AuctionResponse {
73
+ server: AuctionServer[];
74
+ serverCount: number;
75
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,112 @@
1
+ {
2
+ "name": "hetzner-cli",
3
+ "version": "2.0.0",
4
+ "description": "Unified CLI and Node.js library for Hetzner Robot API (dedicated servers) and Cloud API",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./client": {
14
+ "types": "./dist/client.d.ts",
15
+ "import": "./dist/client.js"
16
+ },
17
+ "./types": {
18
+ "types": "./dist/types.d.ts",
19
+ "import": "./dist/types.js"
20
+ },
21
+ "./cloud/client": {
22
+ "types": "./dist/cloud/client.d.ts",
23
+ "import": "./dist/cloud/client.js"
24
+ },
25
+ "./cloud/types": {
26
+ "types": "./dist/cloud/types.d.ts",
27
+ "import": "./dist/cloud/types.js"
28
+ },
29
+ "./robot/client": {
30
+ "types": "./dist/robot/client.d.ts",
31
+ "import": "./dist/robot/client.js"
32
+ },
33
+ "./robot/types": {
34
+ "types": "./dist/robot/types.d.ts",
35
+ "import": "./dist/robot/types.js"
36
+ }
37
+ },
38
+ "bin": {
39
+ "hetzner": "./dist/cli.js"
40
+ },
41
+ "files": [
42
+ "dist/**/*.js",
43
+ "dist/**/*.d.ts",
44
+ "!dist/**/*.test.js",
45
+ "!dist/**/*.test.d.ts",
46
+ "README.md",
47
+ "LICENSE"
48
+ ],
49
+ "scripts": {
50
+ "build": "tsc -p tsconfig.build.json",
51
+ "dev": "tsc --watch",
52
+ "start": "node dist/cli.js",
53
+ "typecheck": "tsc --noEmit",
54
+ "lint": "eslint src/",
55
+ "lint:fix": "eslint src/ --fix",
56
+ "test": "vitest run",
57
+ "test:watch": "vitest",
58
+ "test:coverage": "vitest run --coverage",
59
+ "audit": "npm audit",
60
+ "check": "npm run typecheck && npm run lint && npm run test",
61
+ "prepublishOnly": "npm run check && npm run build"
62
+ },
63
+ "keywords": [
64
+ "hetzner",
65
+ "hetzner-cloud",
66
+ "hetzner-robot",
67
+ "hcloud",
68
+ "api",
69
+ "cli",
70
+ "dedicated-server",
71
+ "cloud-server",
72
+ "server-management",
73
+ "datacenter",
74
+ "hosting",
75
+ "cloud",
76
+ "infrastructure",
77
+ "load-balancer",
78
+ "firewall",
79
+ "volume"
80
+ ],
81
+ "sideEffects": false,
82
+ "author": "ytspar",
83
+ "license": "MIT",
84
+ "repository": {
85
+ "type": "git",
86
+ "url": "git+https://github.com/ytspar/hetzner-cli.git"
87
+ },
88
+ "bugs": {
89
+ "url": "https://github.com/ytspar/hetzner-cli/issues"
90
+ },
91
+ "homepage": "https://github.com/ytspar/hetzner-cli#readme",
92
+ "dependencies": {
93
+ "@inquirer/prompts": "^8.2.0",
94
+ "cli-table3": "^0.6.5",
95
+ "commander": "^14.0.2",
96
+ "dotenv": "^17.2.4",
97
+ "keytar": "^7.9.0"
98
+ },
99
+ "devDependencies": {
100
+ "@eslint/js": "^9.0.0",
101
+ "@types/node": "^22.0.0",
102
+ "@vitest/coverage-v8": "^4.0.18",
103
+ "eslint": "^9.0.0",
104
+ "eslint-plugin-security": "^3.0.0",
105
+ "typescript": "^5.7.0",
106
+ "typescript-eslint": "^8.0.0",
107
+ "vitest": "^4.0.18"
108
+ },
109
+ "engines": {
110
+ "node": ">=18.0.0"
111
+ }
112
+ }