DEV Community

Cover image for I Support 12 Programming Runtimes Without a Single Config File. Here’s How the Inference Engine Works.
Harun - solo dev
Harun - solo dev

Posted on

I Support 12 Programming Runtimes Without a Single Config File. Here’s How the Inference Engine Works.

Supporting multiple programming languages in a cloud platform usually means forcing developers to write configuration files.

Dockerfile, docker-compose.yml, devcontainer.json. If you want to run Python, write this. If you want to run Go, write that.

I built HYNA-Stage to eliminate this friction. The platform currently supports 12 different programming runtimes, and the user doesn't write a single line of configuration to use them.

Instead of asking the developer what they are building, the CLI looks at their repository and figures it out.

Here is the exact logic behind the inference engine, how it handles edge cases, and where it still fails.

TL;DR

  • HYNA-Stage uses a CLI inference engine to auto-detect runtimes by scanning for standard manifest files (package.json, requirements.txt, go.mod, etc.).
  • It infers the package manager, runtime version, and default start command.
  • If inference fails, users can override it with CLI flags (--runtime, --start) instead of writing YAML.
  • The system struggles with monorepos and non-standard build scripts, which is an active area of development.

🧠 How the Inference Engine Actually Works

When a user runs hyna-stage up, the CLI executes a detection function before it ever talks to the cloud. It scans the root directory for known manifest files.

Here is a simplified version of the detection logic running in the CLI:

import fs from 'fs';
import path from 'path';

function detectRuntime(projectDir) {
  const files = fs.readdirSync(projectDir);

  if (files.includes('package.json')) {
    const pkg = JSON.parse(fs.readFileSync(path.join(projectDir, 'package.json'), 'utf8'));
    // Check for yarn.lock or pnpm-lock.yaml to infer package manager
    if (files.includes('yarn.lock')) return { runtime: 'node', manager: 'yarn', start: pkg.scripts?.start || 'node index.js' };
    if (files.includes('pnpm-lock.yaml')) return { runtime: 'node', manager: 'pnpm', start: pkg.scripts?.start || 'node index.js' };
    return { runtime: 'node', manager: 'npm', start: pkg.scripts?.start || 'node index.js' };
  }

  if (files.includes('requirements.txt') || files.includes('Pipfile')) {
    return { runtime: 'python', manager: 'pip', start: 'python main.py' };
  }

  if (files.includes('go.mod')) {
    return { runtime: 'go', manager: 'go', start: 'go run main.go' };
  }

  if (files.includes('Cargo.toml')) {
    return { runtime: 'rust', manager: 'cargo', start: 'cargo run' };
  }

  // Fallback
  return null; 
}
Enter fullscreen mode Exit fullscreen mode

This function returns a structured object that the provisioning pipeline uses to set up the MicroVM environment. No YAML required.

🛠️ The Fallback: When Inference Fails

Inference is a heuristic, not magic. It works perfectly for standard web servers, APIs, and scripts. It fails when developers use custom build steps or non-standard file names.

Instead of forcing users to write a config file when the guess is wrong, I built an escape hatch using CLI flags:

# Override the runtime and start command manually
hyna-stage up --runtime python --start "uvicorn main:app --port 8000"
Enter fullscreen mode Exit fullscreen mode

This covers the edge cases without bringing the complexity of a configuration file back into the workflow.

📂 How I Organized the CLI

To keep the inference logic maintainable as I add more runtimes, I structured the CLI project by responsibility:

cli/
├── src/
│   ├── commands/
│   │   └── up.js          # The main entry point for provisioning
│   ├── inference/
│   │   └── detect.js      # The runtime detection logic shown above
│   ├── api/
│   │   └── client.js      # Supabase Edge Function communication
│   └── index.js           # Commander setup
├── package.json
└── README.md
Enter fullscreen mode Exit fullscreen mode

Separating inference/detect.js from the provisioning logic means I can add a new language (like Ruby or PHP) by just updating one file, without touching the network code.

⚠️ The Honest Limitations

I want to be clear about where this approach breaks down, because pretending it doesn't will just frustrate users:

  1. Monorepos: If you have three package.json files in different folders, the current engine only looks at the root. It will guess wrong.
  2. Custom Build Steps: If your app requires npm run build before npm start, the engine doesn't know that yet. It will try to start the uncompiled source.
  3. Global Dependencies: If your app relies on a globally installed tool (like prisma or typescript CLI) that isn't in your package.json dependencies, the sandbox won't have it.

I am working on a --manifest flag to specify a sub-directory for monorepos, and a build detection step, but they aren't shipped yet.

🔨 Try the Inference Engine

I want to see what happens when you point the CLI at a repo with zero infrastructure code.

npm install -g @hynaweb/stage
hyna-stage init python  # Or go, rust, node
Enter fullscreen mode Exit fullscreen mode

Dashboard: https://hyna-stage.netlify.app/
GitHub: https://github.com/harun-sket/hyna-stage

If you try it on a weird tech stack and it fails, open an issue on GitHub. Tell me what files your project uses, and I'll add them to the detection logic.

— Harun, Founder & CEO, HYNAWEB 🐯☁️

Top comments (83)

Collapse
 
effessdev profile image
EffessDev •

Bro seen this? 🤔

Collapse
 
koda2026 profile image
Harun - solo dev •

Seen bro 🤫

Picked as gem
Collapse
 
effessdev profile image
EffessDev •

Seen it then why not give me reactions??? 👿

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Bro actually i have koda cursor which is 100% autonomously do things so i didn't just get a WOW ( honest talk) if you want i will transfer the ownership?

Picked as gem Thread Thread
 
effessdev profile image
EffessDev •

Hehe, the purpose of ReptClip is different :) Thanks for the like! 😊

Transfer ownership means? 🤔

Thread Thread
 
effessdev profile image
EffessDev •

You gave me 🤯, 🦄, 🙌, and 🔥 but no 💖 :(

Picked as gem Thread Thread
 
koda2026 profile image
Harun - solo dev •

I will give koda cursor to you and bro i have a organization : dev.to/hynaweb and bro i posted a post look at that bro

Picked as gem Thread Thread
 
effessdev profile image
EffessDev •

Ok I'll check...

Thread Thread
 
effessdev profile image
EffessDev •

Empty:

Thread Thread
 
koda2026 profile image
Harun - solo dev • • Edited

Wait?

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Okay bro lets the whole community and i hve a doubt if my follower gets a notifications of my hynaweb organization post

Thread Thread
 
effessdev profile image
EffessDev •

What? 🤔

Thread Thread
 
koda2026 profile image
Harun - solo dev •

What = what?

Thread Thread
 
effessdev profile image
EffessDev •

I mean I didn't understand... 🤔

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Like dont care ****

Thread Thread
 
effessdev profile image
EffessDev •

No no I really didn't understand... 🤔

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Bro nothing just drop your single best OSS project and I'll give it a star and you give me back one and i give you one and repeat until i get 8 gem badge okay?

Picked as gem Thread Thread
 
effessdev profile image
EffessDev •

You mean gem or star? 🤔

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Bro the star 💎

Thread Thread
 
effessdev profile image
EffessDev •

Isn't that a gem? 🤔

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Okay

Thread Thread
 
effessdev profile image
EffessDev •

What okay? 🤔

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Bro iam giving a gem to you you give me back okay?

Thread Thread
 
effessdev profile image
EffessDev •

💯

Picked as gem Thread Thread
 
koda2026 profile image
Harun - solo dev •

Bro gave gem give me back one 💎

Thread Thread
 
effessdev profile image
EffessDev •

Ok!

Picked as gem Thread Thread
 
effessdev profile image
EffessDev •

Done! 😊

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Okay bro agin

Thread Thread
 
koda2026 profile image
Harun - solo dev •

@effessdev BRO I SENT THE GEM BRO GIVE ME BACK

Thread Thread
 
effessdev profile image
EffessDev •

Ok!

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Hmm thanks bro we are doing it until 8 gem badge okay?

Thread Thread
 
effessdev profile image
EffessDev •

Got it?

Picked as gem Thread Thread
 
koda2026 profile image
Harun - solo dev •

Bro go it now again until i get 8 gem badge

Thread Thread
 
effessdev profile image
EffessDev •

Ok 🤣🤣🤣

Picked as gem Thread Thread
 
effessdev profile image
EffessDev •

Got it? 🤔

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Bro got it now lets give it back

Picked as gem Thread Thread
 
effessdev profile image
EffessDev •

Ok...

Thread Thread
 
effessdev profile image
EffessDev •

Got it?

Picked as gem Thread Thread
 
koda2026 profile image
Harun - solo dev •

Got it bro

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Sent another

Picked as gem Thread Thread
 
effessdev profile image
EffessDev •

Got it?

Picked as gem Thread Thread
 
koda2026 profile image
Harun - solo dev •

Bro next 16 gems

Picked as gem Thread Thread
 
effessdev profile image
EffessDev •

Bro noooo

Thread Thread
 
effessdev profile image
EffessDev •

Gave it

Thread Thread
 
effessdev profile image
EffessDev •

But now 16 lol no

Picked as gem Thread Thread
 
koda2026 profile image
Harun - solo dev •

Thanks bro

Picked as gem Thread Thread
 
koda2026 profile image
Harun - solo dev •

Bro this helps both us and followed you on GitHub

Thread Thread
 
koda2026 profile image
Harun - solo dev •

@effessdev gave it give me back

Thread Thread
 
effessdev profile image
EffessDev •

Bro I have to leave lol today itself?

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Meaning?

Thread Thread
 
effessdev profile image
EffessDev •

Gave it back

Picked as gem Thread Thread
 
koda2026 profile image
Harun - solo dev •

Thanks here's yours

Thread Thread
 
effessdev profile image
EffessDev •

I mean do we need to complete all 16 today itself?

Thread Thread
 
effessdev profile image
EffessDev •

Ah then let's do it quickly no need to send a comment each time ok?

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Yep bro and dev.to curators looking : 👁👄👁

Picked as gem Thread Thread
 
koda2026 profile image
Harun - solo dev •

@effessdev bro speak

Thread Thread
 
koda2026 profile image
Harun - solo dev •

@effessdev bro?

Thread Thread
 
koda2026 profile image
Harun - solo dev •

@effessdev bro gave it

Thread Thread
 
effessdev profile image
EffessDev •

Gave it back!

Picked as gem Thread Thread
 
koda2026 profile image
Harun - solo dev •

Bro here again

Picked as gem Thread Thread
 
effessdev profile image
EffessDev •

Gave it!

Picked as gem Thread Thread
 
koda2026 profile image
Harun - solo dev •

Bro here again

Thread Thread
 
koda2026 profile image
Harun - solo dev •

@effessdev bro LETS DO THIS ON MY NEW POST

Picked as gem Thread Thread
 
koda2026 profile image
Harun - solo dev •

@effessdev BRO AFTER EVERY MESSAGE I SEND THE REPLY DELETE THE MESSAGE

Thread Thread
 
koda2026 profile image
Harun - solo dev •

@effessdev bro? Comment

Thread Thread
 
koda2026 profile image
Harun - solo dev •

@effessdev bro??? ¿

Thread Thread
 
effessdev profile image
EffessDev •

Comment here?

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Yep bro give me gem back

Thread Thread
 
effessdev profile image
EffessDev •

I already gave you back :)

Picked as gem Thread Thread
 
koda2026 profile image
Harun - solo dev •

Okay here bro

Picked as gem Thread Thread
 
koda2026 profile image
Harun - solo dev •

Here back bro

Thread Thread
 
koda2026 profile image
Harun - solo dev •

@effessdev bro dev.to bug so comment i can give you gem but in my newest post

Thread Thread
 
effessdev profile image
EffessDev •

Can you mention me in the newest post? So I can click it easily?

Thread Thread
 
koda2026 profile image
Harun - solo dev •

I already mentioned you

Thread Thread
 
effessdev profile image
EffessDev •

is this the new post?

Thread Thread
 
koda2026 profile image
Harun - solo dev •
Collapse
 
effessdev profile image
EffessDev •

Bro why only 14 commits in the Hyna Stage repo? 🤔

Collapse
 
koda2026 profile image
Harun - solo dev •

Yep because mostly i didn't commit bur update the dashboard

Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

wow peak scamming why harun are you scamming gems 😂

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Shooo 🤫🤫🤫

Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

curroption is not bad, it is only bad when I'm not involved if I'm involved in that curruption then I will protect it.

Thread Thread
 
koda2026 profile image
Harun - solo dev •

Bro

Collapse
 
koda2026 profile image
Harun - solo dev •

dev.to/hynaweb/the-hynaweb-oss-sho...
HERE THE LINK BRO 🔥