@fnet/cli 1.13.0 → 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.
- package/dist/fbin/index.js +1 -1
- package/dist/fnet/index.4gymwzqb.js +1 -0
- package/dist/fnet/index.5r21wfyc.js +1 -0
- package/dist/fnet/index.js +9 -9
- package/dist/fnet/index.kanz1359.js +2 -0
- package/dist/fnet/index.kjw4nv5z.js +1 -0
- package/dist/fnet/index.n7q2w82x.js +1 -0
- package/dist/{fnode/index.c8qd1bz3.js → fnet/index.pj3wr582.js} +1 -1
- package/dist/fnet/index.r3cben5x.js +1 -0
- package/dist/fnet/index.sbphkm7x.js +1 -0
- package/dist/{fnode/index.e6g5y0zg.js → fnet/index.wmeh7jrw.js} +1 -1
- package/dist/fnet/index.xym49mp3.js +1 -0
- package/dist/fnet/index.ydv6st7k.js +1 -0
- package/dist/fnode/index.05n3mvs9.js +2 -0
- package/dist/fnode/index.22v7wtt0.js +2 -0
- package/dist/fnode/{index.dtp0a202.js → index.3ay4fp2s.js} +1 -1
- package/dist/fnode/index.6g3j97vm.js +1 -0
- package/dist/fnode/{index.q61zqpb9.js → index.782edcjp.js} +1 -1
- package/dist/fnode/index.7cqahb2f.js +1 -0
- package/dist/fnode/index.fy1xwqp2.js +1 -0
- package/dist/fnode/index.js +2 -2
- package/dist/fnode/index.kswhzt5n.js +1 -0
- package/dist/fnode/{index.1k1sj9qs.js → index.q9ghzdn2.js} +3 -3
- package/dist/fnode/index.r4xke6yy.js +1 -0
- package/dist/fnode/index.w4cz5r8m.js +1 -0
- package/dist/fnode/index.wd23pxn8.js +1 -0
- package/dist/fnode/index.xvyybysy.js +1 -0
- package/dist/fnode/index.z9232w6h.js +1 -0
- package/dist/frun/index.js +1 -1
- package/dist/fservice/index.js +1 -1
- package/package.json +5 -9
- package/readme.md +240 -191
- package/scripts/postinstall.js +19 -4
- package/template/deploy/to-docker/aws/Dockerfile.njk +114 -0
- package/template/deploy/to-docker/aws/build.sh.njk +127 -0
- package/template/deploy/to-docker/docker/Dockerfile.njk +67 -0
- package/template/deploy/to-docker/docker/build.sh.njk +48 -0
- package/template/deploy/to-docker/gcloud/Dockerfile.njk +69 -0
- package/template/deploy/to-docker/gcloud/build.sh.njk +39 -0
- package/template/deploy/to-docker/podman/Dockerfile.njk +69 -0
- package/template/deploy/to-docker/podman/build.sh.njk +44 -0
- package/template/deploy/to-electron/mac/entitlements.plist.njk +18 -0
- package/template/deploy/to-electron/main.js.njk +37 -0
- package/template/deploy/to-electron/package.json.njk +36 -0
- package/template/deploy/to-electron/src/index.html.njk +23 -0
- package/template/deploy/to-ios-app/fnet/index.html.njk +23 -0
- package/template/deploy/to-ios-app/fnet-ios-app/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
- package/template/deploy/to-ios-app/fnet-ios-app/Assets.xcassets/AppIcon.appiconset/Contents.json +112 -0
- package/template/deploy/to-ios-app/fnet-ios-app/Assets.xcassets/Contents.json +6 -0
- package/template/deploy/to-ios-app/fnet-ios-app/Assets.xcassets/launch-images.imageset/Contents.json +23 -0
- package/template/deploy/to-ios-app/fnet-ios-app/ContentView.swift +32 -0
- package/template/deploy/to-ios-app/fnet-ios-app/Info.plist +10 -0
- package/template/deploy/to-ios-app/fnet-ios-app/LaunchScreen.storyboard +26 -0
- package/template/deploy/to-ios-app/fnet-ios-app/Preview Content/Preview Assets.xcassets/Contents.json +6 -0
- package/template/deploy/to-ios-app/fnet-ios-app/WebView.swift +42 -0
- package/template/deploy/to-ios-app/fnet-ios-app/fnet_ios_appApp.swift +17 -0
- package/template/deploy/to-ios-app/fnet-ios-app.xcodeproj/project.pbxproj.njk +417 -0
- package/template/deploy/to-ios-app/fnet-ios-app.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/template/deploy/to-ios-app/fnet-ios-app.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/template/deploy/to-ios-app/fnet-ios-app.xcodeproj/xcshareddata/xcschemes/fnet-ios-app.xcscheme +77 -0
- package/template/deploy/to-macos-app/fnet/index.html.njk +23 -0
- package/template/deploy/to-macos-app/fnet-macos-app/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
- package/template/deploy/to-macos-app/fnet-macos-app/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
- package/template/deploy/to-macos-app/fnet-macos-app/Assets.xcassets/Contents.json +6 -0
- package/template/deploy/to-macos-app/fnet-macos-app/ContentView.swift +13 -0
- package/template/deploy/to-macos-app/fnet-macos-app/Preview Content/Preview Assets.xcassets/Contents.json +6 -0
- package/template/deploy/to-macos-app/fnet-macos-app/WebView.swift +30 -0
- package/template/deploy/to-macos-app/fnet-macos-app/fnet_macos_app.entitlements +16 -0
- package/template/deploy/to-macos-app/fnet-macos-app/fnet_macos_appApp.swift +17 -0
- package/template/deploy/to-macos-app/fnet-macos-app.xcodeproj/project.pbxproj.njk +396 -0
- package/template/deploy/to-macos-app/fnet-macos-app.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/template/deploy/to-macos-app/fnet-macos-app.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/template/deploy/to-nextjs/app/layout.tsx.njk +13 -0
- package/template/deploy/to-nextjs/app/page.tsx.njk +28 -0
- package/template/deploy/to-nextjs/next-env.d.ts +5 -0
- package/template/deploy/to-nextjs/package.json.njk +20 -0
- package/template/deploy/to-nextjs/tsconfig.json +34 -0
- package/template/deploy/to-pyip/package/__init__.py.njk +4 -0
- package/template/deploy/to-pyip/package/cli/__init__.py.njk +3 -0
- package/template/deploy/to-pyip/package/cli/index.py.njk +24 -0
- package/template/deploy/to-pyip/package/lib/__init__.py.njk +3 -0
- package/template/deploy/to-pyip/pyproject.toml +3 -0
- package/template/deploy/to-pyip/setup.py.njk +32 -0
- package/template/deploy/to-rust/Cargo.toml.njk +16 -0
- package/template/deploy/to-rust/src/main.rs.njk +112 -0
- package/template/deploy/to-webos/appinfo.json.njk +14 -0
- package/template/deploy/to-webos/index.html.njk +39 -0
- package/template/deploy/to-webos/webOSTVjs-1.2.10/LICENSE-2.0.txt +202 -0
- package/template/deploy/to-webos/webOSTVjs-1.2.10/webOSTV-dev.js +1 -0
- package/template/deploy/to-webos/webOSTVjs-1.2.10/webOSTV.js +1 -0
- package/dist/fnet/index.06vbpwcx.js +0 -1
- package/dist/fnet/index.26r88tdp.js +0 -1
- package/dist/fnet/index.2g93a9kt.js +0 -1
- package/dist/fnet/index.61jdafta.js +0 -1
- package/dist/fnet/index.80hh5mtp.js +0 -1
- package/dist/fnet/index.a2mbqyxe.js +0 -1
- package/dist/fnet/index.gywx3fae.js +0 -1
- package/dist/fnet/index.gza1frda.js +0 -1
- package/dist/fnet/index.r2gf0b3s.js +0 -1
- package/dist/fnet/index.rfysmk2b.js +0 -2
- package/dist/fnode/index.5f1kfz9t.js +0 -1
- package/dist/fnode/index.7ev6y63q.js +0 -1
- package/dist/fnode/index.a4q2w1yd.js +0 -1
- package/dist/fnode/index.btj5x5s4.js +0 -1
- package/dist/fnode/index.n1598ffs.js +0 -1
- package/dist/fnode/index.ng6w9cac.js +0 -1
- package/dist/fnode/index.r8s8r2n7.js +0 -2
- package/dist/fnode/index.xc08sjp4.js +0 -1
- 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>
|
|
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
|
-
|
|
17
|
+
---
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Why Flownet?
|
|
20
20
|
|
|
21
|
-
|
|
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
|
-
|
|
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
|
|
26
|
-
- **
|
|
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
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
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
|
-
|
|
48
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
66
|
+
### Homebrew (recommended, macOS/Linux)
|
|
54
67
|
|
|
55
68
|
```bash
|
|
56
|
-
|
|
57
|
-
|
|
69
|
+
brew tap fnetai/tap
|
|
70
|
+
brew install fnet
|
|
71
|
+
```
|
|
58
72
|
|
|
59
|
-
|
|
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
|
-
|
|
63
|
-
fnode create my-bun-project --runtime bun
|
|
75
|
+
### npm
|
|
64
76
|
|
|
65
|
-
|
|
66
|
-
|
|
77
|
+
```bash
|
|
78
|
+
npm install -g @fnet/cli
|
|
67
79
|
```
|
|
68
80
|
|
|
69
|
-
|
|
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
|
-
|
|
72
|
-
# Build the project
|
|
73
|
-
frun build
|
|
74
|
-
|
|
75
|
-
# Run the project
|
|
76
|
-
fnode cli
|
|
83
|
+
## Core Concepts
|
|
77
84
|
|
|
78
|
-
|
|
79
|
-
frun <command-group> [--ftag <tags>]
|
|
80
|
-
```
|
|
85
|
+
### Nodes & Flows
|
|
81
86
|
|
|
82
|
-
|
|
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
|
-
|
|
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
|
-
|
|
89
|
-
|
|
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
|
-
|
|
92
|
-
cd my-project
|
|
93
|
-
fnode install --yes
|
|
98
|
+
### Schema-First & Multi-Runtime
|
|
94
99
|
|
|
95
|
-
|
|
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
|
-
|
|
100
|
-
|
|
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
|
-
|
|
103
|
-
|
|
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
|
-
|
|
115
|
+
### Documentation That Never Lies
|
|
107
116
|
|
|
108
|
-
|
|
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
|
-
**
|
|
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
|
-
|
|
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
|
-
|
|
125
|
+
### AI-Native: MCP Integration
|
|
118
126
|
|
|
119
|
-
-
|
|
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
|
-
|
|
129
|
+
```bash
|
|
130
|
+
# Expose as MCP tool for Claude Desktop or any AI assistant
|
|
131
|
+
fnode cli --cli-mode mcp
|
|
125
132
|
|
|
126
|
-
|
|
133
|
+
# Or over HTTP for remote AI integrations
|
|
134
|
+
fnet cli --cli-mode mcp --mcp-transport http --cli-port 3003
|
|
135
|
+
```
|
|
127
136
|
|
|
128
|
-
-
|
|
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
|
-
##
|
|
139
|
+
## Quick Start
|
|
134
140
|
|
|
135
|
-
|
|
141
|
+
### Create a Project
|
|
136
142
|
|
|
137
|
-
|
|
143
|
+
```bash
|
|
144
|
+
# Node.js project (default runtime)
|
|
145
|
+
fnode create --name my-project
|
|
138
146
|
|
|
139
|
-
|
|
147
|
+
# Python project
|
|
148
|
+
fnode create --name my-project --runtime python
|
|
140
149
|
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
|
|
153
|
+
# Workflow project
|
|
154
|
+
fnet create --name my-workflow
|
|
155
|
+
```
|
|
148
156
|
|
|
149
|
-
|
|
157
|
+
### Quick Test Projects
|
|
150
158
|
|
|
151
|
-
|
|
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
|
-
|
|
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
|
-
|
|
166
|
+
### Build and Run
|
|
160
167
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
-
|
|
165
|
-
|
|
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
|
-
##
|
|
175
|
+
## CLI Tools
|
|
168
176
|
|
|
169
|
-
|
|
177
|
+
### fnode - Node/Classic Projects
|
|
170
178
|
|
|
171
|
-
```
|
|
172
|
-
my-project
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
188
|
+
**Passthrough commands** execute tools in the project's `.workspace` context:
|
|
181
189
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
-
|
|
199
|
+
**Runtime modes** - one project, multiple deployment targets:
|
|
188
200
|
|
|
189
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
229
|
+
Define command groups in your project YAML:
|
|
205
230
|
|
|
206
231
|
```yaml
|
|
207
|
-
|
|
208
|
-
|
|
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
|
-
|
|
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
|
-
|
|
215
|
-
t::prod::database:
|
|
216
|
-
url: "mongodb://production-server:27017"
|
|
217
|
-
```
|
|
258
|
+
### fbin - Binary Management
|
|
218
259
|
|
|
219
|
-
|
|
260
|
+
Compile JavaScript to native binaries and manage installations:
|
|
220
261
|
|
|
221
|
-
|
|
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
|
-
|
|
273
|
+
Pre-compiled binaries for all platforms are built via GitHub Actions and distributed through GitHub Releases.
|
|
224
274
|
|
|
225
|
-
|
|
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
|
-
|
|
277
|
+
Deploy projects as system services across platforms:
|
|
233
278
|
|
|
234
279
|
```bash
|
|
235
|
-
#
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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
|
-
|
|
242
|
-
fbin compile script.js -o my-tool
|
|
290
|
+
**Supported platforms**: macOS (launchd), Linux (systemd), Windows (Windows Services)
|
|
243
291
|
|
|
244
|
-
|
|
245
|
-
fbin install ./my-tool --name awesome-tool
|
|
292
|
+
## Tag-Based Configuration
|
|
246
293
|
|
|
247
|
-
|
|
248
|
-
fbin list
|
|
294
|
+
The `--ftag` parameter enables conditional configuration from a single project file:
|
|
249
295
|
|
|
250
|
-
|
|
251
|
-
|
|
296
|
+
```bash
|
|
297
|
+
frun build --ftag dev --ftag local
|
|
252
298
|
```
|
|
253
299
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
The binary system integrates seamlessly with Flownet projects:
|
|
300
|
+
```yaml
|
|
301
|
+
name: my-project
|
|
257
302
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
fnode compile
|
|
261
|
-
fnode install
|
|
303
|
+
database:
|
|
304
|
+
port: 5432
|
|
262
305
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
fnet install
|
|
306
|
+
t::dev::database:
|
|
307
|
+
url: "mongodb://localhost:27017"
|
|
266
308
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
npm run install-bin
|
|
309
|
+
t::prod::database:
|
|
310
|
+
url: "mongodb://production-server:27017"
|
|
270
311
|
```
|
|
271
312
|
|
|
272
|
-
|
|
313
|
+
One file, multiple environments. Tags enable environment-specific commands, feature flags, and platform-specific configurations.
|
|
273
314
|
|
|
274
|
-
|
|
315
|
+
## Project Structure
|
|
275
316
|
|
|
276
|
-
|
|
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
|
-
|
|
279
|
-
# In fnode.yaml or fnet.yaml
|
|
280
|
-
name: my-project
|
|
325
|
+
**Global directories**:
|
|
281
326
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
s::runtime.type: node # or python, bun
|
|
327
|
+
- `~/.fnet/bin/` - Installed binaries
|
|
328
|
+
- `~/.fnet/services/` - Service definitions
|
|
285
329
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
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
|
-
|
|
345
|
+
## License
|
|
294
346
|
|
|
295
|
-
|
|
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
|
package/scripts/postinstall.js
CHANGED
|
@@ -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}
|
|
144
|
+
console.log(`\n ${installed} items installed to ~/.fnet/`);
|
|
130
145
|
|
|
131
146
|
// Check PATH
|
|
132
147
|
const pathDirs = (process.env.PATH || '').split(':');
|