@fnnas-labs/fnos-cli 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +169 -2
- package/THIRD_PARTY_NOTICES.txt +38904 -0
- package/cordis.patch.yml +3 -0
- package/npm/README.dsh.md +49 -0
- package/npm/acceptance-report.cjs +53 -0
- package/npm/dsh-integration.mjs +159 -0
- package/npm/dsh-test-support.mjs +55 -0
- package/npm/dsh.mjs +31 -0
- package/npm/install.cjs +130 -0
- package/npm/package-lib.cjs +274 -0
- package/npm/run.cjs +39 -0
- package/package.json +46 -4
- package/skill/LICENSE +21 -0
- package/skill/SKILL.md +143 -0
- package/skill/THIRD_PARTY_NOTICES.txt +38904 -0
- package/skill/bin/trim-cli-darwin-arm64 +0 -0
- package/skill/bin/trim-cli-darwin-x64 +0 -0
- package/skill/bin/trim-cli-linux-arm64 +0 -0
- package/skill/bin/trim-cli-linux-x64 +0 -0
- package/skill/bin/trim-cli-windows-arm64.exe +0 -0
- package/skill/bin/trim-cli-windows-x64.exe +0 -0
- package/skill/build-provenance.json +44 -0
- package/skill/entries/trim-app.md +63 -0
- package/skill/entries/trim-baidu-netdisk.md +42 -0
- package/skill/entries/trim-docker.md +35 -0
- package/skill/entries/trim-download.md +38 -0
- package/skill/entries/trim-file.md +30 -0
- package/skill/entries/trim-log.md +32 -0
- package/skill/entries/trim-monitor.md +41 -0
- package/skill/entries/trim-network.md +22 -0
- package/skill/entries/trim-photos.md +32 -0
- package/skill/entries/trim-shared.md +54 -0
- package/skill/entries/trim-storage.md +34 -0
- package/skill/entries/trim-system.md +59 -0
- package/skill/entries/trim-user.md +28 -0
- package/skill/manifest.json +43 -0
- package/skill/reference/_conventions.md +76 -0
- package/skill/reference/_index.md +78 -0
- package/skill/reference/app-center.md +234 -0
- package/skill/reference/baidu-netdisk.md +221 -0
- package/skill/reference/dockermgr.md +244 -0
- package/skill/reference/download.md +357 -0
- package/skill/reference/file.md +752 -0
- package/skill/reference/log.md +224 -0
- package/skill/reference/network.md +41 -0
- package/skill/reference/oauth.md +51 -0
- package/skill/reference/photos.md +158 -0
- package/skill/reference/power.md +34 -0
- package/skill/reference/resmon.md +160 -0
- package/skill/reference/stor.md +525 -0
- package/skill/reference/sysinfo.md +133 -0
- package/skill/reference/user.md +139 -0
- package/skill/reference/workflows/device-validation.md +66 -0
- package/skill/reference/workflows/file-routing.md +44 -0
- package/skill/reference/workflows/file-upload-validation.md +63 -0
- package/skill/reference/workflows/photos-routing.md +83 -0
- package/skill/reference/workflows/storage-dangerous-ops.md +53 -0
- package/skill/scripts/fnos-cli +63 -0
- package/skill/scripts/fnos-cli.cmd +36 -0
- package/skill/scripts/fnos-cli.ps1 +31 -0
- package/skill/scripts/trim-cli +63 -0
- package/skill/scripts/trim-cli.cmd +36 -0
- package/skill/scripts/trim-cli.ps1 +31 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Guangzhou TR Intelligent Manufacturing Technology Co., Ltd.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,170 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @fnnas-labs/fnos-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The command-line client and Agent Skill for fnOS. It supports macOS, Linux,
|
|
4
|
+
and Windows on x64 and arm64.
|
|
5
|
+
|
|
6
|
+
## Quick Start
|
|
7
|
+
|
|
8
|
+
Node.js 18 or later and `npx` are required:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npx -y --package=@fnnas-labs/fnos-cli@0.2.0 fnos-cli install
|
|
12
|
+
fnos-cli --help
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The install command performs two actions:
|
|
16
|
+
|
|
17
|
+
- installs the same version of the `fnos-cli` command globally through npm;
|
|
18
|
+
- installs the matching fnOS Agent Skill in `~/.agents/skills/fnos-cli`.
|
|
19
|
+
|
|
20
|
+
The package also exposes `trim-cli` as a compatibility command. Both commands
|
|
21
|
+
launch the same CLI and report the same version.
|
|
22
|
+
|
|
23
|
+
Both names retain the existing `~/.config/trim-cli` session location, the
|
|
24
|
+
`TRIM_CLI_CONFIG_DIR` override, named `--profile` sessions and the macOS Keychain
|
|
25
|
+
identity `trim-cli.session`. Upgrading the command name alone does not require
|
|
26
|
+
another authorization. Use the same host, system user, configuration environment
|
|
27
|
+
and profile as your login terminal; SSH, containers and other hosts do not
|
|
28
|
+
automatically share that session. Existing sessions must still have the current
|
|
29
|
+
OAuth permissions.
|
|
30
|
+
|
|
31
|
+
Codex and other compatible agents can discover `SKILL.md` from that directory.
|
|
32
|
+
Restart an already running agent if the newly installed Skill does not appear.
|
|
33
|
+
|
|
34
|
+
## Other Installation Modes
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Install only the Skill without installing the global fnos-cli command
|
|
38
|
+
npx -y --package=@fnnas-labs/fnos-cli@0.2.0 fnos-cli install --skill-only
|
|
39
|
+
|
|
40
|
+
# Install the Skill in .agents/skills/fnos-cli under the current project
|
|
41
|
+
npx -y --package=@fnnas-labs/fnos-cli@0.2.0 fnos-cli install --project
|
|
42
|
+
|
|
43
|
+
# Install only the global fnos-cli command without copying the Skill
|
|
44
|
+
npx -y --package=@fnnas-labs/fnos-cli@0.2.0 fnos-cli install --skip-skill
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
You can also run the CLI without installing it permanently:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx -y --package=@fnnas-labs/fnos-cli@0.2.0 fnos-cli --help
|
|
51
|
+
npx -y --package=@fnnas-labs/fnos-cli@0.2.0 fnos-cli --version
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The npm package contains native binaries for every supported platform. The
|
|
55
|
+
launcher selects the correct binary for the current operating system and CPU
|
|
56
|
+
architecture. Unsupported platforms are rejected before the CLI starts.
|
|
57
|
+
|
|
58
|
+
## Sign In to fnOS
|
|
59
|
+
|
|
60
|
+
Installation does not sign in automatically, enter account credentials, or
|
|
61
|
+
open an authorization page. Start the interactive OAuth PKCE flow before first
|
|
62
|
+
use:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
fnos-cli --profile home --host <nas-host> --port <port> login
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The production authorization flow is:
|
|
69
|
+
|
|
70
|
+
1. The CLI displays an authorization URL.
|
|
71
|
+
2. The user signs in and approves access in a browser.
|
|
72
|
+
3. The user pastes the one-time code back into the CLI prompt.
|
|
73
|
+
|
|
74
|
+
Use `--no-open` when the CLI cannot open a browser automatically:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
fnos-cli --profile home --host <nas-host> --port <port> login --no-open
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Remote devices using unencrypted HTTP must be explicitly allowed:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
fnos-cli --profile home --host <nas-host> --port 5666 \
|
|
84
|
+
--scheme http --allow-insecure-http login --no-open
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
After signing in, commands can be run as follows:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
fnos-cli --profile home system info
|
|
91
|
+
fnos-cli --profile home file ls /vol1
|
|
92
|
+
fnos-cli --profile home photos folders
|
|
93
|
+
fnos-cli --profile home docker container ls --all
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Write operations still require an explicit `--yes`. Do not include an
|
|
97
|
+
authorization code, access token, or refresh token in command arguments, logs,
|
|
98
|
+
or error reports.
|
|
99
|
+
|
|
100
|
+
## Update and Uninstall
|
|
101
|
+
|
|
102
|
+
Run the installation command again with the version you intend to install:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npx -y --package=@fnnas-labs/fnos-cli@0.2.0 fnos-cli install
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The installer writes `.fnos-cli-ownership.json` inside the installed Skill,
|
|
109
|
+
recording its package, version and SHA-256 digest manifest. It replaces an
|
|
110
|
+
existing `fnos-cli` Skill only when that marker and the complete directory tree
|
|
111
|
+
still agree. Added files, empty directories, edited files or symbolic links make
|
|
112
|
+
the directory ineligible for automatic replacement. An unknown or customized
|
|
113
|
+
same-name directory is preserved and installation stops; review and move that
|
|
114
|
+
directory aside before retrying. Keep your custom content in the saved copy.
|
|
115
|
+
|
|
116
|
+
Legacy `fnos` and `trim-cli` Skill directories are removed only when their
|
|
117
|
+
ownership marker and digest manifest can also be verified. Historical installs
|
|
118
|
+
without a marker are preserved with a warning, even if their names look familiar.
|
|
119
|
+
Review those directories manually to avoid duplicate Skill instructions. Normal
|
|
120
|
+
publication failures restore the original directories; if an interrupted process
|
|
121
|
+
leaves an installation lock or a hidden backup, confirm no installer is running
|
|
122
|
+
and review the retained files before retrying. The installer does not take over
|
|
123
|
+
an existing lock automatically.
|
|
124
|
+
|
|
125
|
+
Remove only the global command with:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
npm uninstall --global @fnnas-labs/fnos-cli
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
This does not remove installed Skills, legacy directories, custom files or saved
|
|
132
|
+
sessions. A user-scoped Skill is at `~/.agents/skills/fnos-cli`; a project-scoped
|
|
133
|
+
Skill is at `.agents/skills/fnos-cli` inside that project. To remove a Skill,
|
|
134
|
+
review that exact directory and back up any custom files before deleting it
|
|
135
|
+
manually. Do not delete adjacent `fnos` or `trim-cli` directories without checking
|
|
136
|
+
their contents.
|
|
137
|
+
|
|
138
|
+
## Network and Private Registries
|
|
139
|
+
|
|
140
|
+
Package installation requires access to an npm registry. To use an internal
|
|
141
|
+
registry, provide it through npm configuration:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
npm_config_registry=https://<npm-registry>/ npx -y --package=@fnnas-labs/fnos-cli@0.2.0 fnos-cli install
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
An HTTP 404 from the registry means the requested version is unavailable or the
|
|
148
|
+
current npm account does not have permission to read it.
|
|
149
|
+
|
|
150
|
+
## Verify the Version
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
fnos-cli --version
|
|
154
|
+
trim-cli --version
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Both commands should report the same version. Command behavior and detailed API
|
|
158
|
+
documentation are installed with the Skill under
|
|
159
|
+
`~/.agents/skills/fnos-cli/reference/`.
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
|
|
163
|
+
The distributed fnOS CLI binaries, Skill documentation and integration code use
|
|
164
|
+
the [MIT License](LICENSE). Copyright (c) 2026 Guangzhou TR Intelligent
|
|
165
|
+
Manufacturing Technology Co., Ltd. Third-party components retain their respective
|
|
166
|
+
licenses and notices, collected in [Third-party notices](THIRD_PARTY_NOTICES.txt).
|
|
167
|
+
|
|
168
|
+
This license does not cover the fnOS operating system or server-side services.
|
|
169
|
+
API access requires authorization and remains subject to the applicable service
|
|
170
|
+
terms. The native CLI source is not included in the public Skill repository.
|