clawflowbang 1.0.1 → 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` (aliases: `clawflowhub`, `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,54 +58,76 @@ 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
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
80
97
  clawflow cron-edit <job-id> --schedule "@daily"
98
+ clawflow cron-edit <job-id> --params '{"symbols":["BTC","ETH"]}'
99
+ clawflow cron-remove <job-id>
81
100
  ```
82
101
 
83
- ## Skill Install Fallback (ClawHub -> Git)
102
+ ---
84
103
 
85
- When installing package skills:
104
+ ## Installation Flow
86
105
 
87
- 1. Try `clawhub install`
88
- 2. If failed, try `git clone` when skill metadata provides repository info
89
- 3. Validate cloned skill by checking `SKILL.md`
106
+ ### Skill Installation Strategy
90
107
 
91
- 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
92
111
 
93
- - `repository` or `repo` or `git`
94
- - optional `branch` / `tag` / `ref`
112
+ ### Git Fallback Metadata
95
113
 
96
- ## Paths Used by Default
114
+ Required fields in package metadata:
97
115
 
98
- - 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`
99
126
  - Cron jobs file: `~/.openclaw/cron/jobs.json`
100
127
 
101
- Override during install:
128
+ ### Custom Paths
129
+
130
+ Override defaults during installation:
102
131
 
103
132
  ```bash
104
133
  clawflow install <package> \
@@ -106,10 +135,11 @@ clawflow install <package> \
106
135
  --cron-jobs "<path-to-jobs.json>"
107
136
  ```
108
137
 
109
- ## NPM Package Preset Format
138
+ ---
139
+
140
+ ## NPM Package Format
110
141
 
111
- `clawflow` can read package metadata from npm packages.
112
- Use `clawflow` field in package.json:
142
+ `clawflow` reads package metadata from npm packages using the `clawflow` field:
113
143
 
114
144
  ```json
115
145
  {
@@ -136,14 +166,99 @@ Use `clawflow` field in package.json:
136
166
  }
137
167
  ```
138
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
+
139
206
  ## Development
140
207
 
208
+ ### Setup
209
+
141
210
  ```bash
211
+ git clone https://github.com/OpenKrab/ClawFlowHub.git
212
+ cd ClawFlowHub
142
213
  npm install
143
- npm run lint
144
- npm test -- --runInBand
145
214
  ```
146
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
+
147
258
  ## License
148
259
 
149
260
  MIT
261
+
262
+ ---
263
+
264
+ *Built for the Lobster Way 🦞*
@@ -1,115 +1,203 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { program } = require('commander');
4
- const pkg = require('../package.json');
3
+ require("dotenv").config();
4
+
5
+ const { program } = require("commander");
6
+ const pkg = require("../package.json");
7
+ const chalk = require("chalk");
5
8
 
6
9
  // Import TUI
7
- const TUI = require('../src/core/TerminalUI');
10
+ const TUI = require("../src/core/TerminalUI");
8
11
 
9
12
  // Import commands
10
- const installCommand = require('../src/commands/install');
11
- const listCommand = require('../src/commands/list');
12
- const removeCommand = require('../src/commands/remove');
13
- const cronCommand = require('../src/commands/cron');
14
- const statusCommand = require('../src/commands/status');
15
- const initCommand = require('../src/commands/init');
16
- 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
17
26
 
18
27
  // Print new TUI banner
19
28
  TUI.printBanner(pkg.version);
20
29
 
21
30
  program
22
- .name('clawflow')
23
- .description('Install OpenClaw skills and set up cronjobs')
24
- .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);
25
40
 
26
41
  // Install command
42
+
27
43
  program
28
- .command('install <package>')
29
- .alias('i')
30
- .description('Install a package including skills and cronjobs')
31
- .option('-g, --global', 'Install globally')
32
- .option('-c, --config <path>', 'Specify config file path')
33
- .option('--skills-path <path>', 'Specify OpenClaw workspace skills path')
34
- .option('--cron-jobs <path>', 'Specify OpenClaw cron jobs.json path')
35
- .option('--openclaw-bin <path>', 'Path to openclaw CLI binary')
36
- .option('--clawhub-bin <path>', 'Path to clawhub CLI binary')
37
- .option('--no-cron', 'Install skills without creating cronjobs')
38
- .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
39
57
  .action(installCommand);
40
58
 
41
59
  // List command
42
60
  program
43
- .command('list')
44
- .alias('ls')
45
- .description('Show installed packages and skills')
46
- .option('-a, --available', 'Show packages available for install')
47
- .option('-i, --installed', 'Show installed packages (default)')
48
- .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)")
49
67
  .action(listCommand);
50
68
 
51
69
  // Search command
52
70
  program
53
- .command('search <query>')
54
- .alias('find')
55
- .description('Search packages in the registry')
56
- .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")
57
75
  .action(searchCommand);
58
76
 
59
77
  // Remove command
60
78
  program
61
- .command('remove <package>')
62
- .alias('rm')
63
- .description('Uninstall a package')
64
- .option('-g, --global', 'Uninstall globally')
65
- .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")
66
84
  .action(removeCommand);
67
85
 
68
86
  // Cron command group
69
87
  program
70
- .command('cron-list')
71
- .description('List all cronjobs')
88
+ .command("cron-list")
89
+ .description("List all cronjobs")
72
90
  .action(cronCommand.list);
73
91
 
74
92
  program
75
- .command('cron-add <skill>')
76
- .description('Add a cronjob for a skill')
77
- .option('-s, --schedule <expression>', 'cron schedule expression', '*/5 * * * *')
78
- .option('-e, --every <duration>', 'Shorthand like 5m, 1h, 2d')
79
- .option('-d, --description <text>', 'Cronjob description')
80
- .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")
81
104
  .action(cronCommand.add);
82
105
 
83
106
  program
84
- .command('cron-edit <id>')
85
- .description('Edit a cronjob')
86
- .option('-s, --schedule <expression>', 'New cron schedule expression')
87
- .option('-e, --every <duration>', 'Shorthand like 5m, 1h, 2d')
88
- .option('-d, --description <text>', 'New description')
89
- .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")
90
113
  .action(cronCommand.edit);
91
114
 
92
115
  program
93
- .command('cron-remove <id>')
94
- .description('Remove a cronjob')
116
+ .command("cron-remove <id>")
117
+ .description("Remove a cronjob")
95
118
  .action(cronCommand.remove);
96
119
 
97
120
  // Status command
98
121
  program
99
- .command('status')
100
- .description('Show system status')
122
+ .command("status")
123
+ .description("Show system status")
101
124
  .action(statusCommand);
102
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
+
103
191
  // Init command
104
192
  program
105
- .command('init')
106
- .description('Initialize ClawFlow in the current directory')
107
- .option('-f, --force', 'Overwrite existing config')
193
+ .command("init")
194
+ .description("Initialize ClawFlow in the current directory")
195
+ .option("-f, --force", "Overwrite existing config")
108
196
  .action(initCommand);
109
197
 
110
198
  // Global error handler
111
- process.on('unhandledRejection', (err) => {
112
- TUI.printError('เกิดข้อผิดพลาด: ' + err.message);
199
+ process.on("unhandledRejection", (err) => {
200
+ TUI.printError("เกิดข้อผิดพลาด: " + err.message);
113
201
  if (process.env.DEBUG) {
114
202
  console.error(err.stack);
115
203
  }
package/package.json CHANGED
@@ -1,13 +1,18 @@
1
1
  {
2
2
  "name": "clawflowbang",
3
- "version": "1.0.1",
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
6
  "bin": {
7
7
  "clawflow": "bin/clawflowhub.js",
8
- "clawflowhub": "bin/clawflowhub.js",
9
8
  "cfh": "bin/clawflowhub.js"
10
9
  },
10
+ "files": [
11
+ "src",
12
+ "bin",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
11
16
  "scripts": {
12
17
  "start": "node bin/clawflowhub.js",
13
18
  "test": "jest",
@@ -16,19 +21,26 @@
16
21
  "keywords": [
17
22
  "openclaw",
18
23
  "skill",
24
+ "agent",
19
25
  "cron",
20
26
  "installer",
21
27
  "automation",
22
28
  "clawhub",
23
- "clawflow"
29
+ "clawflow",
30
+ "krab"
24
31
  ],
25
32
  "author": "ClawFlow Team",
26
33
  "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/OpenKrab/ClawFlow"
37
+ },
27
38
  "dependencies": {
28
39
  "axios": "^1.5.0",
29
40
  "boxen": "^8.0.1",
30
41
  "chalk": "^4.1.2",
31
42
  "commander": "^11.0.0",
43
+ "dotenv": "^16.6.1",
32
44
  "fs-extra": "^11.1.1",
33
45
  "gradient-string": "^3.0.0",
34
46
  "inquirer": "^8.2.6",
@@ -44,4 +56,4 @@
44
56
  "engines": {
45
57
  "node": ">=16.0.0"
46
58
  }
47
- }
59
+ }