@tonk/cli 0.0.7 → 0.1.1
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.
- package/README.md +67 -2
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +18 -23
- package/dist/commands/create.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -2,12 +2,77 @@
|
|
|
2
2
|
|
|
3
3
|
Command line utilities for your Tonk network
|
|
4
4
|
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @tonk/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
### Create a new Tonk app
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
tonk create my-app
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Development
|
|
20
|
+
|
|
21
|
+
Run your Tonk app in development mode:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
tonk dev
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Serve
|
|
28
|
+
|
|
29
|
+
Serve your built Tonk app locally:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
tonk serve
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Configure AWS Deployment
|
|
36
|
+
|
|
37
|
+
Configure your AWS EC2 instance for deployment:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Interactive configuration (with existing instance)
|
|
41
|
+
tonk config
|
|
42
|
+
|
|
43
|
+
# Provision a new EC2 instance
|
|
44
|
+
tonk config --provision [--key-name my-key]
|
|
45
|
+
|
|
46
|
+
# Configure with existing EC2 instance
|
|
47
|
+
tonk config --instance ec2-xx-xx-xx-xx.compute-1.amazonaws.com --key ~/path/to/key.pem
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Options:
|
|
51
|
+
- `-i, --instance <address>` - EC2 instance address
|
|
52
|
+
- `-k, --key <path>` - Path to SSH key file
|
|
53
|
+
- `-u, --user <name>` - SSH username (default: ec2-user)
|
|
54
|
+
- `-p, --provision` - Provision a new EC2 instance
|
|
55
|
+
- `-n, --key-name <name>` - AWS key pair name (for provisioning)
|
|
56
|
+
|
|
57
|
+
### Deploy to AWS
|
|
58
|
+
|
|
59
|
+
Deploy your Tonk app to an EC2 instance:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
tonk deploy
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Options:
|
|
66
|
+
- `-i, --instance <address>` - EC2 instance address
|
|
67
|
+
- `-k, --key <path>` - Path to SSH key file
|
|
68
|
+
- `-u, --user <name>` - SSH username (default: ec2-user)
|
|
69
|
+
- `-t, --token <token>` - Pinggy.io access token for public URL
|
|
70
|
+
|
|
5
71
|
## Development
|
|
6
72
|
|
|
7
73
|
1. Clone the repository
|
|
8
74
|
2. Install dependencies: `pnpm install`
|
|
9
|
-
|
|
10
|
-
4. Run the dev mode: `pnpm run dev`
|
|
75
|
+
4. Run the dev mode: `pnpm dev`
|
|
11
76
|
|
|
12
77
|
## License
|
|
13
78
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAGlC,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAGlC,eAAO,MAAM,aAAa,SA2BtB,CAAC"}
|
package/dist/commands/create.js
CHANGED
|
@@ -2,31 +2,26 @@ import { Command } from 'commander';
|
|
|
2
2
|
import child_process from 'child_process';
|
|
3
3
|
export const createCommand = new Command('create')
|
|
4
4
|
.description('Create a new tonk application or component')
|
|
5
|
-
.
|
|
6
|
-
.action(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
.toString()
|
|
15
|
-
.trim();
|
|
16
|
-
}
|
|
17
|
-
finally {
|
|
18
|
-
if (!binaryPath) {
|
|
19
|
-
// use the command from npm registry
|
|
20
|
-
child_process.execSync('npx @tonk/create', { stdio: 'inherit' });
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
child_process.execSync(binaryPath, { stdio: 'inherit' });
|
|
24
|
-
}
|
|
5
|
+
.option('-n, --name <name>', 'Name of the application')
|
|
6
|
+
.action(options => {
|
|
7
|
+
console.log('Creating a new tonk app...');
|
|
8
|
+
try {
|
|
9
|
+
// Build the command with any passed options
|
|
10
|
+
let createCommand = 'npx @tonk/create';
|
|
11
|
+
// Pass through any options provided to the CLI
|
|
12
|
+
if (options.name) {
|
|
13
|
+
createCommand += ` --name "${options.name}"`;
|
|
25
14
|
}
|
|
15
|
+
// Execute the create package
|
|
16
|
+
child_process.execSync(createCommand, {
|
|
17
|
+
stdio: 'inherit',
|
|
18
|
+
env: { ...process.env },
|
|
19
|
+
});
|
|
20
|
+
console.log('🎉 Tonk app created successfully!');
|
|
21
|
+
process.exit(0);
|
|
26
22
|
}
|
|
27
|
-
|
|
28
|
-
console.error('
|
|
29
|
-
/* eslint-disable-next-line */
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.error('Failed to create Tonk app:', error);
|
|
30
25
|
process.exit(1);
|
|
31
26
|
}
|
|
32
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,aAAa,MAAM,eAAe,CAAC;AAE1C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,4CAA4C,CAAC;KACzD,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,aAAa,MAAM,eAAe,CAAC;AAE1C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,4CAA4C,CAAC;KACzD,MAAM,CAAC,mBAAmB,EAAE,yBAAyB,CAAC;KACtD,MAAM,CAAC,OAAO,CAAC,EAAE;IAChB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAE1C,IAAI,CAAC;QACH,4CAA4C;QAC5C,IAAI,aAAa,GAAG,kBAAkB,CAAC;QAEvC,+CAA+C;QAC/C,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,aAAa,IAAI,YAAY,OAAO,CAAC,IAAI,GAAG,CAAC;QAC/C,CAAC;QAED,6BAA6B;QAC7B,aAAa,CAAC,QAAQ,CAAC,aAAa,EAAE;YACpC,KAAK,EAAE,SAAS;YAChB,GAAG,EAAE,EAAC,GAAG,OAAO,CAAC,GAAG,EAAC;SACtB,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;QACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonk/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "The Tonk stack command line utility",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
40
|
-
"@tonk/
|
|
41
|
-
"@tonk/
|
|
40
|
+
"@tonk/server": "^0.1.0",
|
|
41
|
+
"@tonk/create": "^0.1.1",
|
|
42
42
|
"chalk": "^5.3.0",
|
|
43
43
|
"commander": "^11.1.0",
|
|
44
44
|
"dotenv": "^16.4.7",
|
|
@@ -76,11 +76,11 @@
|
|
|
76
76
|
"license": "MIT",
|
|
77
77
|
"repository": {
|
|
78
78
|
"type": "git",
|
|
79
|
-
"url": "https://github.com/tonk-labs/
|
|
79
|
+
"url": "https://github.com/tonk-labs/tonk.git",
|
|
80
80
|
"directory": "packages/cli"
|
|
81
81
|
},
|
|
82
82
|
"bugs": {
|
|
83
|
-
"url": "https://github.com/tonk-labs/
|
|
83
|
+
"url": "https://github.com/tonk-labs/tonk/issues"
|
|
84
84
|
},
|
|
85
|
-
"homepage": "https://github.com/tonk-labs/
|
|
85
|
+
"homepage": "https://github.com/tonk-labs/tonk#readme"
|
|
86
86
|
}
|