clawflowbang 1.0.2 → 1.1.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/README.md CHANGED
@@ -1,45 +1,52 @@
1
- # ClawFlow
1
+ # 🦞 ClawFlow
2
2
 
3
- `ClawFlow` is a CLI wrapper for OpenClaw that installs skill bundles and wires cron jobs in one flow.
3
+ **ClawFlow** is a skill + cron installer for OpenClaw/OpenKrab ecosystem.
4
+ It installs skill bundles and wires cron jobs in one flow, providing both CLI automation and package management.
4
5
 
5
- Published package: `clawflowbang`
6
- Primary command: `clawflow` (alias: `cfh`)
6
+ <p align="center">
7
+ <img src="/public/banner.png" alt="ClawFlow Banner" width="700">
8
+ </p>
7
9
 
8
- ## What It Does
10
+ ## Features
9
11
 
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.
12
+ - **Package Management**: Install skill bundles with one command from ClawHub or Git
13
+ - **Cron Automation**: Schedule and manage automated skill execution
14
+ - **Fallback Installation**: ClawHub registry first, Git clone fallback
15
+ - **Cron Validation**: Normalize and validate cron expressions
16
+ - **CLI Interface**: Fast command-line tool (`clawflow` / `cfh`)
17
+ - **NPM Integration**: Published as `clawflowbang` package
18
+ - **Cross Platform**: Node.js based with Windows/Linux/macOS support
14
19
 
15
- ## Requirements
20
+ ---
16
21
 
17
- - Node.js `>=16`
22
+ ## Quick Start
23
+
24
+ ### Prerequisites
25
+
26
+ - Node.js 16+
18
27
  - OpenClaw CLI (`openclaw`)
19
- - ClawHub CLI (`clawhub`) for registry skill install
20
- - Git (used for fallback clone)
28
+ - ClawHub CLI (`clawhub`) for registry access
29
+ - Git (for fallback installation)
21
30
 
22
- ## Install
31
+ ### Installation
23
32
 
24
33
  ```bash
25
34
  npm i -g clawflowbang
26
35
  ```
27
36
 
28
- Check:
37
+ Verify installation:
29
38
 
30
39
  ```bash
31
40
  clawflow --version
32
41
  ```
33
42
 
34
- ## Quick Start
35
-
36
- Initialize local config:
43
+ ### Initial Setup
37
44
 
38
45
  ```bash
39
46
  clawflow init
40
47
  ```
41
48
 
42
- Install a package preset:
49
+ ### Install Your First Package
43
50
 
44
51
  ```bash
45
52
  clawflow install trading-kit
@@ -51,29 +58,39 @@ Check status:
51
58
  clawflow status
52
59
  ```
53
60
 
54
- ## Main Commands
61
+ ---
62
+
63
+ ## Core Commands
64
+
65
+ ### Package Management
66
+
67
+ ```bash
68
+ clawflow install <package> # Install skill bundle
69
+ clawflow list [--available] [--npm] # List installed/available packages
70
+ clawflow search <query> [--no-npm] # Search packages
71
+ clawflow remove <package> # Remove installed package
72
+ ```
73
+
74
+ ### Cron Operations
55
75
 
56
76
  ```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>
77
+ clawflow cron-list # List all cron jobs
78
+ clawflow cron-add <skill> --schedule "*/5 * * * *" # Add new cron job
79
+ clawflow cron-edit <id> --every 15m --description "updated job" # Modify existing
80
+ clawflow cron-remove <id> # Remove cron job
66
81
  ```
67
82
 
83
+ ---
84
+
68
85
  ## Cron Input Formats
69
86
 
70
87
  Supported formats:
71
88
 
72
- - Raw cron: `*/5 * * * *`
73
- - Preset: `@hourly`, `@daily`, `@weekly`, `@monthly`
74
- - Shorthand: `5m`, `every 15m`, `1h`, `2d`
89
+ - **Raw cron**: `*/5 * * * *`
90
+ - **Preset**: `@hourly`, `@daily`, `@weekly`, `@monthly`
91
+ - **Shorthand**: `5m`, `every 15m`, `1h`, `2d`
75
92
 
76
- Examples:
93
+ ### Examples
77
94
 
78
95
  ```bash
79
96
  clawflow cron-add crypto-price --every 15m
@@ -82,25 +99,35 @@ clawflow cron-edit <job-id> --params '{"symbols":["BTC","ETH"]}'
82
99
  clawflow cron-remove <job-id>
83
100
  ```
84
101
 
85
- ## Skill Install Fallback (ClawHub -> Git)
102
+ ---
86
103
 
87
- When installing package skills:
104
+ ## Installation Flow
88
105
 
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`
106
+ ### Skill Installation Strategy
92
107
 
93
- Skill metadata fields for git fallback:
108
+ 1. **Primary**: Try `clawhub install` from registry
109
+ 2. **Fallback**: Use `git clone` when registry fails
110
+ 3. **Validation**: Check `SKILL.md` exists and is valid
94
111
 
95
- - `repository` or `repo` or `git`
96
- - optional `branch` / `tag` / `ref`
112
+ ### Git Fallback Metadata
97
113
 
98
- ## Paths Used by Default
114
+ Required fields in package metadata:
99
115
 
100
- - Skills path: `~/.openclaw/workspace/skills`
116
+ - `repository` or `repo` or `git` - Git repository URL
117
+ - Optional: `branch` / `tag` / `ref` - Specific version
118
+
119
+ ---
120
+
121
+ ## Configuration
122
+
123
+ ### Default Paths
124
+
125
+ - Skills directory: `~/.openclaw/workspace/skills`
101
126
  - Cron jobs file: `~/.openclaw/cron/jobs.json`
102
127
 
103
- Override during install:
128
+ ### Custom Paths
129
+
130
+ Override defaults during installation:
104
131
 
105
132
  ```bash
106
133
  clawflow install <package> \
@@ -108,10 +135,11 @@ clawflow install <package> \
108
135
  --cron-jobs "<path-to-jobs.json>"
109
136
  ```
110
137
 
111
- ## NPM Package Preset Format
138
+ ---
139
+
140
+ ## NPM Package Format
112
141
 
113
- `clawflow` can read package metadata from npm packages.
114
- Use `clawflow` field in package.json:
142
+ `clawflow` reads package metadata from npm packages using the `clawflow` field:
115
143
 
116
144
  ```json
117
145
  {
@@ -138,14 +166,99 @@ Use `clawflow` field in package.json:
138
166
  }
139
167
  ```
140
168
 
169
+ ---
170
+
171
+ ## Tech Stack
172
+
173
+ - **Node.js 16+** - Core runtime
174
+ - **Commander.js** - CLI framework
175
+ - **Node-cron** - Cron job management
176
+ - **Axios** - HTTP requests for registry
177
+ - **Chalk + Gradient-string** - Terminal styling
178
+ - **Inquirer.js** - Interactive prompts
179
+ - **YAML** - Configuration parsing
180
+ - **Boxen** - Beautiful terminal boxes
181
+
182
+ ---
183
+
184
+ ## Project Structure
185
+
186
+ ```
187
+ ClawFlowHub/
188
+ ├── bin/
189
+ │ └── clawflowhub.js # CLI entry point
190
+ ├── src/
191
+ │ ├── index.js # Main module
192
+ │ ├── commands/ # Command implementations
193
+ │ ├── utils/ # Utility functions
194
+ │ └── config/ # Configuration management
195
+ ├── skills/ # Example skills
196
+ ├── examples/ # Usage examples
197
+ ├── docs/ # Documentation
198
+ ├── tests/ # Test suite
199
+ ├── package.json # NPM package config
200
+ ├── image.png # Project banner
201
+ └── README.md # This file
202
+ ```
203
+
204
+ ---
205
+
141
206
  ## Development
142
207
 
208
+ ### Setup
209
+
143
210
  ```bash
211
+ git clone https://github.com/OpenKrab/ClawFlowHub.git
212
+ cd ClawFlowHub
144
213
  npm install
145
- npm run lint
146
- npm test -- --runInBand
147
214
  ```
148
215
 
216
+ ### Development Commands
217
+
218
+ ```bash
219
+ npm run lint # Lint code
220
+ npm test # Run test suite
221
+ npm start # Run CLI locally
222
+ ```
223
+
224
+ ### Testing
225
+
226
+ ```bash
227
+ # Test basic functionality
228
+ clawflow --help
229
+ clawflow list --available
230
+ clawflow search crypto
231
+ ```
232
+
233
+ ---
234
+
235
+ ## OpenClaw Integration
236
+
237
+ ClawFlow integrates with OpenClaw ecosystem through:
238
+
239
+ - **Skill Installation**: Direct integration with OpenClaw skill system
240
+ - **Cron Management**: Uses OpenClaw's cron job infrastructure
241
+ - **Registry Access**: Leverages ClawHub for skill discovery
242
+ - **Configuration**: Respects OpenClaw's configuration patterns
243
+
244
+ ---
245
+
246
+ ## Contributing
247
+
248
+ PRs are welcome! Please ensure:
249
+
250
+ 1. Code follows existing ESLint patterns
251
+ 2. Add tests for new functionality
252
+ 3. Update documentation as needed
253
+ 4. Test cross-platform compatibility
254
+ 5. Follow semantic versioning
255
+
256
+ ---
257
+
149
258
  ## License
150
259
 
151
260
  MIT
261
+
262
+ ---
263
+
264
+ *Built for the Lobster Way 🦞*
@@ -1,117 +1,203 @@
1
- #!/usr/bin/env node
2
-
3
- require('dotenv').config();
4
-
5
- const { program } = require('commander');
6
- const pkg = require('../package.json');
1
+ #!/usr/bin/env node
2
+
3
+ require("dotenv").config();
4
+
5
+ const { program } = require("commander");
6
+ const pkg = require("../package.json");
7
+ const chalk = require("chalk");
7
8
 
8
9
  // Import TUI
9
- const TUI = require('../src/core/TerminalUI');
10
+ const TUI = require("../src/core/TerminalUI");
10
11
 
11
12
  // Import commands
12
- const installCommand = require('../src/commands/install');
13
- const listCommand = require('../src/commands/list');
14
- const removeCommand = require('../src/commands/remove');
15
- const cronCommand = require('../src/commands/cron');
16
- const statusCommand = require('../src/commands/status');
17
- const initCommand = require('../src/commands/init');
18
- const searchCommand = require('../src/commands/search');
13
+ const installCommand = require("../src/commands/install");
14
+ const listCommand = require("../src/commands/list");
15
+ const removeCommand = require("../src/commands/remove");
16
+ const cronCommand = require("../src/commands/cron");
17
+ const statusCommand = require("../src/commands/status");
18
+ const initCommand = require("../src/commands/init");
19
+ const searchCommand = require("../src/commands/search");
20
+ const createCommand = require("../src/commands/create");
21
+ const doctorCommand = require("../src/commands/doctor");
22
+ const registerCommand = require("../src/commands/register");
23
+ const updateCommand = require("../src/commands/update");
24
+
25
+ const exploreCommand = require("../src/commands/explore"); // Added exploreCommand
19
26
 
20
27
  // Print new TUI banner
21
28
  TUI.printBanner(pkg.version);
22
29
 
23
30
  program
24
- .name('clawflow')
25
- .description('Install OpenClaw skills and set up cronjobs')
26
- .version(pkg.version, '-v, --version', 'Show version');
31
+ .name("clawflow")
32
+ .description("Install OpenClaw skills and set up cronjobs")
33
+ .version(pkg.version, "-v, --version", "Show version");
34
+
35
+ // Create command
36
+ program
37
+ .command("create [type] [name]")
38
+ .description("Create a new skill or agent template")
39
+ .action(createCommand);
27
40
 
28
41
  // Install command
42
+
29
43
  program
30
- .command('install <package>')
31
- .alias('i')
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')
44
+ .command("install <package>")
45
+ .alias("i")
46
+ .description("Install a package including skills and cronjobs")
47
+ .option("-g, --global", "Install globally")
48
+ .option("-c, --config <path>", "Specify config file path")
49
+ .option("--skills-path <path>", "Specify OpenClaw workspace skills path")
50
+ .option("--cron-jobs <path>", "Specify OpenClaw cron jobs.json path")
51
+ .option("--openclaw-bin <path>", "Path to openclaw CLI binary")
52
+ .option("--clawhub-bin <path>", "Path to clawhub CLI binary")
53
+ .option("--no-cron", "Install skills without creating cronjobs")
54
+ .option("--dry-run", "Show what would be done without installing")
55
+ .option("--dev", "Local development mode (symlink skills)") // Added --dev option
56
+ .option("--bundle", "Install multiple skills if found in repository") // Added --bundle option
41
57
  .action(installCommand);
42
58
 
43
59
  // List command
44
60
  program
45
- .command('list')
46
- .alias('ls')
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)')
61
+ .command("list")
62
+ .alias("ls")
63
+ .description("Show installed packages and skills")
64
+ .option("-a, --available", "Show packages available for install")
65
+ .option("-i, --installed", "Show installed packages (default)")
66
+ .option("--npm", "Include packages from npm registry (with --available)")
51
67
  .action(listCommand);
52
68
 
53
69
  // Search command
54
70
  program
55
- .command('search <query>')
56
- .alias('find')
57
- .description('Search packages in the registry')
58
- .option('--no-npm', 'Exclude results from npm registry')
71
+ .command("search <query>")
72
+ .alias("find")
73
+ .description("Search packages in the registry")
74
+ .option("--no-npm", "Exclude results from npm registry")
59
75
  .action(searchCommand);
60
76
 
61
77
  // Remove command
62
78
  program
63
- .command('remove <package>')
64
- .alias('rm')
65
- .description('Uninstall a package')
66
- .option('-g, --global', 'Uninstall globally')
67
- .option('--keep-config', 'Keep package config files')
79
+ .command("remove <package>")
80
+ .alias("rm")
81
+ .description("Uninstall a package")
82
+ .option("-g, --global", "Uninstall globally")
83
+ .option("--keep-config", "Keep package config files")
68
84
  .action(removeCommand);
69
85
 
70
86
  // Cron command group
71
87
  program
72
- .command('cron-list')
73
- .description('List all cronjobs')
88
+ .command("cron-list")
89
+ .description("List all cronjobs")
74
90
  .action(cronCommand.list);
75
91
 
76
92
  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')
93
+ .command("cron-add <skill>")
94
+ .description("Add a cronjob for a skill")
95
+ .option(
96
+ "-s, --schedule <expression>",
97
+ "cron schedule expression",
98
+ "*/5 * * * *",
99
+ )
100
+ .option("-e, --every <duration>", "Shorthand like 5m, 1h, 2d")
101
+ .option("-d, --description <text>", "Cronjob description")
102
+ .option("-p, --params <json>", "Parameters for the skill")
103
+ .option("--dry-run", "Show what would be done without adding")
83
104
  .action(cronCommand.add);
84
105
 
85
106
  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')
107
+ .command("cron-edit <id>")
108
+ .description("Edit a cronjob")
109
+ .option("-s, --schedule <expression>", "New cron schedule expression")
110
+ .option("-e, --every <duration>", "Shorthand like 5m, 1h, 2d")
111
+ .option("-d, --description <text>", "New description")
112
+ .option("-p, --params <json>", "New parameters for the skill")
92
113
  .action(cronCommand.edit);
93
114
 
94
115
  program
95
- .command('cron-remove <id>')
96
- .description('Remove a cronjob')
116
+ .command("cron-remove <id>")
117
+ .description("Remove a cronjob")
97
118
  .action(cronCommand.remove);
98
119
 
99
120
  // Status command
100
121
  program
101
- .command('status')
102
- .description('Show system status')
122
+ .command("status")
123
+ .description("Show system status")
103
124
  .action(statusCommand);
104
125
 
126
+ // Register command
127
+ program
128
+ .command("register [path]")
129
+ .description("Register a local skill or agent to OpenClaw")
130
+ .action(registerCommand);
131
+
132
+ // Doctor command
133
+
134
+ program
135
+ .command("doctor")
136
+ .description("Check system compatibility and configuration")
137
+ .action(doctorCommand);
138
+
139
+ // Publish command (stub)
140
+ program
141
+ .command("publish [path]")
142
+ .description("Publish a skill/agent to ClawHub")
143
+ .action(() => {
144
+ console.log(chalk.yellow("\n📦 clawflow publish is coming soon!"));
145
+ console.log(
146
+ chalk.gray(
147
+ "In the meantime, please use git to push to your repository.\n",
148
+ ),
149
+ );
150
+ });
151
+
152
+ // Test command (stub)
153
+ program
154
+ .command("test <skill>")
155
+ .description("Run tests or examples for a skill")
156
+ .action((skill) => {
157
+ console.log(chalk.cyan(`\n🧪 Testing skill: ${skill}...`));
158
+ console.log(chalk.yellow("Test runner integration is coming soon!\n"));
159
+ });
160
+
161
+ // Integration commands
162
+ program
163
+ .command("graph-add <skill>")
164
+ .description("Add a skill node to ClawGraph")
165
+ .action((skill) => {
166
+ console.log(chalk.cyan(`\n🕸️ Integrating ${skill} into ClawGraph...`));
167
+ console.log(chalk.yellow("ClawGraph integration is coming soon!\n"));
168
+ });
169
+
170
+ program
171
+ .command("team-join <agent>")
172
+ .description("Register an agent to ClawTeam")
173
+ .action((agent) => {
174
+ console.log(chalk.cyan(`\n👥 Adding ${agent} to ClawTeam...`));
175
+ console.log(chalk.yellow("ClawTeam integration is coming soon!\n"));
176
+ });
177
+
178
+ // Update command
179
+
180
+ program
181
+ .command("update")
182
+ .description("Update ClawFlow CLI to the latest version")
183
+ .action(updateCommand);
184
+
185
+ // Explore command
186
+ program
187
+ .command("explore")
188
+ .description("Explore available skills and agents on ClawHub")
189
+ .action(exploreCommand);
190
+
105
191
  // Init command
106
192
  program
107
- .command('init')
108
- .description('Initialize ClawFlow in the current directory')
109
- .option('-f, --force', 'Overwrite existing config')
193
+ .command("init")
194
+ .description("Initialize ClawFlow in the current directory")
195
+ .option("-f, --force", "Overwrite existing config")
110
196
  .action(initCommand);
111
197
 
112
198
  // Global error handler
113
- process.on('unhandledRejection', (err) => {
114
- TUI.printError('เกิดข้อผิดพลาด: ' + err.message);
199
+ process.on("unhandledRejection", (err) => {
200
+ TUI.printError("เกิดข้อผิดพลาด: " + err.message);
115
201
  if (process.env.DEBUG) {
116
202
  console.error(err.stack);
117
203
  }
package/package.json CHANGED
@@ -1,12 +1,18 @@
1
1
  {
2
2
  "name": "clawflowbang",
3
- "version": "1.0.2",
4
- "description": "Skill + Cron Installer for OpenClaw - Install skills and configure them for immediate use",
3
+ "version": "1.1.0",
4
+ "description": "The ultimate CLI tool for Krab Ecosystem: Install skills, agents and automate cronjobs in one flow.",
5
5
  "main": "src/index.js",
6
- "bin": {
7
- "clawflow": "bin/clawflowhub.js",
8
- "cfh": "bin/clawflowhub.js"
9
- },
6
+ "bin": {
7
+ "clawflow": "bin/clawflowhub.js",
8
+ "cfh": "bin/clawflowhub.js"
9
+ },
10
+ "files": [
11
+ "src",
12
+ "bin",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
10
16
  "scripts": {
11
17
  "start": "node bin/clawflowhub.js",
12
18
  "test": "jest",
@@ -15,14 +21,20 @@
15
21
  "keywords": [
16
22
  "openclaw",
17
23
  "skill",
24
+ "agent",
18
25
  "cron",
19
26
  "installer",
20
27
  "automation",
21
28
  "clawhub",
22
- "clawflow"
29
+ "clawflow",
30
+ "krab"
23
31
  ],
24
32
  "author": "ClawFlow Team",
25
33
  "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/OpenKrab/ClawFlow"
37
+ },
26
38
  "dependencies": {
27
39
  "axios": "^1.5.0",
28
40
  "boxen": "^8.0.1",
@@ -44,4 +56,4 @@
44
56
  "engines": {
45
57
  "node": ">=16.0.0"
46
58
  }
47
- }
59
+ }