platformatic 1.22.0 → 1.24.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.
- package/cli.js +10 -1
- package/help/help.txt +4 -0
- package/help/inject.txt +29 -0
- package/help/logs.txt +21 -0
- package/help/ps.txt +10 -0
- package/package.json +14 -13
package/cli.js
CHANGED
|
@@ -16,8 +16,13 @@ import helpMe from 'help-me'
|
|
|
16
16
|
import { upgrade } from './lib/upgrade.js'
|
|
17
17
|
import { gh } from './lib/gh.js'
|
|
18
18
|
import { deploy } from './lib/deploy.js'
|
|
19
|
-
|
|
20
19
|
import { logo } from './lib/ascii.js'
|
|
20
|
+
import {
|
|
21
|
+
runControl,
|
|
22
|
+
getRuntimesCommand,
|
|
23
|
+
injectRuntimeCommand,
|
|
24
|
+
streamRuntimeLogsCommand
|
|
25
|
+
} from '@platformatic/control/control.js'
|
|
21
26
|
|
|
22
27
|
const program = commist({ maxDistance: 2 })
|
|
23
28
|
const help = helpMe({
|
|
@@ -44,6 +49,10 @@ program.register('runtime', async (args) => ensureCommand(await runRuntime(args)
|
|
|
44
49
|
program.register('service', async (args) => ensureCommand(await runService(args)))
|
|
45
50
|
program.register('composer', async (args) => ensureCommand(await runComposer(args)))
|
|
46
51
|
program.register('start', async (args) => ensureCommand(await startCommand(args)))
|
|
52
|
+
program.register('ctl', async (args) => ensureCommand(await runControl(args)))
|
|
53
|
+
program.register('ps', async (args) => getRuntimesCommand(args))
|
|
54
|
+
program.register('inject', async (args) => injectRuntimeCommand(args))
|
|
55
|
+
program.register('logs', async (args) => streamRuntimeLogsCommand(args))
|
|
47
56
|
program.register('upgrade', upgrade)
|
|
48
57
|
program.register('client', client)
|
|
49
58
|
program.register('compile', compile)
|
package/help/help.txt
CHANGED
|
@@ -11,3 +11,7 @@ Welcome to Platformatic. Available commands are:
|
|
|
11
11
|
* `start` - start a Platformatic application.
|
|
12
12
|
* `login` - generate a Platformatic login api key.
|
|
13
13
|
* `client` - generate a Platformatic client.
|
|
14
|
+
* `ps` - list all platformatic runtime applications.
|
|
15
|
+
* `logs` - stream logs for a platformatic runtime application.
|
|
16
|
+
* `inject` - inject a request into a platformatic runtime application.
|
|
17
|
+
* `ctl` - Platformatic Control commands; `platformatic ctl help` to know more.
|
package/help/inject.txt
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Injects a request to the platformatic runtime service.
|
|
2
|
+
|
|
3
|
+
``` bash
|
|
4
|
+
$ platformatic inject -n runtime-name /hello
|
|
5
|
+
-X POST
|
|
6
|
+
-H "Content-Type: application/json"
|
|
7
|
+
-d '{"key": "value"}'
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Options:
|
|
11
|
+
|
|
12
|
+
* `-p, --pid <number>` - The process id of the runtime.
|
|
13
|
+
* `-n, --name <string>` - The name of the runtime.
|
|
14
|
+
* `-s, --service <string>` - The name of the runtime service.
|
|
15
|
+
* `-X, --request <string>` - The request HTTP method. Default is `GET`.
|
|
16
|
+
* `-H, --header <string>` - The request header. Can be used multiple times.
|
|
17
|
+
* `-d, --data <string>` - The request data.
|
|
18
|
+
* `-i, --include <boolean>` - Include the response headers in the output. Default is `false`.
|
|
19
|
+
* `-o, --output <file>` - Write the response to the specified file.
|
|
20
|
+
|
|
21
|
+
The `inject` command sends a request to the runtime service and prints the
|
|
22
|
+
response to the standard output. If the `--service` option is not specified the
|
|
23
|
+
request is sent to the runtime entrypoint.
|
|
24
|
+
|
|
25
|
+
The `inject` command uses the Platformatic Runtime Management API. To enable it
|
|
26
|
+
set the `managementApi` option to `true` in the runtime configuration file.
|
|
27
|
+
|
|
28
|
+
To get the list of runtimes with enabled management API use the
|
|
29
|
+
`platformatic ctl ps` command.
|
package/help/logs.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Streams logs from the platformatic runtime application.
|
|
2
|
+
|
|
3
|
+
``` bash
|
|
4
|
+
$ platformatic logs -n runtime-name
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
Options:
|
|
8
|
+
|
|
9
|
+
* `-p, --pid <number>` - The process id of the runtime.
|
|
10
|
+
* `-n, --name <string>` - The name of the runtime.
|
|
11
|
+
* `-l, --level <string>` - The pino log level to stream. Default is `info`.
|
|
12
|
+
* `-s, --service <string>` - The name of the service to stream logs from.
|
|
13
|
+
* `--pretty` <boolean> - Pretty print the logs. Default is `true`.
|
|
14
|
+
|
|
15
|
+
If `--service` is not specified, the command will stream logs from all services.
|
|
16
|
+
|
|
17
|
+
The `logs` command uses the Platformatic Runtime Management API. To enable it
|
|
18
|
+
set the `managementApi` option to `true` in the runtime configuration file.
|
|
19
|
+
|
|
20
|
+
To get the list of runtimes with enabled management API use the
|
|
21
|
+
`platformatic ctl ps` command.
|
package/help/ps.txt
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Lists all running platformatic runtime applications.
|
|
2
|
+
|
|
3
|
+
``` bash
|
|
4
|
+
$ platformatic ps
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
To see the list of all available control commands, run `platformatic ctl help`.
|
|
8
|
+
|
|
9
|
+
The `ps` command uses the Platformatic Runtime Management API. To enable it
|
|
10
|
+
set the `managementApi` option to `true` in the runtime configuration file.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "platformatic",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"description": "Platformatic CLI",
|
|
5
5
|
"main": "cli.js",
|
|
6
6
|
"type": "module",
|
|
@@ -51,18 +51,19 @@
|
|
|
51
51
|
"pino": "^8.17.2",
|
|
52
52
|
"pino-pretty": "^10.3.1",
|
|
53
53
|
"undici": "^6.6.0",
|
|
54
|
-
"@platformatic/authenticate": "1.
|
|
55
|
-
"@platformatic/client-cli": "1.
|
|
56
|
-
"@platformatic/
|
|
57
|
-
"@platformatic/
|
|
58
|
-
"@platformatic/
|
|
59
|
-
"@platformatic/
|
|
60
|
-
"@platformatic/
|
|
61
|
-
"@platformatic/
|
|
62
|
-
"@platformatic/
|
|
63
|
-
"@platformatic/
|
|
64
|
-
"@platformatic/
|
|
65
|
-
"create-platformatic": "1.
|
|
54
|
+
"@platformatic/authenticate": "1.24.0",
|
|
55
|
+
"@platformatic/client-cli": "1.24.0",
|
|
56
|
+
"@platformatic/config": "1.24.0",
|
|
57
|
+
"@platformatic/composer": "1.24.0",
|
|
58
|
+
"@platformatic/control": "1.24.0",
|
|
59
|
+
"@platformatic/deploy-client": "1.24.0",
|
|
60
|
+
"@platformatic/metaconfig": "1.24.0",
|
|
61
|
+
"@platformatic/frontend-template": "1.24.0",
|
|
62
|
+
"@platformatic/db": "1.24.0",
|
|
63
|
+
"@platformatic/runtime": "1.24.0",
|
|
64
|
+
"@platformatic/service": "1.24.0",
|
|
65
|
+
"create-platformatic": "1.24.0",
|
|
66
|
+
"@platformatic/utils": "1.24.0"
|
|
66
67
|
},
|
|
67
68
|
"scripts": {
|
|
68
69
|
"test": "pnpm run lint && borp --timeout 120000 --concurrency 1",
|