Code from an AI
Codex and ChatGPT: from code in a chat to a running bot
In short
Code written in ChatGPT does not reach the internet by itself: first it has to be saved into a folder on your machine. From there the shortest path is Codex in the terminal: add Netrun as an MCP server with one command from the setup page and ask it to publish the project. The agent packs the folder, asks for missing tokens, waits for the build and returns the link or the reason it failed. The ChatGPT chat itself cannot publish yet — it does not run programs on your computer, so the connection lives on the Codex side.
A conversation with ChatGPT usually ends with finished code and the phrase “save this to a file and run it”. That is exactly where projects tend to die: the code works in the chat, then sits in the Downloads folder and never reaches the internet — because the next step sounds like “rent a server”.
Between the chat and a running bot there is exactly one missing link. Codex — the OpenAI console agent — can connect external services over MCP, and Netrun connects to it with a single command. After that the path is: save the code into a folder, open it in the terminal, ask for a deploy. Below are the steps, including an honest note about ChatGPT itself.
Save the code from the chat into a plain folder#
Create a project folder and lay out what ChatGPT wrote as files: the code, a dependency list (requirements.txt for Python, package.json for Node.js) and, if there is one, a sample environment file. Do not type tokens and keys into the files — let the code read them from environment variables, which is both safer and required for publishing.
Create an access key in Netrun#
In the dashboard open the “MCP” section and create a personal key. It is shown once, so copy it right away; a lost key is not recovered but revoked and replaced. The key only covers agent actions and can be switched off in the same section at any time.
Connect Netrun to Codex#
On the setup page pick Codex — there is a ready-made terminal command with your key already in it. Run it once and the server is available in all of your folders. Node.js has to be installed: if Codex runs for you, it almost certainly already is.
Ask for a deploy#
Start Codex in the project folder and write in plain words: “publish this bot to Netrun”. The agent packs the folder without service directories, uploads it and waits for the build. The platform detects the language and the project type on its own — a bot, a site or a background script — and starts it; a site gets an HTTPS address right away, a bot needs no address.
Answer the question about the token#
If the code reads a bot token or a paid API key from an environment variable, the agent stops and asks for the value. Send it in reply: it is stored encrypted and the project is rebuilt with it. The agent will not invent values — that is a rule, not luck.
Check and update the same way#
Ask for the status and the agent tells you whether the project runs and what is blocking it. “Check the logs” shows the last lines of output, “update the project” ships a new version at the same address. Payment, plan renewal and deleting projects are out of the agent’s reach: those are done by hand in the dashboard.
One important caveat: publishing lives on the Codex side, not in the ChatGPT chat itself — the web version does not run programs on your computer, so a local server cannot be attached to it. Code written in any chat, however, ships this way unchanged. On the free plan a site sleeps while idle and wakes up by itself; a bot needs the Pro plan with round-the-clock operation. The setup command is on the publish-from-your-editor page; if you would rather first make sure the project builds at all, there is a free project check with no sign-up.
Common questions
Can I publish a project straight from the ChatGPT chat?
Not from the web version yet: it does not run programs on your computer, and that is how the connection works. Today the path is to save the code into a folder and publish it from Codex, Cursor or Claude Code with one request. The code itself needs no changes.
How is this different from uploading an archive in the dashboard?
The result is identical — only the place changes. Through the agent you never leave the terminal and never zip anything by hand; through the dashboard it is easier when the project is already live and you want to look at it. You can alternate between the two on the same project.
What will the agent not do?
It will not pay, renew a plan, buy a place, or delete a project or files from persistent storage — those actions are closed for the key at the platform level. It also never invents tokens: if a value is missing, it asks you.
Do I need Docker or a ready Dockerfile?
No. The platform works out what the project is written in and builds it. If a Dockerfile or docker-compose is already in the folder, it is used — that is your choice, not a requirement.
What if the project fails to start?
Ask the agent to show the logs: the last lines of output almost always name the cause — a missing library, an empty token, a typo in the entry file. The agent can fix the code and ship a new version right away.
How many projects can I deploy this way?
As many as through the dashboard: the limit comes from your plan, not from the way you publish. The agent lists your projects and the remaining places on request — just ask it for the account state.
Can I publish straight from Cursor, Claude Code or ChatGPT?
Yes. The dashboard has an “MCP” section: create an access key there and connect it to Cursor, Claude Code, Codex or any other AI editor — with one button or one command. After that you just tell the agent “publish this bot to Netrun”: it uploads the code folder, asks you for the token if the code needs one, waits for the build and gives you the link. “I fixed the greeting — update it” ships a new version, “why is the bot silent?” shows the logs. The agent cannot pay, renew or delete projects — that stays in the dashboard.
Do I need to know how to work with Docker?
No. Netrun detects which language your project uses and builds it for you. If you already have a Dockerfile or docker-compose, we support them, but you do not need to write them specially.
How many projects can I keep?
Every plan includes one project. On Pro you can add up to two places, on Max — up to seven; each place gives you one more project of the same size as the plan. The free plan has no places: a second project means Pro.
Where do I set tokens and other secret values?
Every project has a Secrets tab where you set the values from your code — for example the token from BotFather. We store them encrypted: you can see the variable names, but the values are shown to no one, including you.