CLI reference
Run the generator, tools/ossiframe-cli, from a checkout with cargo run -p ossiframe-cli -- <command> (no standalone binary yet). Invalid input stops with a one-line error and writes nothing. Help blocks are the output of <command> --help.
new
Generate a new Ossiframe app in <DIR> (absent or empty directory)
Usage: ossiframe-cli new [OPTIONS] [DIR]
Arguments:
[DIR] Target directory. Must be absent or empty
Options:
--name <NAME> Product name, for example "Acme Ops"
--identifier <IDENTIFIER> Reverse-DNS app identifier, for example dev.example.acme
--preset <PRESET> A module preset (see `list`). It never enables an opt-in flag
--modules <MODULES> Optional modules to include (comma separated), added to the preset
--with-example-module Include the example `ports` module as a local module crate
--rev <REV> Ossiframe commit to pin (40-hex). Defaults to the local HEAD
--ossiframe-local <PATH> Use plain `path` dependencies on a local Ossiframe checkout (testing only)
--enable-provisioning Allow modules that run commands as root on servers (`ubuntu-provisioning`)
--enable-terminal Allow modules that open an interactive shell on servers (`ssh-terminal`)
--enable-files Allow modules that browse and transfer files over SFTP (`ssh-filesystem`)
--enable-tunnels Allow modules that forward local TCP ports over SSH (`ssh-tunnel`)
--enable-file-write Also generate the file write commands (upload, new folder, rename, delete). Needs --enable-files
--enable-app-deploy Allow the application deployment module (`app-deploy`). Needs --enable-provisioning too
--allow-ossiframe-namespace Allow identifiers under dev.ossiframe.*
--interactive Ask for every input in the terminal
--dry-run Show what would be generated; write nothing
-h, --help Print helpThe name is 1 to 64 characters, starts with a letter and uses A-Z a-z 0-9 space _ -. The identifier is reverse-DNS with lowercase segments. Each opt-in flag is valid only with its module, and the module is refused without its flag. With --interactive, each opt-in needs a typed yes, and the CLI asks for confirmation before writing.
list
List the modules and presets
Usage: ossiframe-cli list [OPTIONS]
Options:
--json Print JSON instead of text
-h, --help Print helpadd
Add catalog modules to a generated project
Usage: ossiframe-cli add [OPTIONS] <PROJECT> <MODULES>...
Arguments:
<PROJECT> The generated project (the folder with ossiframe.json)
<MODULES>... Module ids
Options:
--enable-provisioning Allow modules that run commands as root on servers (`ubuntu-provisioning`)
--enable-terminal Allow modules that open an interactive shell on servers (`ssh-terminal`)
--enable-files Allow modules that browse and transfer files over SFTP (`ssh-filesystem`)
--enable-tunnels Allow modules that forward local TCP ports over SSH (`ssh-tunnel`)
--enable-file-write Also generate the file write commands (upload, new folder, rename, delete). Needs --enable-files
--enable-app-deploy Allow the application deployment module (`app-deploy`). Needs --enable-provisioning too
--accept-merged <PATH> A managed file you merged by hand after a conflict (repeatable)
--dry-run Show what would change; write nothing
-h, --help Print helpDependencies are resolved again, and opt-in modules need their flag, as in new.
remove
Remove modules from a generated project (local modules are only unregistered)
Usage: ossiframe-cli remove [OPTIONS] <PROJECT> <MODULES>...
Arguments:
<PROJECT> The generated project (the folder with ossiframe.json)
<MODULES>... Module ids
Options:
--enable-provisioning Allow modules that run commands as root on servers (`ubuntu-provisioning`)
--enable-terminal Allow modules that open an interactive shell on servers (`ssh-terminal`)
--enable-files Allow modules that browse and transfer files over SFTP (`ssh-filesystem`)
--enable-tunnels Allow modules that forward local TCP ports over SSH (`ssh-tunnel`)
--enable-file-write Also generate the file write commands (upload, new folder, rename, delete). Needs --enable-files
--enable-app-deploy Allow the application deployment module (`app-deploy`). Needs --enable-provisioning too
--accept-merged <PATH> A managed file you merged by hand after a conflict (repeatable)
--dry-run Show what would change; write nothing
-h, --help Print helpremove refuses a module another module needs, and clears an opt-in no remaining module needs.
new-module
Create a local module in a generated project and register it
Usage: ossiframe-cli new-module [OPTIONS] --id <ID> <PROJECT>
Arguments:
<PROJECT>
Options:
--id <ID> Module id, for example acme-disk
--name <NAME> Display name. Defaults to the id
--dry-run Show what would change; write nothing
-h, --help Print helpSee the tutorial.
recover
Finish or discard an interrupted add, remove or new-module
Usage: ossiframe-cli recover [OPTIONS] <PROJECT>
Arguments:
<PROJECT>
Options:
--release-lock Remove a leftover lock. Only when no ossiframe-cli runs on this project
-h, --help Print helpPresets
The default is minimal; --modules adds to a preset.
| Preset | Modules |
|---|---|
minimal | none |
monitor | linux-monitoring |
observe | linux-inventory, linux-monitoring, linux-logs |
audit | observe plus linux-audit |
connect | ssh-terminal, ssh-filesystem, ssh-tunnel |
operator | observe plus connect |
Presets never enable opt-in flags: connect and operator still need --enable-terminal, --enable-files and --enable-tunnels.
The project record
new writes ossiframe.json at the project root: inputs only, no secrets. add, remove and new-module read it.
| Field | Meaning |
|---|---|
schema | 2 for new records (adds optIns.appDeploy). Schema 1 is still read |
generator | CLI version that wrote it |
name, identifier | The product inputs |
source | { "kind": "git", "rev": "<40-hex>" } or { "kind": "local", "path": "<checkout>" } |
modules | Selected catalog modules |
exampleModule | ports example registered |
localModules | Local modules (id, crate, type, ui) |
optIns | provisioning, terminal, files, fileWrite, tunnels, appDeploy (schema 2, omitted when false) |
managed | SHA-256 of each managed file and module folder as last written or accepted (folders end with /) |
The CLI refuses projects without ossiframe.json. Every path it touches must stay inside the project with no symlink component.
Managed files
Managed files: package.json, src-tauri/Cargo.toml, src-tauri/src/lib.rs, src-tauri/build.rs, src-tauri/capabilities/main.json, src/App.tsx, src/modules.ts, OSSIFRAME-LICENSE and the copied src/modules/<catalog module>/ folders. A change touches only files whose generated output differs.
Conflicts
If you changed a managed file that the update also changes, the CLI writes a proposal <file>.ossiframe-new and never overwrites an existing one. To resolve it:
- Merge the proposal into the file by hand.
- Delete the
.ossiframe-newfile. - Rerun the command with
--accept-merged <file>for each merged file.
A merge of a security file (src-tauri/Cargo.toml, src-tauri/src/lib.rs, src-tauri/build.rs, src-tauri/capabilities/main.json) is accepted only if its declarations equal the proposal's:
- the full capability structure (identifier, windows, webviews, local and remote access, platforms, permissions; only
descriptionis ignored); - the build command list;
- the handler commands, module registrations and plugins;
- the Ossiframe and plugin dependencies.
Otherwise the CLI lists what is missing and extra and changes nothing. A changed copied module folder cannot be merged: restore it from version control.
Staging, lock and recovery
- Each change takes an exclusive
.ossiframe.lock, stages in.ossiframe-staging/with a journal, applies, and writesossiframe.jsonlast. - After an interruption,
recover <project>finishes the run if staging is complete, otherwise discards it. For a stale lock with no CLI running, userecover <project> --release-lock. - Each staged step records the destination's original and intended hashes and checks them when applying.
- If you changed a destination after staging, the step refuses to overwrite or remove it. Move your change aside and run
recoveragain, or delete.ossiframe-staging/and rerun.
Pinned checkout
A Git-pinned project needs a clean checkout at the pinned commit. A local-mode project must point at the checkout you run the CLI from. Changing the pin is not supported.
Local modules and dry runs
The CLI never rewrites local modules (from new-module) or the copied ports example, and remove keeps their source. --dry-run shows the files that would change and writes nothing.
