How to run next servers via a cli app?
Unanswered
Brown bear posted this in #help-forum
Brown bearOP
I have two types of Next.js apps:
Editor: A small Next.js app featuring an iframe and an AI chat panel.
Actual App: The main application displayed within the iframe mentioned above.
The editor is just a wrapper around the actual app. The idea here is that the user can ask the chat anything about the actual app, and the editor app will respond back with the output, the editor can even make code changes to the actual app by editing the code.
The editor's code won't change, so if needed it can be bundled, published to npm, bundled with the CLI app I have mentioned. However, the actual app's code is something the user has full control over.
I am planning to ship the actual app as a starter, so that they can clone it and make the app they need.
I don't want them to clone the editor separately and make it point to the actual app's directory.
Here's what I have in mind:
Developing a CLI Node.js app that starts both the editor and the actual app. Users would simply navigate to the directory of their actual app and execute
Essentially, the CLI Node.js app's role would be to launch two Next.js apps, namely the editor and the actual app.
Could someone please advise me on how to set up something like this or suggest an alternative approach to achieve the desired functionality?
I am using Next JS 14 (App Router)
Editor: A small Next.js app featuring an iframe and an AI chat panel.
Actual App: The main application displayed within the iframe mentioned above.
The editor is just a wrapper around the actual app. The idea here is that the user can ask the chat anything about the actual app, and the editor app will respond back with the output, the editor can even make code changes to the actual app by editing the code.
The editor's code won't change, so if needed it can be bundled, published to npm, bundled with the CLI app I have mentioned. However, the actual app's code is something the user has full control over.
I am planning to ship the actual app as a starter, so that they can clone it and make the app they need.
I don't want them to clone the editor separately and make it point to the actual app's directory.
Here's what I have in mind:
Developing a CLI Node.js app that starts both the editor and the actual app. Users would simply navigate to the directory of their actual app and execute
mycli . provided mycli is globally installed. This command should then start both the editor and the actual app from that directory.Essentially, the CLI Node.js app's role would be to launch two Next.js apps, namely the editor and the actual app.
Could someone please advise me on how to set up something like this or suggest an alternative approach to achieve the desired functionality?
I am using Next JS 14 (App Router)
4 Replies
Do you really 'need' an downloadable 'CLI'? using some sort of script (possibly a bash script) would also work.
@Pearls Do you really 'need' an downloadable 'CLI'? using some sort of script (possibly a bash script) would also work.
Brown bearOP
I need to publish this cli so that others can use it
Their flow:
1. globally install the cli
2. clone the starter from github
3. navigate to the directory having the starter (main app), run
1. globally install the cli
2. clone the starter from github
3. navigate to the directory having the starter (main app), run
mycli . - this should start the iframe app and the main appAlmost everyone can run a bash script, its easier to make, it can have the same flow as an actual cli aswell