@armemon-library/cli
v0.1.0
Published
Interactive scaffolding CLI for React Native apps — plugins, splash screen, and advanced init in one wizard.
Downloads
157
Maintainers
Readme
@armemon-library/cli
Interactive scaffolding CLI for React Native apps. Pick your plugins, answer a few questions, and get a fully wired app with nothing left to hand-edit.
Run it
Without installing anything:
npx @armemon-library/cli init react-native MyAppOr install it once. That gives you two commands for the same CLI, armemon and the
shorter memon:
npm install -g @armemon-library/cliarmemon init react-native MyAppNew to armemon? The user guide explains every command in plain words, what each plugin does, and how to use the plugins without the CLI.
All commands and options
This list is made from the armemon CLI itself, so it always matches the version you have.
Quick list
armemon init— Scaffold a new apparmemon add— Add a platform target to an app you already scaffoldedarmemon create-screen— Create a screen and register it in your navigator, param list and deep linksarmemon remove-screen— Remove a screen: unregister it, drop its types and deep link, delete its folderarmemon rename-screen— Rename a screen everywhere: folder, component, route, types, deep link and navigate() callsarmemon plugin— Add a plugin to this app, or take one outarmemon list— List the plugins armemon can install (the same as armemon plugin list)armemon doctor— Check a scaffolded app's armemon wiringarmemon sync— Re-align armemon's managed files, and move a legacy src/armemon/ to armemon/armemon upgrade— Move the app's @armemon-library packages to this CLI's versions, then syncarmemon create-slice— Create a Redux slice and register it in your store configarmemon remove-slice— Unregister a Redux slice and delete its filearmemon rename-slice— Rename a Redux slice: its file, binding, store entry and action prefixarmemon link— Read and edit the app's deep linksarmemon set— Set one option in a plugin's configarmemon create-component— Create a component in a screen folder or the shared one (nothing is wired up)armemon create-hook— Create a hook in a screen folder or the shared one (nothing is wired up)
Options that work on most commands
Each command below lists exactly which of these it takes.
| Option | What it does |
| --- | --- |
| --dry-run | Show what would change, but save nothing. Always safe to try |
| --dir <path> | Run on a different app folder, like --dir ./MyApp |
| --json | Print the result as JSON, for scripts and CI |
| --all-accept | Ask no questions and use the defaults |
| --no-verify | Skip the checks armemon runs after a change. Faster |
| --force | Do it even when armemon would normally stop. Each command below says when |
| --help | Show help for that command in your terminal |
When a command fails, it tells you what went wrong and how to fix it. For more detail,
put ARMEMON_DEBUG=1 in front of the command.
JSON output, for scripts
With --json, a command prints one JSON object on stdout and nothing else. Every one
starts with the same two fields:
schemaVersion— the version of the output's shape, now1. It only changes when a field is removed or changes meaning, so skip fields you don't recognise.ok—truewhen the command did everything it was asked. The exit code agrees:0when ok,1for a problem,130when it was cancelled.
When a command fails, the object is { "ok": false, "error": { "message": "…", "hint": "…" } }.
Commands
armemon init
Scaffold a new app
| Subcommand | What it does |
| --- | --- |
| init react-native | Scaffold a new React Native app |
armemon init react-native [appName]
Scaffold a new React Native app
| Argument | What it is |
| --- | --- |
| [appName] | App name — letters and numbers, starting with a letter (optional — you are asked if you leave it out) |
| Flag | What it does |
| --- | --- |
| --rn-version <version> | React Native version (e.g. 0.76.0, or "latest") |
| --pm <manager> | Package manager: npm, yarn, pnpm or bun |
| --language <lang> | ts | js (React Native ships no JS template; armemon converts) |
| --logo <path> | Splash logo image, relative to where you run this |
| --platforms <list> | Comma-separated: ios,android,web,windows,macos |
| --plugins <list> | Comma-separated plugin ids or package names (empty string for none) |
| --all-accept | Skip every prompt: every platform, every recommended plugin, and each question's own default |
| --dry-run | Print the resolved configuration and exit without writing anything |
| --no-verify | Skip armemon's own checks on the finished app (they run by default) |
| --verify | Run those checks (the default; accepted for explicitness) |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
armemon init react-native MyApp
# every prompt answered with its default, every recommended plugin
armemon init react-native MyApp --all-accept
# pinned for CI, nothing interactive
armemon init react-native MyApp --pm pnpm --language ts --platforms ios,android,web --plugins redux,navigation --json
# see what it would do first
armemon init react-native MyApp --dry-runarmemon add <platform>
Add a platform target to an app you already scaffolded
| Argument | What it is |
| --- | --- |
| <platform> | Platform to add: ios, android, web, windows, macos |
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --dry-run | List what adding the platform would do, without changing anything |
| --no-verify | Skip armemon's checks on the result (they run by default) |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
| --all-accept | Take every default instead of asking |
armemon add web
armemon add windows --dir ./MyApp
armemon add ios --jsonarmemon create-screen [name]
Create a screen and register it in your navigator, param list and deep links
| Argument | What it is |
| --- | --- |
| [name] | Screen name — Order, OrderScreen, or order-history (optional — you are asked if you leave it out) |
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --full | Create components/, hooks/, utils/ and assets/ folders |
| --flat | Create only index — no subfolders |
| --register | Register without asking; fail if there is no navigator |
| --no-register | Don't touch the navigator |
| --navigator <name> | Where to register: stack, tabs, drawer, a variable like Tab, or File:Variable |
| --link <path> | Deep-link path, e.g. order or order/:id |
| --no-link | Don't add a deep-link entry |
| --params <list> | Route params, e.g. "id:string,page?:number" (string, number, boolean) |
| --initial | Make it the navigator's initial route |
| --modal | Present it as a modal (stack navigators) |
| --title <title> | Header / tab title |
| --force | Replace the screen if it already exists |
| --dry-run | Show every change as a diff without writing anything |
| --no-verify | Skip armemon's checks on the result (they run by default) |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
| --all-accept | Take every default instead of asking |
armemon create-screen Order
# typed route params, and a deep link that carries them
armemon create-screen Order --params "id:string,page?:number" --link order/:id
# a modal with a header title, in a stack
armemon create-screen Settings --modal --title Settings
# into a specific navigator, as its first route
armemon create-screen Feed --navigator Tab --initial
# just the file: no subfolders, no navigator, no link
armemon create-screen Order --flat --no-register --no-link
# look before writing, then do it without the checks
armemon create-screen Order --dry-run
armemon create-screen Order --json --no-verifyarmemon remove-screen <name>
Remove a screen: unregister it, drop its types and deep link, delete its folder
| Argument | What it is |
| --- | --- |
| <name> | Screen name — Order, OrderScreen, or order-history |
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --keep-files | Unregister it but keep its folder |
| --force | Remove it even while code still navigates to it, or it is an initial route |
| --dry-run | Show every change as a diff without writing anything |
| --no-verify | Skip armemon's checks on the result (they run by default) |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
| --all-accept | Take every default instead of asking |
armemon remove-screen Order
# unregister it but keep the folder
armemon remove-screen Order --keep-files
# remove it even though something still navigates to it
armemon remove-screen Order --force
armemon remove-screen Order --dry-runarmemon rename-screen <from> <to>
Rename a screen everywhere: folder, component, route, types, deep link and navigate() calls
| Argument | What it is |
| --- | --- |
| <from> | The screen to rename — Order, OrderScreen, or order |
| <to> | Its new name |
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --link <path> | A new deep-link path |
| --keep-link | Keep the current deep-link path even if it came from the old name |
| --dry-run | Show every change as a diff without writing anything |
| --no-verify | Skip armemon's checks on the result (they run by default) |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
| --all-accept | Take every default instead of asking |
armemon rename-screen Order Invoice
# rename, and give it a new URL at the same time
armemon rename-screen Order Invoice --link invoice/:id
# rename, but leave the deep-link path alone
armemon rename-screen Order Invoice --keep-linkarmemon plugin
Add a plugin to this app, or take one out
| Subcommand | What it does |
| --- | --- |
| plugin add | Add a plugin, wired in exactly as init would have |
| plugin remove | Remove a plugin: its files, its packages, and its wiring |
| plugin list | List the plugins armemon can install, and which this app has |
armemon plugin add [plugin]
Add a plugin, wired in exactly as init would have
| Argument | What it is |
| --- | --- |
| [plugin] | Plugin id or package name — redux (optional — you are asked if you leave it out) |
| Flag | What it does |
| --- | --- |
| --logo <path> | Splash logo image, relative to where you run this |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --dry-run | Show every file, edit and package the change involves, without writing anything |
| --force | Go ahead past files you've changed, leaving each one as it is and listing it |
| --no-verify | Skip armemon's checks on the result (they run by default) |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
| --all-accept | Take the plugin's default answers instead of asking |
armemon plugin add redux
# see every file, edit and package first
armemon plugin add navigation --dry-run
# default answers, JSON out, for a script
armemon plugin add essentials --json
# the splash screen with your logo
armemon plugin add splash --logo ./assets/logo.pngarmemon plugin remove [plugin]
Remove a plugin: its files, its packages, and its wiring
| Argument | What it is |
| --- | --- |
| [plugin] | Plugin id or package name — redux (optional — you are asked if you leave it out) |
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --dry-run | Show every file, edit and package the change involves, without writing anything |
| --force | Go ahead past files you've changed, leaving each one as it is and listing it |
| --no-verify | Skip armemon's checks on the result (they run by default) |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
| --all-accept | Take the plugin's default answers instead of asking |
armemon plugin remove redux
armemon plugin remove redux --dry-run
# go ahead past files you've changed — they stay, and are listed
armemon plugin remove ui --forcearmemon plugin list
List the plugins armemon can install, and which this app has
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --json | Print only a JSON summary on stdout |
armemon plugin list
armemon plugin list --jsonarmemon list
List the plugins armemon can install (the same as armemon plugin list)
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --json | Emit machine-readable JSON instead of prose |
armemon list
armemon list --jsonarmemon doctor [appDir]
Check a scaffolded app's armemon wiring
| Argument | What it is |
| --- | --- |
| [appDir] | The app directory — the same as --dir (optional — you are asked if you leave it out) |
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --json | Emit machine-readable JSON instead of prose |
armemon doctor
armemon doctor ./MyApp
armemon doctor --jsonarmemon sync
Re-align armemon's managed files, and move a legacy src/armemon/ to armemon/
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --dry-run | Show every change as a diff without writing anything |
| --no-verify | Skip armemon's checks on the result (they run by default) |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
| --all-accept | Take every default instead of asking |
armemon sync
# see what it would re-align first
armemon sync --dry-runarmemon upgrade
Move the app's @armemon-library packages to this CLI's versions, then sync
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --dry-run | List the version changes without installing anything |
| --no-verify | Skip armemon's checks on the result (they run by default) |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
| --all-accept | Take every default instead of asking |
# after updating the CLI: npm install -g @armemon-library/cli
armemon upgrade
# see which versions would change first
armemon upgrade --dry-runarmemon create-slice [name]
Create a Redux slice and register it in your store config
| Argument | What it is |
| --- | --- |
| [name] | Slice name — cart, cartSlice, or cart-items (optional — you are asked if you leave it out) |
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --no-register | Write the slice file without touching the store config |
| --force | Replace the slice file if it already exists |
| --dry-run | Show every change as a diff without writing anything |
| --no-verify | Skip armemon's checks on the result (they run by default) |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
| --all-accept | Take every default instead of asking |
armemon create-slice cart
# write the file, leave the store config alone
armemon create-slice cart --no-register
# replace a slice file that already exists
armemon create-slice cart --forcearmemon remove-slice [name]
Unregister a Redux slice and delete its file
| Argument | What it is |
| --- | --- |
| [name] | Slice name — cart, cartSlice, or cart-items (optional — you are asked if you leave it out) |
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --keep-files | Unregister it but leave the slice file where it is |
| --force | Remove it even though other files still import it |
| --dry-run | Show every change as a diff without writing anything |
| --no-verify | Skip armemon's checks on the result (they run by default) |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
| --all-accept | Take every default instead of asking |
armemon remove-slice cart
# unregister it but keep the file
armemon remove-slice cart --keep-files
# remove it even though other files still import it
armemon remove-slice cart --forcearmemon rename-slice [from] [to]
Rename a Redux slice: its file, binding, store entry and action prefix
| Argument | What it is |
| --- | --- |
| [from] | The slice to rename — cart (optional — you are asked if you leave it out) |
| [to] | What to call it — basket (optional — you are asked if you leave it out) |
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --dry-run | Show every change as a diff without writing anything |
| --no-verify | Skip armemon's checks on the result (they run by default) |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
| --all-accept | Take every default instead of asking |
armemon rename-slice cart basket
armemon rename-slice cart basket --dry-runarmemon link
Read and edit the app's deep links
| Subcommand | What it does |
| --- | --- |
| link init | Create a deep-link config covering every screen this app already has |
| link list | Show every deep link, and where each one sits |
| link add | Add or update a deep link, nested under the right navigator |
| link remove | Remove a deep link |
armemon link init
Create a deep-link config covering every screen this app already has
| Flag | What it does |
| --- | --- |
| --dry-run | Show what would be created without writing anything |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --json | Print only a JSON summary on stdout |
| --all-accept | Take every default instead of asking |
# for an app scaffolded without deep linking: gives every screen a URL
armemon link init
armemon link init --dry-runarmemon link list
Show every deep link, and where each one sits
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --json | Print only a JSON summary on stdout |
| --all-accept | Take every default instead of asking |
armemon link list
armemon link list --jsonarmemon link add [route] [path]
Add or update a deep link, nested under the right navigator
| Argument | What it is |
| --- | --- |
| [route] | Route name — Order (optional — you are asked if you leave it out) |
| [path] | URL path — order/:id (optional — you are asked if you leave it out) |
| Flag | What it does |
| --- | --- |
| --dry-run | Show the change as a diff without writing anything |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --json | Print only a JSON summary on stdout |
| --all-accept | Take every default instead of asking |
armemon link add Order order/:id
# change the path a route already has
armemon link add Home startarmemon link remove [route]
Remove a deep link
| Argument | What it is |
| --- | --- |
| [route] | Route name — Order (optional — you are asked if you leave it out) |
| Flag | What it does |
| --- | --- |
| --dry-run | Show the change as a diff without writing anything |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --json | Print only a JSON summary on stdout |
| --all-accept | Take every default instead of asking |
armemon link remove Orderarmemon set [option] [value]
Set one option in a plugin's config
| Argument | What it is |
| --- | --- |
| [option] | Plugin option — ui.themeMode, essentials.notifications.position (optional — you are asked if you leave it out) |
| [value] | The value — dark, 18, true (optional — you are asked if you leave it out) |
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --raw | Use the value as code rather than inferring a literal (e.g. DEV) |
| --force | Replace a value that is a function or a call |
| --dry-run | Show the change as a diff without writing anything |
| --no-verify | Skip armemon's checks on the result (they run by default) |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
| --all-accept | Take every default instead of asking |
armemon set ui.themeMode dark
armemon set ui.baseFontSize 18
# a nested option
armemon set essentials.notifications.position bottom
# an expression rather than a literal
armemon set redux.devTools __DEV__ --raw
# replace a value that is currently a function
armemon set redux.middleware undefined --forcearmemon create-component [name]
Create a component in a screen folder or the shared one (nothing is wired up)
| Argument | What it is |
| --- | --- |
| [name] | Component name — OrderRow (optional — you are asked if you leave it out) |
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --screen <name> | Put it in that screen's own folder |
| --shared | Put it in the shared folder |
| --force | Replace the file if it already exists |
| --dry-run | Show what would be created without writing anything |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
| --all-accept | Take every default instead of asking |
armemon create-component OrderRow
# into one screen's own components/ folder
armemon create-component OrderRow --screen Order
# into src/shared/components/, for something more than one screen uses
armemon create-component OrderRow --sharedarmemon create-hook [name]
Create a hook in a screen folder or the shared one (nothing is wired up)
| Argument | What it is |
| --- | --- |
| [name] | Hook name — useOrderTotals (optional — you are asked if you leave it out) |
| Flag | What it does |
| --- | --- |
| --dir <path> | The app directory (defaults to the nearest one at or above here) |
| --screen <name> | Put it in that screen's own folder |
| --shared | Put it in the shared folder |
| --force | Replace the file if it already exists |
| --dry-run | Show what would be created without writing anything |
| --json | Print only a JSON summary on stdout (implies --all-accept) |
| --all-accept | Take every default instead of asking |
armemon create-hook useOrderTotals
armemon create-hook useOrderTotals --screen Order
armemon create-hook useSession --sharedPart of armemon — interactive React Native scaffolding. MIT © Ahmed Raza Memon
