{"id":25667253,"url":"https://github.com/nostackapp/ns-cli","last_synced_at":"2025-08-03T03:07:36.028Z","repository":{"id":35319873,"uuid":"205687147","full_name":"NoStackApp/ns-cli","owner":"NoStackApp","description":"cli for creating no-stack apps","archived":false,"fork":false,"pushed_at":"2022-12-30T19:18:23.000Z","size":1847,"stargazers_count":0,"open_issues_count":14,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-06T13:06:39.728Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NoStackApp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-01T14:22:26.000Z","updated_at":"2020-05-06T08:41:09.000Z","dependencies_parsed_at":"2023-01-15T18:10:26.469Z","dependency_job_id":null,"html_url":"https://github.com/NoStackApp/ns-cli","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoStackApp%2Fns-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoStackApp%2Fns-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoStackApp%2Fns-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoStackApp%2Fns-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NoStackApp","download_url":"https://codeload.github.com/NoStackApp/ns-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240452306,"owners_count":19803594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-24T09:28:30.319Z","updated_at":"2025-02-24T09:28:31.052Z","avatar_url":"https://github.com/NoStackApp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nno-stack-cli\n============\n\n\n[![Version](https://img.shields.io/npm/v/no-stack-cli.svg)](https://npmjs.org/package/no-stack-cli)\n[![Downloads/week](https://img.shields.io/npm/dw/no-stack-cli.svg)](https://npmjs.org/package/no-stack-cli)\n[![License](https://img.shields.io/npm/l/no-stack-cli.svg)](https://github.com/YizYah/no-stack-cli/blob/master/package.json)\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents** \n\n- [Intro](#intro)\n  - [Getting Started](#getting-started)\n  - [Using the CLI](#using-the-cli)\n  - [The quickstarter Command](#the-quickstarter-command)\n  - [Separate Steps for generating an App](#separate-steps-for-generating-an-app)\n    - [Create a NoStack App Placeholder](#create-a-nostack-app-placeholder)\n    - [Create an Empty Stack](#create-an-empty-stack)\n    - [Build the Stack](#build-the-stack)\n    - [Generate a Front End App](#generate-a-front-end-app)\n  - [Creating an App Base](#creating-an-app-base)\n  - [Getting Help](#getting-help)\n  - [Further Information](#further-information)\n- [Usage](#usage)\n- [Commands](#commands)\n  - [`nostack callapi`](#nostack-callapi)\n  - [`nostack createstack`](#nostack-createstack)\n  - [`nostack help [COMMAND]`](#nostack-help-command)\n  - [`nostack makecode`](#nostack-makecode)\n  - [`nostack newapp`](#nostack-newapp)\n  - [`nostack quickstarter`](#nostack-quickstarter)\n  - [`nostack resetstack`](#nostack-resetstack)\n  - [`nostack spinstack`](#nostack-spinstack)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n\n\n# Intro\n[NoStack](https://www.nostack.net/) lets you generate a \nsecure and stable back end easily from a high level app flow specification, and even generates starter React code for your front end. \n\nThis CLI lets you take advantage of these capabilities. The CLI, as well as NoStack, are only being released in alpha at this point. But we are actively building the project.\n\nNoStack lets you break down your app flow into *units*, which are essentially hierarchies (trees) of data types.  NoStack then spins up a back end that combines the data needs of all of the units, and creates for you starter front end code.  The starter code implements the full user flow.  [But styling is left up to you.]  Unlike templating tools, NoStack does not limit your application to particular types of data, screens, etc.\n\nFeatures include:\n* A simple language NoStack Flow Specification (NFS) language for specifying the units of a user interface\n* Spinning up virtual stacks from flow specs within seconds\n* Support for unlimited types of users and apps sharing the same data\n* Built in auth flow and strict access control\n* Hosting of virtual stacks (licence required)\n* Ability to pivot a flow quickly (some features pending)\n* Planned export capability to let you run the app from your own server\n* Generation of starter code on the front end\n* Sample data for testing purposes, marked clearly in the database as sample.\n\n## Getting Started\nTo install the CLI, run the following:\n```\nnpm install -g no-stack-cli\n```\nYou can then run any of the commands as an argument to `nostack`.  For instance:\n```\nnostack callapi ...\n```\n\nThe CLI is only useful if you have a NoStack licence.  You can apply for one on the [NoStack Website](https://www.nostack.net/), but currently they are\n only being awarded to alpha testers.\n\n## Using the CLI\nThe CLI tool is created with the two goals of flexibility and simplicity.  You can use the CLI to perform any action possible with the NoStack API, so it is flexible.  But, most users will be able to get by with a few key commands.\n\nFundamentally, the CLI can do the following:\n1. create a back end, called a \"stack\", using the `spinstack` command\n2. create front end code, called an \"app\", in a specified directory that uses a stack, using the `makecode` command\n3. make general NoStack api calls, using the `callapi` command. (Most people probably won't need that.)\n\nIn addition to being straightforward, the CLI seamlessly handles token refreshing once a \"user\" has logged in.  \n\n*WARNING*: in the alpha version, the CLI currently stores passwords in the directory `~/secure`, which (despite the name) is accessible by anyone who has access to your computer.  So it is your responsibility to protect the computer where the CLI is used from anyone who might maliciously use that information. A future version might come up with a better approach, or at least allow you the option not to save a password.\n\n## The quickstarter Command\nThere is a shortcut command to get started:\n```\n? nostack quickStarter -e ${email} -w ${password} -l ${license}  -u ${moderator} -s ${stackName} -a ${appDir} -t ${appFlow} -c ${userClass} -b ${appBase} -j jsonPath\n```\n\nThat will give you everything you need for your first app.  Note that\nyou will need to provide a licence.\n \nActually, `quickstarter` combines the [Separate Steps for generating an App](#separate-steps-for-generating-an-app) shown below.  If you want to see what's happening, check those out.\n \nThe following parameters appear in `quickstarter`, and are used consistently in other CLI commands:\n* -u \u003cmoderator\u003e: the user name for the stack moderator \n* -w \u003cpassword\u003e: the password for the stack moderator\n* -e \u003cemail\u003e: the email that you want for the stack moderator \n* -l \u003clicense\u003e: the licence string entitling you to a new stack  \n* -s \u003cstackName\u003e: the name of the stack (note that it needs to be unique)\n* -c \u003cuserClass\u003e: the typeName of user in the appFlow file for which the front end app will be created.\n* -a \u003cappDir\u003e: the path and directory of the front end app for the userClass.  (The last directory in the path becomes the name of the app.  Note that it must be all lowercase letters without spaces, but does not need to be unique within nostack, and in fact is only relevant to you running locally.)\n* -t \u003cappFlow\u003e: a path to a valid app flow specification file\n* -b \u003cappBase\u003e [OPTIONAL]: a directory containing an empty NoStack application.  See [Creating an App Base](creating-an-app-base) below for instructions to create one.\n\n## Separate Steps for generating an App\nThe [quickstarter](#the-quickstarter-command) is a way to use the CLI for the first time, but you will probably need to know the commands for the separate steps that it uses.  The reason is that you'll probably want to reset and reuse the stack with a different app flow.\n\nThere are the four standard steps for creating an app, covered below.\n### Create a NoStack App Placeholder\nGeneration of an \"empty\" NoStack application:\n```\nnostack newapp -a \u003cappDir\u003e [-b \u003cbaseApp\u003e ]\n```\nThe application is created using create-react-app, with several added packages.  Included in the packages are:\n* [no-stack](https://www.npmjs.com/package/no-stack), a package that enables a React application to work with NoStack\n* a lot of Apollo client packages.\n\nThis step takes a long time unless you use an baseApp.  See [Creating an App Base](#creating-an-app-base) below.\n\nThe folder for the app will be created.\n  \n### Create an Empty Stack\nCreate a new moderator and stack.\n```\nnostack createstack -e \u003cmoderatorEmail\u003e -w \u003cpassword\u003e -l \u003clicenceId\u003e  -u \u003cmoderatorName\u003e -s \u003cstackName\u003e\n```\n\n### Build the Stack\nSpin up the stack from an [NFS](resources/Documentation/NFSlanguage.md) file.\n```\nnostack spinstack -u \u003cmoderatorName\u003e -t dir/to/appFlow/\u003cappFlow\u003e -s \u003cstackName\u003e -e \u003cemailFor Moderator\u003e -a appDir -j \u003cjsonPath\u003e\n```\n\nCalling `spinstack` will generate  a `stack json` file in the path that you specify in \u003cjsonPath\u003e.  The conventional suffix used is `.json`.  That file contains a wealth of information about your stack, including every element generated and their ids.  Also included are ids for sample data. \n\n### Generate a Front End App\nGenerate front end code for an app for a given userClass.\n\n```\nnostack makecode -a \u003cappDir\u003e -c \u003cuserClass\u003e -j \u003cjsonPath\u003e\n```\n\n\nThe `makecode` command uses the `jsonPath` file specified.  Only the units owned by the specified userClass get used.\n\nYou can build as many apps as you like using your stack.  The tool only generates one app for a user from a given userClass.  But you can modify the `stack.json` file that you use to generate more than one for a userClass by removing unwanted units from your stack json file.\n\nNote: for your convenience, every time you call `makecode`, a copy of the stack json that you used appears in your app directory as `docs/stack.json`.\n\n## Creating an App Base\nThe first step, [newApp](#newapp), takes by far the most time to execute.  Not only does it call create-react-app,\nbut it installs every dependency, which can take 10 minutes.  \n\nTherefore, it pays to perform `newapp` one time to create an `appBase`.  Once you have an appBase, you can create a new app almost immediately by using the new appBase with \nthe `-b` flag: \n```\n? nostack newapp -a app${currentNumber} -b ${appBase}`.\n```\nThe best practice is usually to create one initially by calling this:\n```\nnostack newapp -a /path/to/appbase\n```\nThen you can use the appBase whenever you like.  The drawback of using an appBase is that if any of the dependencies change you will not benefit from the changes.\n\nThe [resources/appFlows](resources/appFlows) directory contains a few sample appFlows.  Currently, there is no repository, but one is planned.\n\n## Getting Help\nIf you are ever confused about the commands, run\n\u003e $ nostack --help\n \nIf you want to know the parameters for any command, just run the command with '--help', e.g.\n\n\u003e $ nostack spinstack --help\n\nBut relax--if you are missing a parameter you will be prompted :)\n\n## Further Information\nCheck out the [Introduction to NoStack](resources/Documentation/IntroToNoStack.md)\nfor an explanation of how data is organized in the stack.\n\nThen check out: \n* [The NFS Language](resources/Documentation/NFSlanguage.md) to understand \napp flows and to create your own easily.\n\n* [The NoStack API](resources/Documentation/NoStackApi.md) is the basis for everything supported by NFS and `spinstack`.\n\n* [The stack.json File](resources/Documentation/stack.json.md).\n\n# Usage\n\u003c!-- usage --\u003e\n```sh-session\n$ npm install -g no-stack-cli\n$ nostack COMMAND\nrunning command...\n$ nostack (-v|--version|version)\nno-stack-cli/0.3.4 linux-x64 node-v12.11.1\n$ nostack --help [COMMAND]\nUSAGE\n  $ nostack COMMAND\n...\n```\n\u003c!-- usagestop --\u003e\n# Commands\n\u003c!-- commands --\u003e\n* [`nostack callapi`](#nostack-callapi)\n* [`nostack createstack`](#nostack-createstack)\n* [`nostack help [COMMAND]`](#nostack-help-command)\n* [`nostack makecode`](#nostack-makecode)\n* [`nostack newapp`](#nostack-newapp)\n* [`nostack quickstarter`](#nostack-quickstarter)\n* [`nostack spinstack`](#nostack-spinstack)\n\n## `nostack callapi`\n\nMake a call to the nostack api. Takes care of auth for the user. You need to specify a file with the graphql query and another one with a json of the variables, if anyare used.\n\n```\nUSAGE\n  $ nostack callapi\n\nOPTIONS\n  -h, --help                         show CLI help\n  -q, --queryFile=queryFile          graphql file containing a single query\n  -s, --stack=stack                  stack\n  -u, --user=user                    moderator for stack\n  -v, --variablesFile=variablesFile  json file with query variables\n\nEXAMPLE\n  $ nostack callapi -u irnold1y -s TestStack1y -q ~/projects/no-stack-queries/queries/unitData1y.graphql -v \n  ~/projects/no-stack-queries/variables/unitData1y.json\n```\n\n_See code: [src/commands/callapi.ts](https://github.com/YizYah/no-stack-cli/blob/v0.3.4/src/commands/callapi.ts)_\n\n## `nostack createstack`\n\nCreates a new moderator and stack.  Also logs in the moderator locally.\n\n```\nUSAGE\n  $ nostack createstack\n\nOPTIONS\n  -e, --email=email          moderator email\n  -f, --force\n  -h, --help                 show CLI help\n  -l, --licenseId=licenseId  license id for the organization of the user\n  -s, --stack=stack          stack\n  -u, --user=user            moderator to create\n  -w, --password=password    moderator password\n\nEXAMPLE\n  $ nostack createStack -u franky -s tempstack, -e franky@gmail.com -w franky12$\n```\n\n_See code: [src/commands/createstack.ts](https://github.com/YizYah/no-stack-cli/blob/v0.3.4/src/commands/createstack.ts)_\n\n## `nostack help [COMMAND]`\n\ndisplay help for nostack\n\n```\nUSAGE\n  $ nostack help [COMMAND]\n\nARGUMENTS\n  COMMAND  command to show help for\n\nOPTIONS\n  --all  see all commands in CLI\n```\n\n_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.1/src/commands/help.ts)_\n\n## `nostack makecode`\n\ngenerates a starter app from a json provided by NoStack\n\n```\nUSAGE\n  $ nostack makecode\n\nOPTIONS\n  -a, --appDir=appDir        application directory\n  -c, --userClass=userClass  user class for which to generate an app\n  -h, --help                 show CLI help\n\n  -j, --jsonPath=jsonPath    path and filename for the stack json file.  The file tells you about your server and gets\n                             used to generate code for front end apps.\n\nEXAMPLE\n  $ nostack makecode -a ~/temp/myapp -j ~/temp/stack.json -c buyer\n```\n\n_See code: [src/commands/makecode.ts](https://github.com/YizYah/no-stack-cli/blob/v0.3.4/src/commands/makecode.ts)_\n\n## `nostack newapp`\n\ncreate an empty new no-stack app.  Effectively combines create-react-app with apollo stuff and the no stack package.\n\n```\nUSAGE\n  $ nostack newapp\n\nOPTIONS\n  -a, --appDir=appDir    application directory\n  -b, --baseApp=baseApp  directory of the base app to copy. If it does not exist, it is created.\n  -h, --help             show CLI help\n\nEXAMPLE\n  $ nostack newapp -a ~/temp/myapp -b ~/temp/baseapp\n```\n\n_See code: [src/commands/newapp.ts](https://github.com/YizYah/no-stack-cli/blob/v0.3.4/src/commands/newapp.ts)_\n\n## `nostack quickstarter`\n\nCreates a new moderator and stack.  Also logs in the moderator locally.\n\n```\nUSAGE\n  $ nostack quickstarter\n\nOPTIONS\n  -a, --appDir=appDir        path and directory of application\n  -b, --baseApp=baseApp      path and directory of the base app to copy.\n  -c, --userClass=userClass  userClass for which to generate an app\n  -e, --email=email          moderator email\n  -h, --help                 show CLI help\n\n  -j, --jsonPath=jsonPath    path and filename for the stack json file.  The file tells you about your server and gets\n                             used to generate code for front end apps.\n\n  -l, --licenseId=licenseId  license id for the organization of the user\n\n  -s, --stack=stack          stack\n\n  -t, --template=template    app flow spec from which to spin up a stack\n\n  -u, --user=user            moderator to create\n\n  -w, --password=password    moderator password\n\nEXAMPLE\n  $ nostack quickstarter -u franky -s tempstack, -e franky@gmail.com -w franky12$ -a ~/temp/myapp -b ~/temp/baseApp -j \n  ~/temp/stack.json -t appFlow.txt -l ABC$123 -c buyer\n```\n\n_See code: [src/commands/quickstarter.ts](https://github.com/YizYah/no-stack-cli/blob/v0.3.4/src/commands/quickstarter.ts)_\n\n## `nostack spinstack`\n\nSpins up a fully functional backend from a provided template.  The same template can then be used to generate front end code using the command 'makeCode'.\n\n```\nUSAGE\n  $ nostack spinstack\n\nOPTIONS\n  -e, --email=email              email to be used by sample users\n  -h, --help                     show CLI help\n\n  -j, --jsonPath=jsonPath        path and filename for the stack json file.  The file tells you about your server and\n                                 gets used to generate code for front end apps.\n\n  -s, --stack=stack              stack\n\n  -t, --template=template        template from which to spin up a stack\n\n  -u, --user=user                moderator for stack\n\n  -x, --addedSuffix=addedSuffix  added suffix for sample instances generated\n\nEXAMPLE\n  $ nostack spinstack -u franky -s tempstack, -e franky@gmail.com -j ~/temp/stack.json -t appFlow.txt\n```\n\n_See code: [src/commands/spinstack.ts](https://github.com/YizYah/no-stack-cli/blob/v0.3.4/src/commands/spinstack.ts)_\n\u003c!-- commandsstop --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnostackapp%2Fns-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnostackapp%2Fns-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnostackapp%2Fns-cli/lists"}