rundir
v0.1.1
Published
Run a directory as a Node.js, Python, or .NET app
Readme
rundir
rundir is a small CLI that tries to run a directory as a Node.js, Python, or .NET app.
It checks in this order:
- Node.js project
- Python project
- .NET project
If none match, it exits with an error.
Install
Global
pnpm add -g rundirOne-off with pnpm dlx
pnpm dlx rundirUsage
Run current directory:
rundirRun a specific directory:
rundir ./path/to/projectDetection rules
Node.js
- If
package.jsonhas astartscript, runs that script.- Uses
pnpm startifpnpm-lock.yamlexists - Uses
yarn startifyarn.lockexists - Uses
bun startifbun.lockorbun.lockbexists - Otherwise uses
npm run start
- Uses
- Else if
package.json.mainpoints to an existing file, runsnode <main>. - Else if
index.jsexists, runsnode index.js.
Python
- Runs the first matching file with
python:main.pyapp.pyrun.pyserver.py__main__.py
.NET
- If one or more
.csprojfiles exist, runs:dotnet run --project <project-file>- Prefers
<directory-name>.csprojwhen present
- Else if a
.slnfile exists, runsdotnet run.
Development
Install dependencies:
pnpm installBuild:
pnpm run buildType-check:
pnpm run typecheckRun locally in dev mode:
pnpm run dev -- [directory]Run built CLI directly:
node dist/index.js [directory]Publish to npm
- Update version in
package.json - Login to npm:
pnpm login - Publish:
pnpm publish
prepack runs automatically before publish and creates a fresh build.
