clawflowbang 1.0.0 → 1.0.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/.env.example +14 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +35 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
- package/.github/pull_request_template.md +19 -0
- package/.github/workflows/publish.yml +46 -0
- package/.github/workflows/test.yml +31 -0
- package/CODE_OF_CONDUCT.md +29 -0
- package/LICENSE +21 -0
- package/README.md +151 -1
- package/SECURITY.md +20 -0
- package/SUPPORT.md +21 -0
- package/bin/clawflowhub.js +60 -64
- package/package.json +18 -16
- package/src/commands/cron.js +71 -36
- package/src/commands/init.js +23 -23
- package/src/commands/install.js +17 -17
- package/src/commands/list.js +27 -25
- package/src/commands/remove.js +4 -4
- package/src/commands/search.js +23 -20
- package/src/commands/status.js +19 -25
- package/src/core/ConfigManager.js +132 -132
- package/src/core/CronManager.js +245 -245
- package/src/core/Installer.js +53 -53
- package/src/core/OpenClawCLI.js +62 -17
- package/src/core/TerminalUI.js +332 -0
- package/.eslintrc.json +0 -38
- package/__tests__/config-manager.test.js +0 -52
- package/__tests__/cron-format.test.js +0 -26
- package/__tests__/cron-manager.local.test.js +0 -65
- package/__tests__/openclaw-cli.test.js +0 -51
- package/docs/clawhub-package-format.md +0 -179
- package/examples/npm-package-example/package.json +0 -53
package/.env.example
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# ClawFlow local environment
|
|
2
|
+
DEBUG=
|
|
3
|
+
TZ=Asia/Bangkok
|
|
4
|
+
OPENCLAW_URL=http://localhost:18789
|
|
5
|
+
|
|
6
|
+
# Optional skill credentials
|
|
7
|
+
BINANCE_API_KEY=
|
|
8
|
+
BINANCE_SECRET_KEY=
|
|
9
|
+
FB_ACCESS_TOKEN=
|
|
10
|
+
TWITTER_API_KEY=
|
|
11
|
+
TWITTER_API_SECRET=
|
|
12
|
+
DISCORD_WEBHOOK=
|
|
13
|
+
GOOGLE_CREDENTIALS=
|
|
14
|
+
NOTION_TOKEN=
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Report a reproducible problem
|
|
4
|
+
title: "[bug] "
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Summary
|
|
10
|
+
|
|
11
|
+
Describe the problem clearly.
|
|
12
|
+
|
|
13
|
+
## Environment
|
|
14
|
+
|
|
15
|
+
- OS:
|
|
16
|
+
- Node.js version:
|
|
17
|
+
- CLI version (`clawflow --version`):
|
|
18
|
+
|
|
19
|
+
## Steps to Reproduce
|
|
20
|
+
|
|
21
|
+
1.
|
|
22
|
+
2.
|
|
23
|
+
3.
|
|
24
|
+
|
|
25
|
+
## Expected Behavior
|
|
26
|
+
|
|
27
|
+
What should happen.
|
|
28
|
+
|
|
29
|
+
## Actual Behavior
|
|
30
|
+
|
|
31
|
+
What actually happened.
|
|
32
|
+
|
|
33
|
+
## Logs / Output
|
|
34
|
+
|
|
35
|
+
Paste full command and error output.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an improvement
|
|
4
|
+
title: "[feature] "
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Problem
|
|
10
|
+
|
|
11
|
+
What problem are you trying to solve?
|
|
12
|
+
|
|
13
|
+
## Proposed Solution
|
|
14
|
+
|
|
15
|
+
Describe the behavior you want.
|
|
16
|
+
|
|
17
|
+
## Alternatives Considered
|
|
18
|
+
|
|
19
|
+
Other options you evaluated.
|
|
20
|
+
|
|
21
|
+
## Additional Context
|
|
22
|
+
|
|
23
|
+
Any examples, links, or screenshots.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
Explain what changed and why.
|
|
4
|
+
|
|
5
|
+
## Changes
|
|
6
|
+
|
|
7
|
+
-
|
|
8
|
+
|
|
9
|
+
## Validation
|
|
10
|
+
|
|
11
|
+
- [ ] `npm run lint`
|
|
12
|
+
- [ ] `npm test -- --runInBand`
|
|
13
|
+
- [ ] Manual test performed (if applicable)
|
|
14
|
+
|
|
15
|
+
## Checklist
|
|
16
|
+
|
|
17
|
+
- [ ] Backward compatibility considered
|
|
18
|
+
- [ ] Docs updated (README/CHANGELOG) if needed
|
|
19
|
+
- [ ] No secrets or local machine data committed
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
release:
|
|
8
|
+
types: [published]
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
packages: write
|
|
13
|
+
id-token: write
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
publish:
|
|
17
|
+
name: Publish package
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout
|
|
22
|
+
uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Use Node.js
|
|
25
|
+
uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: '18'
|
|
28
|
+
registry-url: 'https://registry.npmjs.org'
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: npm ci
|
|
32
|
+
|
|
33
|
+
- name: Publish to npm (using NPM_TOKEN)
|
|
34
|
+
if: secrets.NPM_TOKEN != ''
|
|
35
|
+
env:
|
|
36
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
37
|
+
run: |
|
|
38
|
+
echo "Publishing with NPM_TOKEN..."
|
|
39
|
+
npm publish --access public
|
|
40
|
+
|
|
41
|
+
- name: Publish to npm (OIDC / Trusted Publisher)
|
|
42
|
+
if: secrets.NPM_TOKEN == ''
|
|
43
|
+
run: |
|
|
44
|
+
echo "No NPM_TOKEN found. To publish without a stored token, set up a Trusted Publisher in npm and enable OIDC."
|
|
45
|
+
echo "See README or npm docs for steps to configure Trusted Publisher."
|
|
46
|
+
exit 1
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, develop]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Run tests
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Use Node.js
|
|
19
|
+
uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: '18'
|
|
22
|
+
cache: 'npm'
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: npm ci
|
|
26
|
+
|
|
27
|
+
- name: Run tests
|
|
28
|
+
run: npm test
|
|
29
|
+
|
|
30
|
+
- name: Run linter
|
|
31
|
+
run: npm run lint
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
This project follows the Contributor Covenant.
|
|
4
|
+
|
|
5
|
+
## Our Pledge
|
|
6
|
+
|
|
7
|
+
We aim to provide a respectful, harassment-free experience for everyone.
|
|
8
|
+
|
|
9
|
+
## Expected Behavior
|
|
10
|
+
|
|
11
|
+
- Be respectful and constructive.
|
|
12
|
+
- Assume good intent.
|
|
13
|
+
- Focus on technical discussion and collaboration.
|
|
14
|
+
|
|
15
|
+
## Unacceptable Behavior
|
|
16
|
+
|
|
17
|
+
- Harassment, abuse, discrimination, or hate speech.
|
|
18
|
+
- Personal attacks or threats.
|
|
19
|
+
- Sharing private information without consent.
|
|
20
|
+
|
|
21
|
+
## Enforcement
|
|
22
|
+
|
|
23
|
+
Maintainers may edit/remove content and restrict participation for violations.
|
|
24
|
+
|
|
25
|
+
Report issues to: `maintainers@clawflow.dev`
|
|
26
|
+
|
|
27
|
+
## Attribution
|
|
28
|
+
|
|
29
|
+
Adapted from Contributor Covenant: https://www.contributor-covenant.org
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ClawFlow Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1 +1,151 @@
|
|
|
1
|
-
# ClawFlow
|
|
1
|
+
# ClawFlow
|
|
2
|
+
|
|
3
|
+
`ClawFlow` is a CLI wrapper for OpenClaw that installs skill bundles and wires cron jobs in one flow.
|
|
4
|
+
|
|
5
|
+
Published package: `clawflowbang`
|
|
6
|
+
Primary command: `clawflow` (alias: `cfh`)
|
|
7
|
+
|
|
8
|
+
## What It Does
|
|
9
|
+
|
|
10
|
+
- Install package presets (skills + cron jobs) with one command.
|
|
11
|
+
- Install skills from ClawHub first, then fallback to Git clone if not found.
|
|
12
|
+
- Manage cron jobs through `openclaw cron` (add/edit/remove/list).
|
|
13
|
+
- Validate and normalize cron expressions before save.
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
- Node.js `>=16`
|
|
18
|
+
- OpenClaw CLI (`openclaw`)
|
|
19
|
+
- ClawHub CLI (`clawhub`) for registry skill install
|
|
20
|
+
- Git (used for fallback clone)
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm i -g clawflowbang
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Check:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
clawflow --version
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
Initialize local config:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
clawflow init
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Install a package preset:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
clawflow install trading-kit
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Check status:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
clawflow status
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Main Commands
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
clawflow install <package>
|
|
58
|
+
clawflow list [--available] [--npm]
|
|
59
|
+
clawflow search <query> [--no-npm]
|
|
60
|
+
clawflow remove <package>
|
|
61
|
+
|
|
62
|
+
clawflow cron-list
|
|
63
|
+
clawflow cron-add <skill> --schedule "*/5 * * * *"
|
|
64
|
+
clawflow cron-edit <id> --every 15m --description "updated job"
|
|
65
|
+
clawflow cron-remove <id>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Cron Input Formats
|
|
69
|
+
|
|
70
|
+
Supported formats:
|
|
71
|
+
|
|
72
|
+
- Raw cron: `*/5 * * * *`
|
|
73
|
+
- Preset: `@hourly`, `@daily`, `@weekly`, `@monthly`
|
|
74
|
+
- Shorthand: `5m`, `every 15m`, `1h`, `2d`
|
|
75
|
+
|
|
76
|
+
Examples:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
clawflow cron-add crypto-price --every 15m
|
|
80
|
+
clawflow cron-edit <job-id> --schedule "@daily"
|
|
81
|
+
clawflow cron-edit <job-id> --params '{"symbols":["BTC","ETH"]}'
|
|
82
|
+
clawflow cron-remove <job-id>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Skill Install Fallback (ClawHub -> Git)
|
|
86
|
+
|
|
87
|
+
When installing package skills:
|
|
88
|
+
|
|
89
|
+
1. Try `clawhub install`
|
|
90
|
+
2. If failed, try `git clone` when skill metadata provides repository info
|
|
91
|
+
3. Validate cloned skill by checking `SKILL.md`
|
|
92
|
+
|
|
93
|
+
Skill metadata fields for git fallback:
|
|
94
|
+
|
|
95
|
+
- `repository` or `repo` or `git`
|
|
96
|
+
- optional `branch` / `tag` / `ref`
|
|
97
|
+
|
|
98
|
+
## Paths Used by Default
|
|
99
|
+
|
|
100
|
+
- Skills path: `~/.openclaw/workspace/skills`
|
|
101
|
+
- Cron jobs file: `~/.openclaw/cron/jobs.json`
|
|
102
|
+
|
|
103
|
+
Override during install:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
clawflow install <package> \
|
|
107
|
+
--skills-path "<path-to-skills>" \
|
|
108
|
+
--cron-jobs "<path-to-jobs.json>"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## NPM Package Preset Format
|
|
112
|
+
|
|
113
|
+
`clawflow` can read package metadata from npm packages.
|
|
114
|
+
Use `clawflow` field in package.json:
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"name": "my-kit",
|
|
119
|
+
"version": "1.0.0",
|
|
120
|
+
"keywords": ["clawflow"],
|
|
121
|
+
"clawflow": {
|
|
122
|
+
"skills": [
|
|
123
|
+
{
|
|
124
|
+
"name": "crypto-price",
|
|
125
|
+
"version": "^1.0.0",
|
|
126
|
+
"source": "openclaw",
|
|
127
|
+
"repository": "https://github.com/owner/crypto-price-skill.git"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"crons": [
|
|
131
|
+
{
|
|
132
|
+
"skill": "crypto-price",
|
|
133
|
+
"schedule": "*/5 * * * *",
|
|
134
|
+
"params": { "symbols": ["BTC", "ETH"] }
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Development
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
npm install
|
|
145
|
+
npm run lint
|
|
146
|
+
npm test -- --runInBand
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
MIT
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
The latest published version is supported for security fixes.
|
|
6
|
+
|
|
7
|
+
## Reporting a Vulnerability
|
|
8
|
+
|
|
9
|
+
Please do not open a public issue for security vulnerabilities.
|
|
10
|
+
|
|
11
|
+
Report privately to: `maintainers@clawflow.dev`
|
|
12
|
+
|
|
13
|
+
Include:
|
|
14
|
+
|
|
15
|
+
- Affected version
|
|
16
|
+
- Steps to reproduce
|
|
17
|
+
- Impact
|
|
18
|
+
- Suggested mitigation (if any)
|
|
19
|
+
|
|
20
|
+
We will acknowledge receipt and follow up as quickly as possible.
|
package/SUPPORT.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Support
|
|
2
|
+
|
|
3
|
+
## Questions and Usage Help
|
|
4
|
+
|
|
5
|
+
- Open a GitHub Discussion (recommended for how-to questions)
|
|
6
|
+
- Open a GitHub Issue for bugs and feature requests
|
|
7
|
+
|
|
8
|
+
## Before Opening an Issue
|
|
9
|
+
|
|
10
|
+
- Confirm CLI version with `clawflow --version`
|
|
11
|
+
- Run `clawflow status`
|
|
12
|
+
- Include command used and full error output
|
|
13
|
+
- Include OS + Node.js version
|
|
14
|
+
|
|
15
|
+
## Scope
|
|
16
|
+
|
|
17
|
+
This project focuses on:
|
|
18
|
+
|
|
19
|
+
- OpenClaw skill installation orchestration
|
|
20
|
+
- Cron setup/management integration
|
|
21
|
+
- Package preset workflow
|
package/bin/clawflowhub.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
require('dotenv').config();
|
|
4
|
+
|
|
5
|
+
const { program } = require('commander');
|
|
6
|
+
const pkg = require('../package.json');
|
|
2
7
|
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const pkg = require('../package.json');
|
|
8
|
+
// Import TUI
|
|
9
|
+
const TUI = require('../src/core/TerminalUI');
|
|
6
10
|
|
|
7
11
|
// Import commands
|
|
8
12
|
const installCommand = require('../src/commands/install');
|
|
@@ -13,109 +17,101 @@ const statusCommand = require('../src/commands/status');
|
|
|
13
17
|
const initCommand = require('../src/commands/init');
|
|
14
18
|
const searchCommand = require('../src/commands/search');
|
|
15
19
|
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
║ ║
|
|
24
|
-
╚══════════════════════════════════════════════════════════╝
|
|
25
|
-
`));
|
|
26
|
-
|
|
27
|
-
program
|
|
28
|
-
.name('clawflow')
|
|
29
|
-
.description('ติดตั้ง OpenClaw skills พร้อม cronjob ให้พร้อมใช้งาน')
|
|
30
|
-
.version(pkg.version, '-v, --version', 'แสดงเวอร์ชัน');
|
|
20
|
+
// Print new TUI banner
|
|
21
|
+
TUI.printBanner(pkg.version);
|
|
22
|
+
|
|
23
|
+
program
|
|
24
|
+
.name('clawflow')
|
|
25
|
+
.description('Install OpenClaw skills and set up cronjobs')
|
|
26
|
+
.version(pkg.version, '-v, --version', 'Show version');
|
|
31
27
|
|
|
32
28
|
// Install command
|
|
33
29
|
program
|
|
34
30
|
.command('install <package>')
|
|
35
31
|
.alias('i')
|
|
36
|
-
.description('
|
|
37
|
-
.option('-g, --global', '
|
|
38
|
-
.option('-c, --config <path>', '
|
|
39
|
-
.option('--skills-path <path>', '
|
|
40
|
-
.option('--cron-jobs <path>', '
|
|
41
|
-
.option('--openclaw-bin <path>', '
|
|
42
|
-
.option('--clawhub-bin <path>', '
|
|
43
|
-
.option('--no-cron', '
|
|
44
|
-
.option('--dry-run', '
|
|
32
|
+
.description('Install a package including skills and cronjobs')
|
|
33
|
+
.option('-g, --global', 'Install globally')
|
|
34
|
+
.option('-c, --config <path>', 'Specify config file path')
|
|
35
|
+
.option('--skills-path <path>', 'Specify OpenClaw workspace skills path')
|
|
36
|
+
.option('--cron-jobs <path>', 'Specify OpenClaw cron jobs.json path')
|
|
37
|
+
.option('--openclaw-bin <path>', 'Path to openclaw CLI binary')
|
|
38
|
+
.option('--clawhub-bin <path>', 'Path to clawhub CLI binary')
|
|
39
|
+
.option('--no-cron', 'Install skills without creating cronjobs')
|
|
40
|
+
.option('--dry-run', 'Show what would be done without installing')
|
|
45
41
|
.action(installCommand);
|
|
46
42
|
|
|
47
43
|
// List command
|
|
48
44
|
program
|
|
49
45
|
.command('list')
|
|
50
46
|
.alias('ls')
|
|
51
|
-
.description('
|
|
52
|
-
.option('-a, --available', '
|
|
53
|
-
.option('-i, --installed', '
|
|
54
|
-
.option('--npm', '
|
|
47
|
+
.description('Show installed packages and skills')
|
|
48
|
+
.option('-a, --available', 'Show packages available for install')
|
|
49
|
+
.option('-i, --installed', 'Show installed packages (default)')
|
|
50
|
+
.option('--npm', 'Include packages from npm registry (with --available)')
|
|
55
51
|
.action(listCommand);
|
|
56
52
|
|
|
57
53
|
// Search command
|
|
58
54
|
program
|
|
59
55
|
.command('search <query>')
|
|
60
56
|
.alias('find')
|
|
61
|
-
.description('
|
|
62
|
-
.option('--no-npm', '
|
|
57
|
+
.description('Search packages in the registry')
|
|
58
|
+
.option('--no-npm', 'Exclude results from npm registry')
|
|
63
59
|
.action(searchCommand);
|
|
64
60
|
|
|
65
61
|
// Remove command
|
|
66
62
|
program
|
|
67
63
|
.command('remove <package>')
|
|
68
64
|
.alias('rm')
|
|
69
|
-
.description('
|
|
70
|
-
.option('-g, --global', '
|
|
71
|
-
.option('--keep-config', '
|
|
65
|
+
.description('Uninstall a package')
|
|
66
|
+
.option('-g, --global', 'Uninstall globally')
|
|
67
|
+
.option('--keep-config', 'Keep package config files')
|
|
72
68
|
.action(removeCommand);
|
|
73
69
|
|
|
74
70
|
// Cron command group
|
|
75
71
|
program
|
|
76
72
|
.command('cron-list')
|
|
77
|
-
.description('
|
|
73
|
+
.description('List all cronjobs')
|
|
78
74
|
.action(cronCommand.list);
|
|
79
75
|
|
|
80
|
-
program
|
|
81
|
-
.command('cron-add <skill>')
|
|
82
|
-
.description('
|
|
83
|
-
.option('-s, --schedule <expression>', 'cron schedule expression', '*/5 * * * *')
|
|
84
|
-
.option('-e, --every <duration>', '
|
|
85
|
-
.option('-d, --description <text>', '
|
|
86
|
-
.option('-p, --params <json>', '
|
|
87
|
-
.action(cronCommand.add);
|
|
88
|
-
|
|
89
|
-
program
|
|
90
|
-
.command('cron-edit <id>')
|
|
91
|
-
.description('
|
|
92
|
-
.option('-s, --schedule <expression>', 'cron schedule expression
|
|
93
|
-
.option('-e, --every <duration>', '
|
|
94
|
-
.option('-d, --description <text>', '
|
|
95
|
-
.option('-p, --params <json>', 'parameters
|
|
96
|
-
.action(cronCommand.edit);
|
|
97
|
-
|
|
98
|
-
program
|
|
99
|
-
.command('cron-remove <id>')
|
|
100
|
-
.description('
|
|
101
|
-
.action(cronCommand.remove);
|
|
76
|
+
program
|
|
77
|
+
.command('cron-add <skill>')
|
|
78
|
+
.description('Add a cronjob for a skill')
|
|
79
|
+
.option('-s, --schedule <expression>', 'cron schedule expression', '*/5 * * * *')
|
|
80
|
+
.option('-e, --every <duration>', 'Shorthand like 5m, 1h, 2d')
|
|
81
|
+
.option('-d, --description <text>', 'Cronjob description')
|
|
82
|
+
.option('-p, --params <json>', 'Parameters for the skill')
|
|
83
|
+
.action(cronCommand.add);
|
|
84
|
+
|
|
85
|
+
program
|
|
86
|
+
.command('cron-edit <id>')
|
|
87
|
+
.description('Edit a cronjob')
|
|
88
|
+
.option('-s, --schedule <expression>', 'New cron schedule expression')
|
|
89
|
+
.option('-e, --every <duration>', 'Shorthand like 5m, 1h, 2d')
|
|
90
|
+
.option('-d, --description <text>', 'New description')
|
|
91
|
+
.option('-p, --params <json>', 'New parameters for the skill')
|
|
92
|
+
.action(cronCommand.edit);
|
|
93
|
+
|
|
94
|
+
program
|
|
95
|
+
.command('cron-remove <id>')
|
|
96
|
+
.description('Remove a cronjob')
|
|
97
|
+
.action(cronCommand.remove);
|
|
102
98
|
|
|
103
99
|
// Status command
|
|
104
100
|
program
|
|
105
101
|
.command('status')
|
|
106
|
-
.description('
|
|
102
|
+
.description('Show system status')
|
|
107
103
|
.action(statusCommand);
|
|
108
104
|
|
|
109
105
|
// Init command
|
|
110
106
|
program
|
|
111
107
|
.command('init')
|
|
112
|
-
.description('
|
|
113
|
-
.option('-f, --force', '
|
|
108
|
+
.description('Initialize ClawFlow in the current directory')
|
|
109
|
+
.option('-f, --force', 'Overwrite existing config')
|
|
114
110
|
.action(initCommand);
|
|
115
111
|
|
|
116
112
|
// Global error handler
|
|
117
113
|
process.on('unhandledRejection', (err) => {
|
|
118
|
-
|
|
114
|
+
TUI.printError('เกิดข้อผิดพลาด: ' + err.message);
|
|
119
115
|
if (process.env.DEBUG) {
|
|
120
116
|
console.error(err.stack);
|
|
121
117
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "clawflowbang",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Skill + Cron Installer for OpenClaw -
|
|
2
|
+
"name": "clawflowbang",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Skill + Cron Installer for OpenClaw - Install skills and configure them for immediate use",
|
|
5
5
|
"main": "src/index.js",
|
|
6
|
-
"bin": {
|
|
7
|
-
"clawflow": "bin/clawflowhub.js",
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
},
|
|
6
|
+
"bin": {
|
|
7
|
+
"clawflow": "bin/clawflowhub.js",
|
|
8
|
+
"cfh": "bin/clawflowhub.js"
|
|
9
|
+
},
|
|
11
10
|
"scripts": {
|
|
12
11
|
"start": "node bin/clawflowhub.js",
|
|
13
12
|
"test": "jest",
|
|
@@ -25,19 +24,22 @@
|
|
|
25
24
|
"author": "ClawFlow Team",
|
|
26
25
|
"license": "MIT",
|
|
27
26
|
"dependencies": {
|
|
28
|
-
"
|
|
27
|
+
"axios": "^1.5.0",
|
|
28
|
+
"boxen": "^8.0.1",
|
|
29
29
|
"chalk": "^4.1.2",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
30
|
+
"commander": "^11.0.0",
|
|
31
|
+
"dotenv": "^16.6.1",
|
|
32
32
|
"fs-extra": "^11.1.1",
|
|
33
|
+
"gradient-string": "^3.0.0",
|
|
34
|
+
"inquirer": "^8.2.6",
|
|
33
35
|
"node-cron": "^3.0.3",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
36
|
+
"ora": "^5.4.1",
|
|
37
|
+
"semver": "^7.5.4",
|
|
38
|
+
"yaml": "^2.3.2"
|
|
37
39
|
},
|
|
38
40
|
"devDependencies": {
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
+
"eslint": "^8.47.0",
|
|
42
|
+
"jest": "^29.6.4"
|
|
41
43
|
},
|
|
42
44
|
"engines": {
|
|
43
45
|
"node": ">=16.0.0"
|