@fnet/cli 1.12.1 → 1.14.1

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.
Files changed (109) hide show
  1. package/dist/fbin/index.js +1 -1
  2. package/dist/fnet/index.4gymwzqb.js +1 -0
  3. package/dist/fnet/index.5r21wfyc.js +1 -0
  4. package/dist/fnet/index.js +9 -9
  5. package/dist/fnet/index.kanz1359.js +2 -0
  6. package/dist/fnet/index.kjw4nv5z.js +1 -0
  7. package/dist/fnet/index.n7q2w82x.js +1 -0
  8. package/dist/{fnode/index.c8qd1bz3.js → fnet/index.pj3wr582.js} +1 -1
  9. package/dist/fnet/index.r3cben5x.js +1 -0
  10. package/dist/fnet/index.sbphkm7x.js +1 -0
  11. package/dist/{fnode/index.e6g5y0zg.js → fnet/index.wmeh7jrw.js} +1 -1
  12. package/dist/fnet/index.xym49mp3.js +1 -0
  13. package/dist/fnet/index.ydv6st7k.js +1 -0
  14. package/dist/fnode/index.05n3mvs9.js +2 -0
  15. package/dist/fnode/index.22v7wtt0.js +2 -0
  16. package/dist/fnode/{index.dtp0a202.js → index.3ay4fp2s.js} +1 -1
  17. package/dist/fnode/index.6g3j97vm.js +1 -0
  18. package/dist/fnode/{index.q61zqpb9.js → index.782edcjp.js} +1 -1
  19. package/dist/fnode/index.7cqahb2f.js +1 -0
  20. package/dist/fnode/index.fy1xwqp2.js +1 -0
  21. package/dist/fnode/index.js +2 -2
  22. package/dist/fnode/index.kswhzt5n.js +1 -0
  23. package/dist/fnode/{index.1k1sj9qs.js → index.q9ghzdn2.js} +3 -3
  24. package/dist/fnode/index.r4xke6yy.js +1 -0
  25. package/dist/fnode/index.w4cz5r8m.js +1 -0
  26. package/dist/fnode/index.wd23pxn8.js +1 -0
  27. package/dist/fnode/index.xvyybysy.js +1 -0
  28. package/dist/fnode/index.z9232w6h.js +1 -0
  29. package/dist/frun/index.js +1 -1
  30. package/dist/fservice/index.js +1 -1
  31. package/package.json +6 -10
  32. package/readme.md +240 -191
  33. package/scripts/postinstall.js +19 -4
  34. package/template/deploy/to-docker/aws/Dockerfile.njk +114 -0
  35. package/template/deploy/to-docker/aws/build.sh.njk +127 -0
  36. package/template/deploy/to-docker/docker/Dockerfile.njk +67 -0
  37. package/template/deploy/to-docker/docker/build.sh.njk +48 -0
  38. package/template/deploy/to-docker/gcloud/Dockerfile.njk +69 -0
  39. package/template/deploy/to-docker/gcloud/build.sh.njk +39 -0
  40. package/template/deploy/to-docker/podman/Dockerfile.njk +69 -0
  41. package/template/deploy/to-docker/podman/build.sh.njk +44 -0
  42. package/template/deploy/to-electron/mac/entitlements.plist.njk +18 -0
  43. package/template/deploy/to-electron/main.js.njk +37 -0
  44. package/template/deploy/to-electron/package.json.njk +36 -0
  45. package/template/deploy/to-electron/src/index.html.njk +23 -0
  46. package/template/deploy/to-ios-app/fnet/index.html.njk +23 -0
  47. package/template/deploy/to-ios-app/fnet-ios-app/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
  48. package/template/deploy/to-ios-app/fnet-ios-app/Assets.xcassets/AppIcon.appiconset/Contents.json +112 -0
  49. package/template/deploy/to-ios-app/fnet-ios-app/Assets.xcassets/Contents.json +6 -0
  50. package/template/deploy/to-ios-app/fnet-ios-app/Assets.xcassets/launch-images.imageset/Contents.json +23 -0
  51. package/template/deploy/to-ios-app/fnet-ios-app/ContentView.swift +32 -0
  52. package/template/deploy/to-ios-app/fnet-ios-app/Info.plist +10 -0
  53. package/template/deploy/to-ios-app/fnet-ios-app/LaunchScreen.storyboard +26 -0
  54. package/template/deploy/to-ios-app/fnet-ios-app/Preview Content/Preview Assets.xcassets/Contents.json +6 -0
  55. package/template/deploy/to-ios-app/fnet-ios-app/WebView.swift +42 -0
  56. package/template/deploy/to-ios-app/fnet-ios-app/fnet_ios_appApp.swift +17 -0
  57. package/template/deploy/to-ios-app/fnet-ios-app.xcodeproj/project.pbxproj.njk +417 -0
  58. package/template/deploy/to-ios-app/fnet-ios-app.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  59. package/template/deploy/to-ios-app/fnet-ios-app.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  60. package/template/deploy/to-ios-app/fnet-ios-app.xcodeproj/xcshareddata/xcschemes/fnet-ios-app.xcscheme +77 -0
  61. package/template/deploy/to-macos-app/fnet/index.html.njk +23 -0
  62. package/template/deploy/to-macos-app/fnet-macos-app/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
  63. package/template/deploy/to-macos-app/fnet-macos-app/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
  64. package/template/deploy/to-macos-app/fnet-macos-app/Assets.xcassets/Contents.json +6 -0
  65. package/template/deploy/to-macos-app/fnet-macos-app/ContentView.swift +13 -0
  66. package/template/deploy/to-macos-app/fnet-macos-app/Preview Content/Preview Assets.xcassets/Contents.json +6 -0
  67. package/template/deploy/to-macos-app/fnet-macos-app/WebView.swift +30 -0
  68. package/template/deploy/to-macos-app/fnet-macos-app/fnet_macos_app.entitlements +16 -0
  69. package/template/deploy/to-macos-app/fnet-macos-app/fnet_macos_appApp.swift +17 -0
  70. package/template/deploy/to-macos-app/fnet-macos-app.xcodeproj/project.pbxproj.njk +396 -0
  71. package/template/deploy/to-macos-app/fnet-macos-app.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  72. package/template/deploy/to-macos-app/fnet-macos-app.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  73. package/template/deploy/to-nextjs/app/layout.tsx.njk +13 -0
  74. package/template/deploy/to-nextjs/app/page.tsx.njk +28 -0
  75. package/template/deploy/to-nextjs/next-env.d.ts +5 -0
  76. package/template/deploy/to-nextjs/package.json.njk +20 -0
  77. package/template/deploy/to-nextjs/tsconfig.json +34 -0
  78. package/template/deploy/to-pyip/package/__init__.py.njk +4 -0
  79. package/template/deploy/to-pyip/package/cli/__init__.py.njk +3 -0
  80. package/template/deploy/to-pyip/package/cli/index.py.njk +24 -0
  81. package/template/deploy/to-pyip/package/lib/__init__.py.njk +3 -0
  82. package/template/deploy/to-pyip/pyproject.toml +3 -0
  83. package/template/deploy/to-pyip/setup.py.njk +32 -0
  84. package/template/deploy/to-rust/Cargo.toml.njk +16 -0
  85. package/template/deploy/to-rust/src/main.rs.njk +112 -0
  86. package/template/deploy/to-webos/appinfo.json.njk +14 -0
  87. package/template/deploy/to-webos/index.html.njk +39 -0
  88. package/template/deploy/to-webos/webOSTVjs-1.2.10/LICENSE-2.0.txt +202 -0
  89. package/template/deploy/to-webos/webOSTVjs-1.2.10/webOSTV-dev.js +1 -0
  90. package/template/deploy/to-webos/webOSTVjs-1.2.10/webOSTV.js +1 -0
  91. package/dist/fnet/index.06vbpwcx.js +0 -1
  92. package/dist/fnet/index.26r88tdp.js +0 -1
  93. package/dist/fnet/index.2g93a9kt.js +0 -1
  94. package/dist/fnet/index.61jdafta.js +0 -1
  95. package/dist/fnet/index.80hh5mtp.js +0 -1
  96. package/dist/fnet/index.a2mbqyxe.js +0 -1
  97. package/dist/fnet/index.gywx3fae.js +0 -1
  98. package/dist/fnet/index.gza1frda.js +0 -1
  99. package/dist/fnet/index.r2gf0b3s.js +0 -1
  100. package/dist/fnet/index.rfysmk2b.js +0 -2
  101. package/dist/fnode/index.5f1kfz9t.js +0 -1
  102. package/dist/fnode/index.7ev6y63q.js +0 -1
  103. package/dist/fnode/index.a4q2w1yd.js +0 -1
  104. package/dist/fnode/index.btj5x5s4.js +0 -1
  105. package/dist/fnode/index.n1598ffs.js +0 -1
  106. package/dist/fnode/index.ng6w9cac.js +0 -1
  107. package/dist/fnode/index.r8s8r2n7.js +0 -2
  108. package/dist/fnode/index.xc08sjp4.js +0 -1
  109. package/dist/fnode/index.zb59076q.js +0 -1
package/readme.md CHANGED
@@ -5,7 +5,7 @@
5
5
  </p>
6
6
 
7
7
  <p align="center">
8
- <b>Focus on functional code, let Flownet handle the rest</b>
8
+ <b>Give developers primitives. Trust them to compose. Make the tooling excellent.</b>
9
9
  </p>
10
10
 
11
11
  <p align="center">
@@ -14,285 +14,334 @@
14
14
  <a href="https://github.com/fnetai/cli/blob/main/LICENSE"><img src="https://img.shields.io/github/license/fnetai/cli.svg" alt="license"></a>
15
15
  </p>
16
16
 
17
- ## Overview
17
+ ---
18
18
 
19
- Flownet is a low-level flow framework that separates **Core** (your business logic) from **Layers** (infrastructure, dev, build, runtime, and delivery). This separation allows developers to focus on functional code while Flownet automates the surrounding infrastructure. The `@fnet/cli` package provides command-line tools to create, build, and manage Flownet projects.
19
+ ## Why Flownet?
20
20
 
21
- Flownet provides primitives for composing workflows similar to how React provides components for UI development. It emphasizes a **schema-first approach** with **deterministic core**, enabling **multi-runtime portability**.
21
+ Most developers spend the majority of their time on things that aren't their actual problem: build configuration, bundling, runtime wiring, deployment pipelines, service setup. The ratio of "infrastructure work" to "actual logic" is often 80/20 in the wrong direction.
22
22
 
23
- ### Key Features
23
+ Flownet exists to flip that ratio. It separates what you write (**Core**) from what surrounds it (**Layers**), then automates the Layers so you can focus on the Core.
24
24
 
25
- - **Core vs Layers Architecture**: Separate your business logic (Core) from infrastructure (Layers) for cleaner, more maintainable code
26
- - **Nodes & Flows**: Reusable functional units (Nodes) with explicit I/O schemas, orchestrated by Flows
27
- - **I/O Contracts**: Schema-first contracts define clear input/output expectations for deterministic behavior
28
- - **Automatic Dependency Detection**: Simplified dependency management across your project
29
- - **Multi-Runtime Support**: Deploy to Node.js, Bun, Deno, or Python - choose the best runtime for each task
30
- - **Language Agnostic**: Support for multiple programming languages (JavaScript, Python) in the same project
31
- - **Unified Interface**: Consistent commands across different project types
32
- - **Tag-Based Configuration**: Powerful conditional configuration with `--ftag` parameter
33
- - **Isolated Workspace**: All build artifacts and dependencies are kept in `.workspace` directory
34
- - **Binary System**: Compile, install, and manage CLI tools with the integrated binary system
35
- - **Project File Configuration**: Configure CLI features directly in your project files
36
- - **Fast Startup**: Pre-compiled binaries start much faster than interpreted scripts
25
+ - **Core**: Your functional, minimal, deterministic logic and its I/O contracts
26
+ - **Layers**: Dev experience, build pipelines, runtime wiring, delivery/packaging
37
27
 
38
- ## Installation
28
+ You write the Core. Flownet generates, manages, and updates the Layers automatically. Update all Layer infrastructure across every project by updating the CLI.
39
29
 
40
- ```bash
41
- # Using npm
42
- npm install -g @fnet/cli
30
+ | Project Type | Core (you write) | Layers (Flownet handles) |
31
+ | ------------ | ----------------- | ------------------------------- |
32
+ | CLI | Command logic | Binary + PATH/runtime + publish |
33
+ | App | UI/flows | Bundling + hosting/CDN + deploy |
34
+ | Component | API/behavior | ESM/CJS/types + publish |
43
35
 
44
- # Using yarn
45
- yarn global add @fnet/cli
36
+ This is the same philosophy that made React successful for UI: provide primitives, trust developers to compose, make the tooling excellent. Flownet applies it to the entire development lifecycle.
46
37
 
47
- # Using bun
48
- bun install -g @fnet/cli
38
+ ## What You Get
39
+
40
+ ```text
41
+ @fnet/cli (npm package)
42
+ |
43
+ |- fnode ---------> Node/Classic Projects (fnode.yaml)
44
+ | Create, build, deploy reusable Nodes
45
+ |
46
+ |- fnet ----------> Workflow Projects (fnet.yaml)
47
+ | Create, build, deploy Flows
48
+ |
49
+ |- frun ----------> Unified Command Runner
50
+ | Auto-detect project type, run command groups
51
+ | Powered by @fnet/shell-flow
52
+ |
53
+ |- fbin ----------> Binary Management
54
+ | Compile JS to native binaries
55
+ | Install to ~/.fnet/bin/
56
+ |
57
+ '- fservice ------> Service Management
58
+ Cross-platform system services
59
+ (systemd, launchd, Windows Services)
49
60
  ```
50
61
 
51
- ## Quick Start
62
+ Five CLI tools that work together to cover the full development lifecycle: create, develop, build, distribute, and run as a service.
63
+
64
+ ## Installation
52
65
 
53
- ### Create a New Project
66
+ ### Homebrew (recommended, macOS/Linux)
54
67
 
55
68
  ```bash
56
- # Create a Node.js project
57
- fnode create my-node-project
69
+ brew tap fnetai/tap
70
+ brew install fnet
71
+ ```
58
72
 
59
- # Create a Python project
60
- fnode create my-python-project --runtime python
73
+ Installs all 5 CLI tools (`frun`, `fbin`, `fservice`, `fnode`, `fnet`) as native binaries plus templates. No Node.js or npm required.
61
74
 
62
- # Create a Bun project
63
- fnode create my-bun-project --runtime bun
75
+ ### npm
64
76
 
65
- # Create a workflow project
66
- fnet create my-workflow-project
77
+ ```bash
78
+ npm install -g @fnet/cli
67
79
  ```
68
80
 
69
- ### Build and Run
81
+ On first install, pre-compiled native binaries (`frun`, `fbin`, `fservice`) are downloaded for your platform. If the download fails, the JavaScript versions work as a fallback.
70
82
 
71
- ```bash
72
- # Build the project
73
- frun build
74
-
75
- # Run the project
76
- fnode cli
83
+ ## Core Concepts
77
84
 
78
- # Execute a command group from project file
79
- frun <command-group> [--ftag <tags>]
80
- ```
85
+ ### Nodes & Flows
81
86
 
82
- ### Compile and Install
87
+ **Nodes** are reusable functional units with explicit input/output schemas. Each Node has a deterministic, pure function at its core with clear I/O contracts. Think of them as the building blocks.
83
88
 
84
- ```bash
85
- # Compile a JavaScript file to a binary
86
- fbin compile script.js -o my-tool
89
+ **Flows** orchestrate Nodes and sub-Flows into workflows. They define how capabilities connect, transform, and execute - composition and control flow over the primitives that Nodes provide.
87
90
 
88
- # Install a compiled binary
89
- fbin install ./my-tool --name awesome-tool
91
+ | | fnode Project | fnet Project |
92
+ | ----------- | ------------------------------- | --------------------- |
93
+ | Config file | `fnode.yaml` | `fnet.yaml` |
94
+ | Purpose | Reusable Nodes, standalone apps | Workflow orchestration |
95
+ | CLI | `fnode` | `fnet` |
96
+ | Runtimes | Node.js, Bun, Python | Node.js, Bun |
90
97
 
91
- # Install a CLI-enabled project
92
- cd my-project
93
- fnode install --yes
98
+ ### Schema-First & Multi-Runtime
94
99
 
95
- # Or use npm scripts in your project
96
- npm run compile
97
- npm run install-bin
100
+ Flownet uses schema-first contracts (I/O schemas) to define clear expectations. This enables:
98
101
 
99
- # List installed binaries
100
- fbin list
102
+ - **Multi-runtime portability**: Same Core logic deploys to Node.js, Bun, or Python
103
+ - **Deterministic behavior**: Clear contracts across different runtimes
104
+ - **Automatic validation**: Schemas drive type checking and validation
101
105
 
102
- # Uninstall a binary
103
- fbin uninstall awesome-tool --yes
106
+ ```text
107
+ my-project/
108
+ |- src/
109
+ | |- index.js # JavaScript (Node.js / Bun)
110
+ | '- index.py # Python
111
+ |- fnode.yaml
112
+ '- .workspace/ # Layers (managed by CLI, not your concern)
104
113
  ```
105
114
 
106
- ## Core Concepts
115
+ ### Documentation That Never Lies
107
116
 
108
- ### Nodes & Flows
117
+ Flownet automatically generates BPMN 2.0 (Business Process Model and Notation) diagrams from your Flow definitions on every build. Your YAML is the single source of truth - diagrams are derived, never hand-maintained.
109
118
 
110
- **Nodes** are reusable functional units that encapsulate business logic with explicit input/output schemas. Each Node:
119
+ - **Developers** read YAML (code-like, version controlled)
120
+ - **Stakeholders** view BPMN (visual, business-friendly)
121
+ - **Tools** analyze BPMN (process mining, compliance)
111
122
 
112
- - Has a deterministic, pure function at its core
113
- - Defines clear I/O contracts (input and output schemas)
114
- - Can be composed and reused across different Flows
115
- - Supports automatic dependency detection
123
+ This solves the eternal problem of documentation going stale. With Flownet, it can't - diagrams regenerate on every `fnet build`.
116
124
 
117
- **Flows** orchestrate Nodes and sub-Flows to create complex workflows. Flows:
125
+ ### AI-Native: MCP Integration
118
126
 
119
- - Connect multiple Nodes with explicit data contracts
120
- - Enable multi-runtime portability through schema-first design
121
- - Support complex data transformations and conditional logic
122
- - Maintain deterministic behavior across different runtimes
127
+ Every Flownet project can be exposed as an AI-compatible tool server via the [Model Context Protocol (MCP)](https://modelcontextprotocol.io). Both `fnode` and `fnet` projects support MCP mode with STDIO and HTTP transports:
123
128
 
124
- ### I/O Contracts
129
+ ```bash
130
+ # Expose as MCP tool for Claude Desktop or any AI assistant
131
+ fnode cli --cli-mode mcp
125
132
 
126
- Flownet uses schema-first contracts to define clear input and output expectations. This approach:
133
+ # Or over HTTP for remote AI integrations
134
+ fnet cli --cli-mode mcp --mcp-transport http --cli-port 3003
135
+ ```
127
136
 
128
- - Ensures deterministic behavior across different runtimes
129
- - Enables automatic validation and type checking
130
- - Facilitates multi-runtime portability
131
- - Improves code clarity and maintainability
137
+ This means any Flownet project - a data processor, a CLI tool, a workflow - can become a tool that AI assistants discover, understand, and invoke. It's not a bolt-on feature; it's a first-class runtime mode alongside CLI, HTTP, WebSocket, and Pipeline modes.
132
138
 
133
- ## Project Types
139
+ ## Quick Start
134
140
 
135
- Flownet supports two main project types:
141
+ ### Create a Project
136
142
 
137
- ### fnode Project
143
+ ```bash
144
+ # Node.js project (default runtime)
145
+ fnode create --name my-project
138
146
 
139
- An **fnode project** (Flow Node Project) is a classic/node-style project that focuses on creating reusable Nodes or standalone applications. These projects:
147
+ # Python project
148
+ fnode create --name my-project --runtime python
140
149
 
141
- - Use `fnode.yaml` as their configuration file
142
- - Typically contain a single code file in the `src` directory
143
- - Can be built with different runtimes (Node.js, Python, Bun)
144
- - Support multiple programming languages simultaneously
145
- - Ideal for creating reusable components with explicit I/O contracts
150
+ # Bun project
151
+ fnode create --name my-project --runtime bun
146
152
 
147
- ### fnet Project
153
+ # Workflow project
154
+ fnet create --name my-workflow
155
+ ```
148
156
 
149
- An **fnet project** (Flow Project) is a workflow-oriented project that focuses on orchestrating multiple Nodes and Flows. These projects:
157
+ ### Quick Test Projects
150
158
 
151
- - Use `fnet.yaml` as their configuration file
152
- - Define workflows that connect multiple Nodes and sub-Flows
153
- - Support complex data flows and transformations
154
- - Enable multi-runtime deployment strategies
155
- - Ideal for building complex business logic orchestrations
159
+ Rapid prototyping without thinking about names:
156
160
 
157
- ## CLI Tools
161
+ ```bash
162
+ fnode express --yes # Creates fnode-1, fnode-2, fnode-3...
163
+ fnet express --yes # Creates fnet-1, fnet-2, fnet-3...
164
+ ```
158
165
 
159
- Flownet provides five main CLI tools:
166
+ ### Build and Run
160
167
 
161
- - **`fnode`**: For Node/classic projects (uses `fnode.yaml`) - create and manage reusable Nodes
162
- - **`fnet`**: For Workflow projects (uses `fnet.yaml`) - create and manage Flows that orchestrate Nodes
163
- - **`frun`**: Unified interface that works with both project types (auto-detects project file)
164
- - **`fbin`**: Binary management system for installing, compiling, and managing CLI tools
165
- - **`fservice`**: Service management for deploying and running Flownet applications
168
+ ```bash
169
+ frun build # Run 'build' command group
170
+ fnode cli # Run as CLI
171
+ frun <command-group> [--ftag <tags>] # Execute command group with tags
172
+ frun list # List available command groups
173
+ ```
166
174
 
167
- ## Multi-Language & Multi-Runtime Support
175
+ ## CLI Tools
168
176
 
169
- Flownet supports multiple programming languages and runtimes simultaneously within the same project:
177
+ ### fnode - Node/Classic Projects
170
178
 
171
- ```text
172
- my-project/
173
- ├── src/
174
- │ ├── index.js # JavaScript implementation (used by Node.js and Bun)
175
- │ └── index.py # Python implementation
176
- ├── fnode.yaml # Project configuration file
177
- └── .workspace/ # Build infrastructure (managed by CLI)
179
+ ```bash
180
+ fnode create --name my-project # Create a new project
181
+ fnode build # Build the project
182
+ fnode cli # Run as CLI
183
+ fnode cli --cli-mode http # Run as HTTP server
184
+ fnode compile # Compile to binary
185
+ fnode install # Install compiled binary
178
186
  ```
179
187
 
180
- ### Supported Runtimes
188
+ **Passthrough commands** execute tools in the project's `.workspace` context:
181
189
 
182
- - **Node.js**: JavaScript/TypeScript execution with full npm ecosystem support
183
- - **Bun**: Fast JavaScript runtime with improved performance
184
- - **Deno**: Secure JavaScript/TypeScript runtime with built-in tooling
185
- - **Python**: Python 3.x for data processing and scientific computing
190
+ ```bash
191
+ fnode npm install lodash # npm in workspace
192
+ fnode node script.js # node in workspace
193
+ fnode bun run dev # bun in workspace
194
+ fnode python script.py # python in workspace
195
+ fnode cdk deploy # AWS CDK in workspace
196
+ fnode aws s3 ls # AWS CLI in workspace
197
+ ```
186
198
 
187
- ### Multi-Runtime Portability
199
+ **Runtime modes** - one project, multiple deployment targets:
188
200
 
189
- Thanks to Flownet's schema-first approach and deterministic core:
201
+ | Mode | Command | Use case |
202
+ | --------- | -------------------------------- | --------------------------------- |
203
+ | CLI | `fnode cli` | Terminal executable |
204
+ | HTTP | `fnode cli --cli-mode http` | REST API server |
205
+ | WebSocket | `fnode cli --cli-mode websocket` | Real-time bidirectional |
206
+ | Pipeline | `echo data \| fnode cli` | Unix-style stdin/stdout streaming |
207
+ | MCP | `fnode cli --cli-mode mcp` | AI-compatible tool server |
190
208
 
191
- - Write your core logic once and deploy to multiple runtimes
192
- - Choose the best runtime for each specific use case
193
- - Migrate between runtimes without changing your business logic
194
- - Use JavaScript with Node.js for quick development, Python for data processing, and Bun for improved performance
209
+ ### fnet - Workflow Projects
195
210
 
196
- ## Tag-Based Configuration
211
+ ```bash
212
+ fnet create --name my-workflow # Create a workflow project
213
+ fnet build # Build (+ auto-generate BPMN)
214
+ fnet npm install # npm in workspace
215
+ fnet cdk deploy # AWS CDK in workspace
216
+ ```
197
217
 
198
- Both CLI tools support the `--ftag` parameter for powerful conditional configuration:
218
+ ### frun - Unified Command Runner
219
+
220
+ Auto-detects project type and runs command groups. Powered by [`@fnet/shell-flow`](https://www.npmjs.com/package/@fnet/shell-flow).
199
221
 
200
222
  ```bash
201
- frun build --ftag dev --ftag local
223
+ frun build # Run 'build' command group
224
+ frun deploy # Run 'deploy' command group
225
+ frun dev --ftag local # Run with tags
226
+ frun list # List available command groups
202
227
  ```
203
228
 
204
- This activates sections in your project file marked with `t::dev::` or `t::local::` tags:
229
+ Define command groups in your project YAML:
205
230
 
206
231
  ```yaml
207
- # Base configuration
208
- name: my-project
232
+ commands:
233
+ build:
234
+ usage: frun build
235
+ description: Build the project
236
+ steps:
237
+ - npm install
238
+ - npm run build
239
+
240
+ test:
241
+ usage: frun test
242
+ description: Run all tests
243
+ parallel:
244
+ - npm run test:unit
245
+ - npm run test:integration
246
+
247
+ dev:
248
+ usage: frun dev
249
+ description: Start dev servers
250
+ fork:
251
+ - npm run watch:css
252
+ - npm run watch:js
253
+ - npm run dev-server
254
+ ```
209
255
 
210
- # Development environment configuration
211
- t::dev::database:
212
- url: "mongodb://localhost:27017"
256
+ The `commands:` section is `@fnet/shell-flow` input schema in YAML format. This gives you sequential execution, parallel execution, background processes, environment variables, template variables (`{{var}}`), output capture, retry with exponential backoff, timeouts, and a full set of expression builtins (`json::`, `http::`, `file::`, `txt::`, `encode::`, `hash::`, `time::`, `capture::`, `pause::`, and more).
213
257
 
214
- # Production environment configuration
215
- t::prod::database:
216
- url: "mongodb://production-server:27017"
217
- ```
258
+ ### fbin - Binary Management
218
259
 
219
- ## Binary System
260
+ Compile JavaScript to native binaries and manage installations:
220
261
 
221
- Flownet includes a powerful binary system that makes it easy to create, distribute, and manage CLI tools:
262
+ ```bash
263
+ fbin setup # Initialize the bin system
264
+ fbin path # Add ~/.fnet/bin to PATH
265
+ fbin compile script.js -o my-tool # Compile JS to binary
266
+ fbin install ./my-tool --name app # Install a binary
267
+ fbin list # List installed binaries
268
+ fbin uninstall app --yes # Remove a binary
269
+ fbin backup # Backup binaries and shell config
270
+ fbin restore # Restore from backup
271
+ ```
222
272
 
223
- ### Binary System Features
273
+ Pre-compiled binaries for all platforms are built via GitHub Actions and distributed through GitHub Releases.
224
274
 
225
- - **Fast Startup**: Pre-compiled binaries start much faster than interpreted scripts
226
- - **Cross-Platform Support**: Works on macOS, Linux, and Windows
227
- - **Multiple Shell Support**: Compatible with Bash, Zsh, Fish, PowerShell, and more
228
- - **Version Management**: Keeps track of binary versions and metadata
229
- - **Project Integration**: Easily compile and install CLI-enabled projects
230
- - **Automation Support**: All commands support the `--yes` flag for scripting
275
+ ### fservice - Service Management
231
276
 
232
- ### Setup and Usage
277
+ Deploy projects as system services across platforms:
233
278
 
234
279
  ```bash
235
- # Initialize the bin system
236
- fbin setup
237
-
238
- # Add bin directory to PATH
239
- fbin path
280
+ fservice manifest create # Create a service definition
281
+ fservice register -d my-api # Register with OS service manager
282
+ fservice start my-api # Start service
283
+ fservice stop my-api # Stop service
284
+ fservice restart my-api # Restart service
285
+ fservice status my-api # Check status
286
+ fservice list # List all services
287
+ fservice unregister my-api # Remove service
288
+ ```
240
289
 
241
- # Compile a JavaScript file to a binary
242
- fbin compile script.js -o my-tool
290
+ **Supported platforms**: macOS (launchd), Linux (systemd), Windows (Windows Services)
243
291
 
244
- # Install a binary to the bin directory
245
- fbin install ./my-tool --name awesome-tool
292
+ ## Tag-Based Configuration
246
293
 
247
- # List installed binaries
248
- fbin list
294
+ The `--ftag` parameter enables conditional configuration from a single project file:
249
295
 
250
- # Uninstall a binary
251
- fbin uninstall awesome-tool
296
+ ```bash
297
+ frun build --ftag dev --ftag local
252
298
  ```
253
299
 
254
- ### Project Integration
255
-
256
- The binary system integrates seamlessly with Flownet projects:
300
+ ```yaml
301
+ name: my-project
257
302
 
258
- ```bash
259
- # Compile and install a CLI-enabled fnode project
260
- fnode compile
261
- fnode install
303
+ database:
304
+ port: 5432
262
305
 
263
- # Compile and install a CLI-enabled fnet project
264
- fnet compile
265
- fnet install
306
+ t::dev::database:
307
+ url: "mongodb://localhost:27017"
266
308
 
267
- # Using npm scripts in your project
268
- npm run compile
269
- npm run install-bin
309
+ t::prod::database:
310
+ url: "mongodb://production-server:27017"
270
311
  ```
271
312
 
272
- This makes it easy to distribute your Flownet projects as standalone CLI tools.
313
+ One file, multiple environments. Tags enable environment-specific commands, feature flags, and platform-specific configurations.
273
314
 
274
- ### CLI Configuration in Project Files
315
+ ## Project Structure
275
316
 
276
- You can configure CLI features directly in your project files:
317
+ ```text
318
+ my-project/
319
+ |- src/ # Core - your code
320
+ |- fnode.yaml # or fnet.yaml - project configuration
321
+ |- .workspace/ # Layers - managed by CLI
322
+ '- .fnet/ # Local configuration
323
+ ```
277
324
 
278
- ```yaml
279
- # In fnode.yaml or fnet.yaml
280
- name: my-project
325
+ **Global directories**:
281
326
 
282
- features:
283
- # For fnode projects
284
- s::runtime.type: node # or python, bun
327
+ - `~/.fnet/bin/` - Installed binaries
328
+ - `~/.fnet/services/` - Service definitions
285
329
 
286
- # CLI configuration
287
- cli:
288
- enabled: true
289
- bin: custom-bin-name # Name of the binary (defaults to project name)
290
- installable: true # Enable 'fnode install' or 'fnet install' command
291
- ```
330
+ ## Comparison
331
+
332
+ | Aspect | Traditional Workflow Engines | Flownet |
333
+ | -------------- | ---------------------------- | --------------------------------- |
334
+ | Syntax | Proprietary DSL | YAML + JavaScript |
335
+ | Development | Special IDE required | Any IDE (VS Code, etc.) |
336
+ | Debugging | Limited or proprietary | Standard (Chrome DevTools) |
337
+ | Testing | Proprietary tools | Standard test frameworks |
338
+ | Visualization | Manual diagram creation | Auto-generated BPMN |
339
+ | Runtime | Vendor-specific | Multi-runtime (Node/Bun/Python) |
340
+ | Learning Curve | Steep (new DSL + tools) | Gentle (YAML + JavaScript) |
341
+ | Flexibility | Opinionated, limited | Primitives, compose freely |
342
+ | Ecosystem | Vendor packages | npm ecosystem |
343
+ | AI Integration | Separate system | Built-in MCP mode |
292
344
 
293
- This configuration will:
345
+ ## License
294
346
 
295
- 1. Enable CLI functionality for your project
296
- 2. Set the binary name to `custom-bin-name`
297
- 3. Add `compile` and `install-bin` scripts to your package.json
298
- 4. Allow you to install the binary with `fnode install` or `npm run install-bin`
347
+ MIT
@@ -10,14 +10,18 @@
10
10
  * The JS-based CLI commands will still work as fallback.
11
11
  */
12
12
 
13
- import { createWriteStream, mkdirSync, chmodSync, existsSync, unlinkSync } from 'fs';
14
- import { join } from 'path';
13
+ import { createWriteStream, mkdirSync, chmodSync, existsSync, unlinkSync, cpSync } from 'fs';
14
+ import { join, dirname } from 'path';
15
15
  import { homedir, platform, arch } from 'os';
16
16
  import { execSync } from 'child_process';
17
+ import { fileURLToPath } from 'url';
17
18
 
19
+ const __dirname = dirname(fileURLToPath(import.meta.url));
18
20
  const REPO = 'fnetai/cli';
19
- const BINARIES = ['frun', 'fbin', 'fservice'];
21
+ const BINARIES = ['frun', 'fbin', 'fservice', 'fnode', 'fnet'];
20
22
  const INSTALL_DIR = join(homedir(), '.fnet', 'bin');
23
+ const TEMPLATE_SRC = join(__dirname, '..', 'template');
24
+ const TEMPLATE_DEST = join(homedir(), '.fnet', 'template');
21
25
 
22
26
  function getPlatform() {
23
27
  const p = platform();
@@ -125,8 +129,19 @@ async function main() {
125
129
  }
126
130
  }
127
131
 
132
+ // Copy templates to ~/.fnet/template/
133
+ try {
134
+ if (existsSync(TEMPLATE_SRC)) {
135
+ cpSync(TEMPLATE_SRC, TEMPLATE_DEST, { recursive: true, force: true });
136
+ console.log(` ✓ templates`);
137
+ installed++;
138
+ }
139
+ } catch {
140
+ // Fail silently
141
+ }
142
+
128
143
  if (installed > 0) {
129
- console.log(`\n ${installed} binary installed to ${INSTALL_DIR}`);
144
+ console.log(`\n ${installed} items installed to ~/.fnet/`);
130
145
 
131
146
  // Check PATH
132
147
  const pathDirs = (process.env.PATH || '').split(':');