@tonk/cli 0.1.0 → 0.1.2
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 +68 -3
- package/dist/commands/create.js +5 -5
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/hello.d.ts +3 -0
- package/dist/commands/hello.d.ts.map +1 -0
- package/dist/commands/hello.js +35 -0
- package/dist/commands/hello.js.map +1 -0
- package/dist/tonk.js +2 -0
- package/dist/tonk.js.map +1 -1
- package/package.json +4 -5
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
|
-
2. Install dependencies: `
|
|
9
|
-
|
|
10
|
-
4. Run the dev mode: `pnpm run dev`
|
|
74
|
+
2. Install dependencies: `npm install`
|
|
75
|
+
4. Run the dev mode: `npm run dev`
|
|
11
76
|
|
|
12
77
|
## License
|
|
13
78
|
|
package/dist/commands/create.js
CHANGED
|
@@ -2,16 +2,16 @@ 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(
|
|
5
|
+
.argument('[name]', 'Name of the application')
|
|
6
|
+
.action(name => {
|
|
7
7
|
console.log('Creating a new tonk app...');
|
|
8
8
|
try {
|
|
9
9
|
// Build the command with any passed options
|
|
10
10
|
let createCommand = 'npx @tonk/create';
|
|
11
11
|
// Pass through any options provided to the CLI
|
|
12
|
-
if (
|
|
13
|
-
createCommand += `
|
|
14
|
-
|
|
12
|
+
if (name)
|
|
13
|
+
createCommand += ` "${name}"`;
|
|
14
|
+
console.log(createCommand);
|
|
15
15
|
// Execute the create package
|
|
16
16
|
child_process.execSync(createCommand, {
|
|
17
17
|
stdio: 'inherit',
|
|
@@ -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,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAC;KAC7C,MAAM,CAAC,IAAI,CAAC,EAAE;IACb,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAE1C,IAAI,CAAC;QACH,4CAA4C;QAC5C,IAAI,aAAa,GAAG,kBAAkB,CAAC;QAEvC,+CAA+C;QAC/C,IAAI,IAAI;YAAE,aAAa,IAAI,KAAK,IAAI,GAAG,CAAC;QAExC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAE3B,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hello.d.ts","sourceRoot":"","sources":["../../src/commands/hello.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAGlC,eAAO,MAAM,YAAY,SA+BrB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
export const helloCommand = new Command('hello')
|
|
4
|
+
.description('Display a welcome message for Tonk')
|
|
5
|
+
.action(() => {
|
|
6
|
+
console.log(`
|
|
7
|
+
・。゜☆。・゜。・。゜☆。・゜★・。゜☆。・゜。・。゜☆。・゜☆。・゜
|
|
8
|
+
|
|
9
|
+
_____ U ___ u _ _ _ __
|
|
10
|
+
|_ " _| \/"_ \/ | \ |"| |"|/ /
|
|
11
|
+
| | | | | |<| \| |> | ' /
|
|
12
|
+
/| |\.-,_| |_| |U| |\ |u U/| . \\u
|
|
13
|
+
u |_|U \_)-\___/ |_| \_| |_|\_\
|
|
14
|
+
_// \\_ \\ || \\,-.,-,>> \\,-.
|
|
15
|
+
(__) (__) (__) (_") (_/ \.) (_/
|
|
16
|
+
|
|
17
|
+
・。゜☆。・゜。・。゜☆。・゜★・。゜☆。・゜。・。゜☆。・゜☆。・゜
|
|
18
|
+
|
|
19
|
+
Welcome to Tonk!
|
|
20
|
+
|
|
21
|
+
We're excited to work with you in building your own ☆𝐿𝒾𝓉𝓉𝓁𝑒 𝐼𝓃𝓉𝑒𝓇𝓃𝑒𝓉☆.
|
|
22
|
+
|
|
23
|
+
To get started...
|
|
24
|
+
|
|
25
|
+
1. Create your first app by running the command: ${chalk.cyan('tonk create [app name]')}.
|
|
26
|
+
2. Start the app with: ${chalk.cyan('npm run dev')}
|
|
27
|
+
3. Open in your favorite code editor and vibe.
|
|
28
|
+
|
|
29
|
+
You can find more information and how to reach us at ${chalk.blue('https://tonk.xyz')}. Feel free to ask for help in the Telegram chat or just say hello.
|
|
30
|
+
|
|
31
|
+
Cheers!
|
|
32
|
+
`);
|
|
33
|
+
process.exit(0);
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=hello.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hello.js","sourceRoot":"","sources":["../../src/commands/hello.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;KAC7C,WAAW,CAAC,oCAAoC,CAAC;KACjD,MAAM,CAAC,GAAG,EAAE;IACX,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;mDAmBmC,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC;yBAC9D,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC;;;uDAGK,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC;;;CAGpF,CAAC,CAAC;IACC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/tonk.js
CHANGED
|
@@ -4,6 +4,7 @@ import { devCommand } from './commands/dev.js';
|
|
|
4
4
|
import { serveCommand } from './commands/serve.js';
|
|
5
5
|
import { deployCommand } from './commands/deploy.js';
|
|
6
6
|
import { configCommand } from './commands/config.js';
|
|
7
|
+
import { helloCommand } from './commands/hello.js';
|
|
7
8
|
const program = new Command();
|
|
8
9
|
// Main program setup
|
|
9
10
|
program
|
|
@@ -18,6 +19,7 @@ program.addCommand(devCommand);
|
|
|
18
19
|
program.addCommand(serveCommand);
|
|
19
20
|
program.addCommand(deployCommand);
|
|
20
21
|
program.addCommand(configCommand);
|
|
22
|
+
program.addCommand(helloCommand);
|
|
21
23
|
// Parse arguments
|
|
22
24
|
program.parse();
|
|
23
25
|
// Show help if no arguments provided
|
package/dist/tonk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tonk.js","sourceRoot":"","sources":["../src/tonk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"tonk.js","sourceRoot":"","sources":["../src/tonk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AAEjD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,qBAAqB;AACrB,OAAO;KACJ,IAAI,CAAC,MAAM,CAAC;KACZ,WAAW,CAAC,4DAA4D,CAAC;KACzE,OAAO,CAAC,OAAO,CAAC;KAChB,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;IACjB,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AACrC,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAC/B,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AAEjC,kBAAkB;AAClB,OAAO,CAAC,KAAK,EAAE,CAAC;AAEhB,qCAAqC;AACrC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,EAAE,CAAC;AACvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonk/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "The Tonk stack command line utility",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
40
|
-
"@tonk/tinyfoot-mcp-server": "^0.1.2",
|
|
41
40
|
"@tonk/server": "^0.1.0",
|
|
42
41
|
"@tonk/create": "^0.1.1",
|
|
43
42
|
"chalk": "^5.3.0",
|
|
@@ -77,11 +76,11 @@
|
|
|
77
76
|
"license": "MIT",
|
|
78
77
|
"repository": {
|
|
79
78
|
"type": "git",
|
|
80
|
-
"url": "https://github.com/tonk-labs/
|
|
79
|
+
"url": "https://github.com/tonk-labs/tonk.git",
|
|
81
80
|
"directory": "packages/cli"
|
|
82
81
|
},
|
|
83
82
|
"bugs": {
|
|
84
|
-
"url": "https://github.com/tonk-labs/
|
|
83
|
+
"url": "https://github.com/tonk-labs/tonk/issues"
|
|
85
84
|
},
|
|
86
|
-
"homepage": "https://github.com/tonk-labs/
|
|
85
|
+
"homepage": "https://github.com/tonk-labs/tonk#readme"
|
|
87
86
|
}
|